Message Boards Message Boards

3
|
8596 Views
|
1 Reply
|
6 Total Likes
View groups...
Share
Share this post:

Measure relative lengths of objects

Posted 11 years ago
Below is a processed image of objects that look like lines and are differentiated using the MorphologicalComponents function. I want to measure the relative lengths of the objects and to do this I have used the 'best fit ellipse':

variable = ComponentMeasurements [ MorphologicalComponents [ binarizedImage ],  "Length"];

My question is; does the above method measure the best fit ellipse for each object (line) or does it do it for groups of lines in the image instead? Secondly, is it possible to draw the best fit ellipses too?  

Many thanks for your help in advance.
 
POSTED BY: M Edwards

ComponentMeasurements measures each component independently.

An example with an image from the documentation:

 With[{segmentation = MorphologicalComponents[image]}, 
 Show[
  image,
  Graphics[{Red, Thick, 
    Rotate[Circle @@ #[[{1, 2}]], #[[3]]] & /@ 
     ComponentMeasurements[segmentation, {"Centroid", "SemiAxes", "Orientation"}][[All, 2]]}]
 ]
]

best<em>fitellipses

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract