Image processing - calculate center mass and its initial moment
17 views (last 30 days)
Show older comments
Ali alshamrani
on 15 Feb 2021
Commented: Image Analyst
on 23 Feb 2021
I have video which contains a 1000 frames, in spesific frame I did segmentation and the image become white and black as it attched. how I can find the center mass for this segmented white part.
0 Comments
Accepted Answer
Image Analyst
on 15 Feb 2021
Call regionprops(binaryImage, 'Centroid')
binaryImage = bwareafilt(binaryImage, 1); % Take largest only.
props = regionprops(binaryImage, 'Centroid') % Find centroid.
xCentroid = props.Centroid(1);
yCentroid = props.Centroid(2);
See the Image Segmentation Tutorial in my file Exchange for a full demo:
6 Comments
Image Analyst
on 23 Feb 2021
Just crop out each blob one at a time and compute the central moments one at a time.
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!