how to get the major axis co-ordinates of an segmented image

1 view (last 30 days)
we have drawn the major axis for the segmented image. Now we need co-ordinates of the all major axis pixels. please help us advance thanks

Answers (1)

Image Analyst
Image Analyst on 12 Feb 2016
Ask regionprops() for the centroid as well as the orientation. After that it's simple algebra that I'm sure you can handle because you learned the point-slope formula for a line back in the 10th grade. As you move outward, in both directions, from the centroid, just round the row and column and see if they are non-zero in your labeled image. If it's the label Index it's in the blob, if it's 0, you've left the blob. Be aware that the major axis and centroid may actually be outside the blob for really tortuous blob shapes, like a blob that is a "C" shape for example. For that reason you need to use the labeled image instead of the binary image so you know that you're checking for the correct blob number.

Community Treasure Hunt

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

Start Hunting!