remove overlapping spots
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mary Kodogianni
am 25 Mär. 2011
Kommentiert: Tusharkumar Sorathiya
am 5 Dez. 2018
Hello to everyone, I generate figures with gaussian spots and i take some overlapping areas that i want to remove. I've written this code to find overlap,but i don't know how to remove the particular spot i want to delete.Plz help me I've stuck with it. Here is my code: function [x1,y1,x2,y2,overlap,Z]=avoid_overlap_n(Z,s_x,s_y)
B1= imregionalmin(Z,8); B2= imregionalmax(Z,4);
[x1,y1]=find(B1==1); [x2,y2]=find(B2==1); k=1; for i=1:size(x1)-1 overlap(i)=0; end for i=1:size(x2)-1 % for k=1:size(x1-1)
if(Z(x1(k),y1(k))<Z(x2(i+1),y2(i+1)))
if overlap(k)<2
overlap(k)=overlap(k)+1;
else
Z(x2(i+1)+round(s_x),y2(i+1)+round(s_y))=0
end
k=k+1;
end
%end
end
0 Kommentare
Akzeptierte Antwort
Sean de Wolski
am 25 Mär. 2011
Z(region1®ion2) = 0;
Post your image so we can see it and you'll get better results.
0 Kommentare
Weitere Antworten (2)
Mary Kodogianni
am 26 Mär. 2011
1 Kommentar
Sean de Wolski
am 29 Mär. 2011
click on markup help for more detailed instructions. to post an image use << URL >>
Mary Kodogianni
am 29 Mär. 2011
1 Kommentar
Tusharkumar Sorathiya
am 5 Dez. 2018
I am not sure what you want to delete, but to find area you can use trapz function which calculates the area of a curve.
Siehe auch
Kategorien
Mehr zu Numerical Integration and Differentiation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!