how to calculate the center of an object in binary image
13 ビュー (過去 30 日間)
古いコメントを表示
hellow dears i need support to calculate the center of an object in binary image, the binary image has only one object so that i need to find the center of that object in order to crop the object from the binary image as in attached image
0 件のコメント
採用された回答
Image Analyst
2016 年 2 月 27 日
You do not need the center of the blob to crop it from the image. You need the bounding box.
measurements = regionprops(binaryImage, 'BoundingBox');
croppedImage = imcrop(binaryImage, measurements.BoundingBox);
8 件のコメント
Image Analyst
2016 年 2 月 28 日
You're welcome. Thanks for accepting. You don't need my email because if you need help again you can post back here in Answers and possibly get more answers than from just me.
その他の回答 (2 件)
Walter Roberson
2016 年 2 月 27 日
Use regionprops() and ask for Centroid
7 件のコメント
Walter Roberson
2016 年 2 月 27 日
regionprops should already act that way.
Note: the page you posted, aaaaa.png, has two or more blobs, because it has the grayscale image at the left and the diagram at the right. You need to be operating on just the grayscale image.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!