Detect multiple shapes in a point cloud
4 views (last 30 days)
Show older comments
Judith Fonken
on 22 Dec 2020
Answered: Image Analyst
on 22 Dec 2020
Hi all,
For my PhD project, I need to convert CT segmentations of the abdominal aorta into a mesh. As a substep in my code, I need to detect bifurcation shapes. The input of this part of the code is a point cloud of N points with X,Y,Z coordinates. Initially, the points are not ordered (first image), but I can order them in a circular manner (second image). This point cloud represents a single shape, corresponding to a part of the aorta region. In figures 3 & 4, another slice is represented using scatter and plot respectively. This point clouds represents a part of the bifurcation region, in which the aorta splits into the left and right iliac arteries. Two separate shapes can be seen. However, I haven't been able to find of think of a good code to detect the difference between contour 1 (fig 1&2, one shape) and contour 2 (fig 3&4, two shapes). All I have so far is based on the distance between points. In figure 4, the distance between one point on the first shape to one point on the shape is a lot bigger than the distance between all other points. However, using this method, I'll need to work with a threshold, which could be quite hard to determine accurately.
Therefore, I was wondering if anyone has an idea (or code) to detect the number of shapes that are present in the point cloud. So the code should give a value of 1 for the red contour (fig 1&2) and a value of 2 for the flue contour (fig 3&4). If anyone has a good idea, I'm happy to hear!

0 Comments
Accepted Answer
Image Analyst
on 22 Dec 2020
You could take the points and use poly2mask() to make a binary image. Then measure the aspect ratio of the binary image using regionprops():
mask = poly2mask(x, y, rows, columns);
props = regionprops(mask, 'MajorAxisLength', 'MinorAxisLength');
aspectRatios = [props.MajorAxisLength] / [props.MinorAxisLength];
Obviously the two shapes have different aspect ratios so just threshold
for k = 1 : length(props)
if aspectRatios(k) > 2 % or whatever...
% It's long shape 2
else
% It's circular shape 1.
end
end
0 Comments
More Answers (0)
See Also
Categories
Find more on Point Cloud Processing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!