Asked by Nuwan Dassanayake
on 16 Sep 2013

Dear All,

Do you know how to find the center coordinate of a blob. That means after detected blobs i need to assign variables to that blob locations.

Answer by Image Analyst
on 16 Sep 2013

Accepted answer

You need to ask regionprops for the Centroid or Weighted Centroid. See my Image Segmentation Tutorial for an example: Image Analyst's File Exchange It does exactly that.

Answer by Nuwan Dassanayake
on 16 Sep 2013

Dear Image Analyst Thank You very much for help!

Show 2 older comments

Nuwan Dassanayake
on 20 Sep 2013

Image analyst, I have tried to do something like this but it is not working! What is wrong with my program?

Thank you very much for your help! xy = stats(16).Centroid;

x = xy(:,1);

y = xy(:,2);

if(45<xy(:,1)<40) && (50<xy(:,2)<55)

disp(x)

end

I cant get expected value ,it displays values outside the range also!

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 0 Comments