and I use the code, then I can find the spots.
———-
clear all;
Cimg=imread('CropTest1.jpg','jpg');
Gimg=rgb2gray(Cimg);
BW=Gimg>150;
rp=regionprops(BW,Gimg,'WeightedCentroid');
disp('Centroiding is done.');
figure(1); image(Cimg); axis image; hold on;
n=numel(rp);
for i=1:n
plot(rp(i).WeightedCentroid(1), rp(i).WeightedCentroid(2), 'r*')
end
———-
and I have coordinates of all spots.
then I want to do these
– express Center spot -> (0,0)
– find missing spots (-1,3),(5,1),(1,-5) and output the message: '(-1,3),(5,1),(1,-5) are missing!'
– delete one spot in double spots that use this idea: distance of two spots(well, I seem to be able to do this.)
thank you for your advice and help.
Best Answer