How does regionprops compute for the centroid?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
Im wondering on how does regionprops computer for its centroid properties? It says that
'Centroid' – 1-by-Q vector that specifies the center of mass of the region. Note that the first element of Centroid is the horizontal coordinate (or x-coordinate) of the center of mass, and the second element is the vertical coordinate (or y-coordinate). All other elements of Centroid are in order of dimension.
This figure illustrates the centroid and bounding box for a discontiguous region. The region consists of the white pixels; the green box is the bounding box, and the red dot is the centroid.
Its not really detailed. I wanna know how it computes for the centroid on step by step process. Thank you for your answer.
0 comentarios
Respuestas (2)
Image Analyst
el 19 de Sept. de 2015
It's probably the usual definition where it's the mean of all the x and y coordinates of the blob. Are you finding some discrepancy with that?
0 comentarios
Matthew Eicholtz
el 21 de Mzo. de 2016
You can actually look at the function directly if you want!
open regionprops
In R2016a, the ComputeCentroid function starts at line 501. As Image Analyst suggested, it is indeed computed by taking the mean x and y values for pixels in the blob.
0 comentarios
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!