- Centroid: Center of mass of the region, returned as a 1-by-Q vector. The first element of Centroid is the horizontal coordinate (or x-coordinate) of the center of mass. The second element is the vertical coordinate (or y-coordinate). All other elements of Centroid are in order of dimension.
- Image: Image the same size as the bounding box of the region, returned as a binary (logical) array. The on pixels correspond to the region, and all other pixels are off.
regionprops( aImage, 'Centroid', 'Image' ) vs regionprops( aImage, 'Centroid' );
조회 수: 3 (최근 30일)
이전 댓글 표시
I am new to MatLab.
I am working with code harvested from the internet that lacks comments.
In one place there is a call:
x = regionprops( aImage, 'Centroid', 'Image' );
and in another place is a call
x = regionprops( aImage, 'Centroid' );
using the same image.
The Help for regionprops is extensive, but I cannot figure outwhat the difference would be between those two calls.
Can somebody fill me in? Is this something that needs to be documented?
댓글 수: 0
채택된 답변
Walter Roberson
2020년 3월 27일
Each option to regionprops() tells it another property to measure and return
Thus the first of the calls returns a struct into x that has fields Centroid and Image with values as described above, and the second of the calls returns a struct into x that has only field Centroid with value as described above.
The 'Image' option does not change the way that the centroid is computed: it says to also compute something more and return it.
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!