How does regionprops compute for the centroid?
5 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
Image Analyst
2015 年 9 月 19 日
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 件のコメント
Matthew Eicholtz
2016 年 3 月 21 日
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 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!