Hi I am trying to get the x,y coordinates of dot points (in binary image) as shown in below pic (dotfig.png) using the code:
A=imread('dotfig.png'); B=im2bw(A) [b,a]=find(B==0);
So, I get coordinates in terms of a,b for rows and cols. I got multiple a and multiple b (for 7 dots in pic). Actually, I just would like to get seven a and seven b, which represent seven dots in the pic. I understand that each dot has many pixel points, therefore, I got multiple a and b for each dot. However, is there anyway I can do that will give me only seven pairs of (a and b) that represents centriod of seven dots. I know
[x,y]=ginput()
might work, but i would like to avoid manual input as my code is part of very long codes.
Best Answer