How can I find coordinates of centre of mass of bright objects present in the image

2 views (last 30 days)
Hi all, I am trying to find the centre of mass coordinate of my brighter objects in a image using MATLAB. The image is shown in my profile picture. I don't know how can I do this in MATLAB. I need help on this. Some of my friend told me it is impossible to do in MATLAB. Please help me.

Answers (1)

Image Analyst
Image Analyst on 4 Sep 2012
Edited: Image Analyst on 4 Sep 2012
This is done in my Image Segmentation Tutorial: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 Apply it to your image. If it doesn't work and you can't figure out why, even after looking at all the various steps along the way where it finds intermediate images, then come back here.
By the way, you should hang out with smarter friends.
  2 Comments
Chakra Joshi
Chakra Joshi on 5 Sep 2012
Still I wasn't able to find centre of mass coordinates. Any idea how can I make this work easy. Thanks for your great effort.
Image Analyst
Image Analyst on 5 Sep 2012
Edited: Image Analyst on 5 Sep 2012
Change "Centroid" to "WeightedCentroid" wherever you see it in the demo code. You might have to do a flat field correction (perhaps with the adapthisteq function or something) if there is a big gradient in your background that prevents you from using a single global threshold. Upload your image to tinypic.com if you want, and perhaps I might have time to do something with it (no guarantees though).

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!