Detection of 3D blobs with flat surfaces

7 次查看(过去 30 天)
I have a 3D gray-scale array that represents a bag with several objects inside. I need to find (segment) any object with flat surface/s in the bag. Knowing the approximate intensity range of these objects, I binarized the volume, and removed objects with volumes below a threshold.
The result was getting some of those objects as individual blobs and some attached to nearby objects.
Now, I would like to detect blobs with flat surfaces. Any suggestion?
  2 个评论
Roohollah Milimonfared
编辑:Roohollah Milimonfared 2019-8-26
That's right. Only expand it to 3D. An example of a 3D blob with flat surfaces is a cylinder (flat surfaces at its two ends).
In my problem, the blobs have more complicated shapes, but some have flat surfaces that I would like to use as a characteristic to detect them.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2019-8-26
编辑:Image Analyst 2019-8-26
Try convhulln() and extract any blob that has points on the convex hull.
  4 个评论
Roohollah Milimonfared
编辑:Roohollah Milimonfared 2019-8-26
stats = regionprops3(blob,'ConvexImage','ConvexHull','VoxelList');
The binary blob (right) and its ConvexImage (left):
blob.png
C = intersect(stats.ConvexHull{1,1},stats.VoxelList{1,1},'rows');
C is empty which means the blob has no point on its convex hull.
Below is the plot of voxels (red) and convex hull points (blue). On the top surface, the convex hull points are located at the edges. Can we use this fact to say it is a (nearly) flat surface?
blob1.png
Roohollah Milimonfared
编辑:Roohollah Milimonfared 2019-8-26
I have come up with this trivial solution.
In this problem, the direction of the flat surface is fixed (y-axis is always the axis normal to the flat surface). Sort the y-coordinates (the first column in ConvexHull) in descending order:
ConvexHull = stats.ConvexHull{1,1};
ConvexHull = sortrows(ConvexHull,1,'descend');
Find the Standard Deviation of the first 10% of the ConvexHull coordinates.
threshold = size(ConvexHull,1) * 0.1;
y_coor = ConvexHull(1:threshold,1);
x_coor = ConvexHull(1:threshold,2);
z_coor = ConvexHull(1:threshold,3);
y_std = std(y_coor) % 0.948
x_std = std(x_coor) % 23.676
z_std = std(z_coor) % 49.474
The value of y-std found to be significantly lower than its counterparts (x_std & z_std).
The positions of the 10% of the ConvexHull points in the blob indicates there should be a lower STD for y-coordinates:
Still, need to verify this for my other random-shaped blobs with flat surfaces.
Thoughts and opinions on this is much appreciated.

请先登录,再进行评论。

更多回答(1 个)

darova
darova 2019-8-26
What about boundary()?
BoundaryOf3DPointCloudExample_02.png
Once you have boundary faces: find all neighbour faces for each node
If angles between surfaces is about zero then we have a flat face
12Untitled.png

类别

Help CenterFile Exchange 中查找有关 Bounding Regions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by