remove overlapping spots

조회 수: 5 (최근 30일)
Mary Kodogianni
Mary Kodogianni 2011년 3월 25일
댓글: Tusharkumar Sorathiya 2018년 12월 5일
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

채택된 답변

Sean de Wolski
Sean de Wolski 2011년 3월 25일
Z(region1&region2) = 0;
Post your image so we can see it and you'll get better results.

추가 답변 (2개)

Mary Kodogianni
Mary Kodogianni 2011년 3월 26일
How can i upload my figure below my question?I can't find a way to do this!How can i find the area of a random gaussian?If i have the center of the gaussian and zero the area around it,it would be a solution?
My algorithm that finds the overlap says that if between 2 maxima exists a minimum and if intensity is increasing exists an overlap,so i want to delete the one of the overlapping areas.
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2011년 3월 29일
click on markup help for more detailed instructions. to post an image use << URL >>

댓글을 달려면 로그인하십시오.


Mary Kodogianni
Mary Kodogianni 2011년 3월 29일
Hello everybody, could anybody plz told me how can i calculate the area of a random 2d gaussian?I want to delete spots that have been generated by gaussian function and i don't know the way. Thank's in advantage!
  댓글 수: 1
Tusharkumar Sorathiya
Tusharkumar Sorathiya 2018년 12월 5일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by