Image processing - calculate center mass and its initial moment

5 ビュー (過去 30 日間)
Ali alshamrani
Ali alshamrani 2021 年 2 月 15 日
コメント済み: Image Analyst 2021 年 2 月 23 日
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.

採用された回答

Image Analyst
Image Analyst 2021 年 2 月 15 日
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 件のコメント
Ali alshamrani
Ali alshamrani 2021 年 2 月 23 日
hi, I actually the code worked very well but the only problem was i have many blobs and the code just took the largest one. I want to include all blobs to get the centroid all. How can I do that, beside Is there any way to draw a specific area in the image to be the only interest area?
Image Analyst
Image Analyst 2021 年 2 月 23 日
Just crop out each blob one at a time and compute the central moments one at a time.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by