how to calculate the center of an object in binary image
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
haider alnaqeeb
am 27 Feb. 2016
Kommentiert: Image Analyst
am 28 Feb. 2016
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 Kommentare
Akzeptierte Antwort
Image Analyst
am 27 Feb. 2016
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 Kommentare
Image Analyst
am 28 Feb. 2016
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.
Weitere Antworten (2)
Walter Roberson
am 27 Feb. 2016
Use regionprops() and ask for Centroid
7 Kommentare
Walter Roberson
am 27 Feb. 2016
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.
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!