Identify objects based on their centroid

13 ビュー (過去 30 日間)
Rabbe Kabbo
Rabbe Kabbo 2022 年 6 月 18 日
回答済み: Image Analyst 2022 年 6 月 18 日
I want to identify objects from a binary image based on their centroid and highlight them. How can I do that?

回答 (1 件)

Image Analyst
Image Analyst 2022 年 6 月 18 日
To get the centroids for your binary image, which I'll call mask
props = regionprops(mask, 'Centroid');
xyCentroids = vertcat(props.Centroid)
Now, explain why you mean by highlighting them based on their centroid, because I don't know what that means.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by