필터 지우기
필터 지우기

what is code for non-maxima suppression of a grey image

조회 수: 12 (최근 30일)
Rahul
Rahul 2013년 3월 24일
편집: Swank Williams 2023년 7월 1일
Edge detection using wavelet transform need local maxima to find new approximation coefficient from detail coefficient.

답변 (3개)

Sajid Khan
Sajid Khan 2013년 10월 10일
Hi, attached is the source code for non maximal suppression. I also have submitted the code in file exchange but it will take some time for approval. I got help from canny edge detection code given in image processing toolbox
  댓글 수: 2
S. Sal
S. Sal 2016년 11월 24일
편집: S. Sal 2016년 11월 24일
Hello Sajid Khan, I am getting this error while using nonMaximalSupp.m you shared, The error is as follows: ___________________________________________________________
Undefined function 'cannyFindLocalMaxima' for input arguments of type 'double'.
Error in nonMaximalSupp (line 19) idxLocalMax = cannyFindLocalMaxima(dir,dx,dy,magGrad); _________________________________________________
Can you refine it please ? Thanks
Swank Williams
Swank Williams 2023년 7월 1일
편집: Swank Williams 2023년 7월 1일
Hi @S. Sal, for the function cannyFindLocalMaxima, you may have a try on the following codes. And you can find more details in the link https://www.cnblogs.com/mender/p/3501929.html
function idxLocalMax = cannyFindLocalMaxima(direction,ix,iy,mag)
[m,n] = size(mag);
switch direction
case 1
idx = find((iy<=0 & ix>-iy) | (iy>=0 & ix<-iy));
case 2
idx = find((ix>0 & -iy>=ix) | (ix<0 & -iy<=ix));
case 3
idx = find((ix<=0 & ix>iy) | (ix>=0 & ix<iy));
case 4
idx = find((iy<0 & ix<=iy) | (iy>0 & ix>=iy));
end
if ~isempty(idx)
v = mod(idx,m);
extIdx = (v==1 | v==0 | idx<=m | (idx>(n-1)*m));
idx(extIdx) = [];
end
ixv = ix(idx);
iyv = iy(idx);
gradmag = mag(idx);
switch direction
case 1
d = abs(iyv./ixv);
gradmag1 = mag(idx+m).*(1-d) + mag(idx+m-1).*d;
gradmag2 = mag(idx-m).*(1-d) + mag(idx-m+1).*d;
case 2
d = abs(ixv./iyv);
gradmag1 = mag(idx-1).*(1-d) + mag(idx+m-1).*d;
gradmag2 = mag(idx+1).*(1-d) + mag(idx-m+1).*d;
case 3
d = abs(ixv./iyv);
gradmag1 = mag(idx-1).*(1-d) + mag(idx-m-1).*d;
gradmag2 = mag(idx+1).*(1-d) + mag(idx+m+1).*d;
case 4
d = abs(iyv./ixv);
gradmag1 = mag(idx-m).*(1-d) + mag(idx-m-1).*d;
gradmag2 = mag(idx+m).*(1-d) + mag(idx+m+1).*d;
end
idxLocalMax = idx(gradmag>=gradmag1 & gradmag>=gradmag2);

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


Image Analyst
Image Analyst 2013년 3월 24일
Sounds like you have a paper in mind. Did you ask the authors if they have code to share with you, or search the File Exchange? I don't have the wavelet toolbox so I can't help you.

Image Analyst
Image Analyst 2016년 11월 24일
Try the function imhmax() built in to the Image Processing Toolbox.

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by