Additional properties from regionprops
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Veena Chatti
el 9 de Mzo. de 2020
Comentada: Image Analyst
el 27 de Abr. de 2020
Hi all,
I'm using regionprops to extract some properties from a watershed segmentation of polygonal objects in an image. It returns values for the centroid, area, and perimeter of each segmented polygon.
Does anyone know if there's a way to extract specific lengths of the sides of the polygons, rather than just their entire perimeters?
Looking forward to your suggestions!
Thanks!
Best,
Veena
0 comentarios
Respuesta aceptada
Adam Danz
el 9 de Mzo. de 2020
You could also return the "ConvexHull" values which will return a p-by-2 matrix for each polygon where each row of the matrix contains the x- and y-coordinates of one vertex of the polygon. Then you could use pdist() to compute the length of each segment.
5 comentarios
Image Analyst
el 27 de Abr. de 2020
Note: using the convex hull will only work for polygons or shapes that are convex. If you have any shapes that have any incursions into them, like a blob shaped like the letter F or H or Z etc., the convex hull will not work.
Más respuestas (1)
Image Analyst
el 10 de Mzo. de 2020
You need to compute the boundary of each polygon with bwboundaries(). Then use findpeaks() to decide how many vertices there are. Then you can extract each "straight" segment from the boundary and do some kind of analysis on the shape of that "line". See my attached shape recognition demo to get you started.
0 comentarios
Ver también
Categorías
Más información sobre Image Segmentation and Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!