Centroid detection for irregular shape objects

11 views (last 30 days)
nitin arora
nitin arora on 16 Mar 2015
Answered: Avinash Andhale on 1 Dec 2017
I am trying to find the centroid of irregular shaped objects from a binary image. For some objects, no centroid is detected and for some, more than one centroid is detected. I am using regionprops with bwconncomp(8-neighbourhood). Some objects have holes in them whereas others are filled.Please advice on how to proceed?

Answers (3)

Image Analyst
Image Analyst on 17 Mar 2015
That sounds really bizarre. Please attach your binary image so I can try it. There can be a few reasons why you might think that some objects have two centroids, for example if you have a disc surrounded by a C - both centroids would lie in the disc. And so you might think the C had no centroid while the disc had two centroids. Be aware that the centroid of a region does not necessarily lie within the region, like in the example of a C-shaped region.
  6 Comments
nitin arora
nitin arora on 24 Mar 2015
Actually, I was trying to isolate completely black objects from circular objects(black edges and white centres) by using Fovea Pro in photoshop 1. Manual threshold at 1.0 (to isolate completely black objects) This step eats up some parts of the edge of circular objects 2. Automatic threshold using Johanneson method(to isolate both type of objects from background) 3. Absolute difference of above two image followed by inversion. 4. Open EDM 1 iteration(open the left over edge of completely black object) followed by close EDM 2 iterations(close circular objects)
I followed your advice and processed automatic segmented image(binary image containing both type of objects, see attached). The centroids are marked on it. Still the centroids have not been detected for some objects and for some, more than one. Please advice. Thanks a lot for help.

Sign in to comment.


nitin arora
nitin arora on 17 Mar 2015
Edited: Image Analyst on 17 Mar 2015
Thanks for the quick reply. Please find the image attached. This is a really dirty and noisy system. So, I am not expecting perfection. I noticed that for completely black objects(no holes), no centroid was detected. Please advice. I need to fully automate the image analysis protocol. So, manual correction of objects is not desirable.

Avinash Andhale
Avinash Andhale on 1 Dec 2017
i want to find centroid of the detected object in a image ..How to do that ?

Community Treasure Hunt

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

Start Hunting!