How do I perform erosion and dilation on point cloud

I have a point cloud representing top view of two nearby objects. Performing segmentation using pcsegdist identifies them as one segment. I feel like I would be able to separate them into two objects after applying erosion. How can I achieve erosion in pointclouds?
Thanks!

 Accepted Answer

Transform the point cloud into an image, then you can use Matlab image processing tools and functions.
A quick search on the File Exchange lead me to this function, but I have not tested it myself.

6 Comments

Thanks for your answer! I tried it and it is mapping to 2D.
After applying segmentation I can map it back to 3D.
They used knnsearch when converting point cloud to 2D image. I guess I can use the same for mapping it back to 3D.
Thanks again.
DGM
DGM on 19 Jul 2021
Edited: DGM on 19 Jul 2021
strel() supports 3D structuring elements; imdilate() and imerode() work on 3D data as well.
@DGM 3D data is not the same as 3D point clouds.
@Farah Saeed If it solves your problem, then accept the answer please.
@DGM This can be useful if we can convert the point clouds into voxel/grid representation. If you have any ideas about conversion from point clouds to voxel/grid, you may share here.

Sign in to comment.

More Answers (0)

Asked:

on 15 Jul 2021

Commented:

on 19 Jul 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!