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