0
$\begingroup$

I want to do one threshold method on high pass components of a wavelet frame decomposition approch,for edge detection in image. I have 14 high pass components.

for thresholding, I need keep the lowest 50% of the coefficients in absolute value of the high pass parts or in other words keep only the lowest 50% largest coefficients.I examine otsu and Hysteresis thresholding, but I can't find all edges. I also wrote one matlab code, that does for each high pass part:

% x1 and x2 are largest pixel value of each of high pass parts}
% there is negative and positive pixels in high pass parts 

function Xt=Threshold(X,x1,x2)

[m,n]=size(X);
Xt=zeros(m,n);
for k=1:m
    for l=1:n
        if(X(k,l)> min(min(X)) && X(k,l)< x1 && mod(X(k,l),2)~=0)
            Xt(k,l)=1;
        elseif(X(k,l)> x2  && X(k,l)< max(max(X)) && mod(X(k,l),2)==0)
            Xt(k,l)=1;
        end
    end
end 
$\endgroup$
1
$\begingroup$

I guess you had some misunderstandings.

First, strong edges correspond to wavelet coefficients with large magnitudes in high pass bands. Thus, instead of keeping small coefficients, you should keep large coefficients.

Secondly, in a high pass band, there should be a large number of coefficients with magnitude close to zero. This means edge pixels would almost impossible account for more than 50% of all pixels. Thus, the usage of 50% in your assumption is also doubtful.

Finally, the difficulty of edge detection often lies in differentiating weak edges from noise, but not the detection of strong edges.

I suggest to you to take look at the MATLAB source code of Canny Edge Detector, whose parameter adaption part ( when you do not provide the two canny thresholds to matlab ) might give you some thoughts on to automatically pick some good thresholds. Its idea is based on examining the edge histogram and determines threhsolds according to this distribution dynamically.

$\endgroup$
  • $\begingroup$ thanks. I know that Edges usually correspond to high frequency components and high pass parts (wavelet coefficients) are contained Edges, so thresholding is necessary. of course I should have said that after thresholding of high pass parts, I Reconstruct results from the zero low pass and the thresholded high pass components and use image classification into two categories: either 0 or 1. $\endgroup$ – reihaneh Nov 19 '14 at 18:45
  • $\begingroup$ now I have one large problem: I think the sentence "the lowest 50% largest coefficients" means to keep less than of 50% of largest coefficients,(e.g 45% of largest coefficients) but you say to keep small coefficients and these are different!? furthermore what are your idea about sentence "(when you do not provide the two canny thresholds to matlab)"? $\endgroup$ – reihaneh Nov 19 '14 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.