Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
help with overlapping spots
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hello everybody, I'm trying to solve the problem of overlapping gaussian spots,but i have problems with it.My table with spots takes values between 0-1 .I am writing the code below.The problem is that i take the minimum values and they are at about 46656 and they are zero values most of them and they don't belong to the spots but to the background that doesn't have importance for my algorithm.
function [lol,count,x1,y1,x2,y2,overlap,Z,L,B1]=avoid_overlap_6_4(z)
overlap=0;
%[x1,y1]=find(Z1~=0); %Z(x1,y1)=Z1(x1,y1); z=round(z*100000)/100000;
idx1=find(z~=(0)); Z(idx1)=z(idx1); B2= imregionalmax(Z,8); [x2,y2]=find(B2==1); BW=im2bw(Z); [L,NUM] = BWLABEL(BW,8); count=0; lol=1; B2= imregionalmax(Z,8); [x2,y2]=find(B2==1); for i=1:size(x2)-1 overlap(i)=0; end B1= imregionalmin(Z,8);
m=1; [x1,y1]=find(B1==1);
k=1;
t=1; m=1; for i=1:size(x2)-1 % if m<=NUM [r,c]=find(L==i); temp=Z(r,c); if ismember(Z(x2(i),y2(i)),temp) & ismember(Z(x2(i+1),y2(i+1)),temp)
for k=1:size(x1)-1
if Z(x1(k),y1(k))<Z(x1(k+1),y1(k+1))
lol=4000;
% if Z(x1(k),y1(k))<Z(x2(i+1),y2(i+1))
% if ismember(Z(x1(k),y1(k)),temp)
count=count+1;
Z(x1(k),y1(k))=0;
% k=k+1;
%Z(s1(max(thesi)).x0,s2(max(thesi)).y0)=0
% end
end
end
end
end
0 commentaires
Réponses (0)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!