i want to find centroid of the detected object in a image ..How to do that ?image is attached here
7 views (last 30 days)
Show older comments
i have done segmentation now i want find centroid of the detected object ,how i will do it using regionprops
0 Comments
Accepted Answer
Image Analyst
on 2 Feb 2019
You can use regionprops
props = regionprops(binaryImage, 'Centroid');
allCentroidsXY = vertcat(props.Centroid);
2 Comments
More Answers (1)
Walter Roberson
on 2 Feb 2019
If you pass regionprops a logical array as the first parameter and request 'centroid' then it will return a structure array in which there is one centroid for each of those white blobs.
If you pass regionprops an array of any other numeric data type as the first parameter, and request 'centroid', then it will return a scalar structure in which the only centroid is for the all of the white blobs considered as if they form a single object.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!