MATLAB Answers

centroid calculation for multiple patches in an image

6 views (last 30 days)
LM Pant
LM Pant on 24 Oct 2020
Commented: LM Pant on 25 Nov 2020
hello i have an experimental image having many bright patches. I want to compute the centroid of each patch. if anybody can help how to compute.

  0 Comments

Sign in to comment.

Accepted Answer

Shantanu Dwivedi
Shantanu Dwivedi on 30 Oct 2020
Edited: Shantanu Dwivedi on 30 Oct 2020
Assuming that the bright patches in your image are circular blobs, you can convert the image to black and white first and then find the centroid for each white patch using regionprops’ command.
Refer to the Estimate Center and Radii of Circular Objects and Plot Circles’ section of the following documentation page to get more help.

  3 Comments

LM Pant
LM Pant on 1 Nov 2020
Thanks for the reply.
However patches are not essentially circular but of more ellipitical in shape. it may be helpful.
regards
Image Analyst
Image Analyst on 1 Nov 2020
You keep forgetting to attach your image.
regionprops() does not require circular objects/regions/patches, so ignore the part where he said "Assuming that the bright patches in your image are circular blobs".
You have to segment your image into the bright patches. Try imbinarize(). Or see my Image Segmentation Tutorial in My File Exchange.
LM Pant
LM Pant on 25 Nov 2020
Thanks for the suggestion
I have gone thogh the tutorial , its very informative and very useful.
Actualy I have to compute the centroid values by weighting the pixels on the basis of intersity of each pixel on each of the patch i.e. for x cordinates and for y co ordinates , can you suggest the process.
Thanks and regards

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by