How to visualize MajorAxisLength and MinorAxisLength on images?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nut
am 12 Jul. 2016
Kommentiert: Image Analyst
am 15 Jan. 2018
Hi,
I would like to replicate something similar to that shown in the explanation of "Orientation" property of the "regionprops" function, as viewable here:
I would plot the red ellipse and the blue lines representing the axes, over my images (both binary and grayscale). I found this example:
but I can't understand how complete the code to plot the blue lines. Could anyone help me, please?
Thanks for your answers.
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 12 Jul. 2016
Get the two endpoints of the line, then call plot. For example x1 = xCentroid + (majorAxisLength/2) * cosd(orientation). Same for y1, x2,and y2. It's just simple trigonometry. Then call plot([x1,x2], [y1,y2], 'r-').
4 Kommentare
hu
am 14 Jan. 2018
Is it possible to modify the code so I can see how to run it on image contain several objects (like rice.png)?
Thanks a lot.
Image Analyst
am 15 Jan. 2018
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Segmentation and Analysis finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!