% show high pass and low pass filter pairs and their actions on images. % get image load mandrill [m,n] = size(X); map = gray(length(map)); % define low and high pass masks lo = [1 1]; lo = lo/sum(lo); hi = [1,-1]; hi = hi/sum(abs(hi)); Xll = circconv2(X,lo'*lo); Xhl = circconv2(X,hi'*lo); Xlh = circconv2(X,lo'*hi); Xhh = circconv2(X,hi'*hi); figure(1); imshow(X,map); title('original') figure(2); subplot(2,2,1) imshow(Xll,map); title('low-low - absolute intensity') subplot(2,2,2) imshow(abs(Xlh),map); title('low-high - absolute intensity') subplot(2,2,3) imshow(abs(Xhl),map); title('high-low - absolute intensity') subplot(2,2,4) imshow(abs(Xhh),map); title('high-high - absolute intensity') Ell = energy(Xll); Elh = energy(Xlh); Ehl = energy(Xhl); Ehh = energy(Xhh); E = energy(X); Elist = 100*[Ell/E,Elh/E,Ehl/E,Ehh/E] figure(3); subplot(2,2,1) imshow(Xll,[]); title('low-low - relative intensity') subplot(2,2,2) imshow(abs(Xlh),[]); title('low-high - relative intensity') subplot(2,2,3) imshow(abs(Xhl),[]); title('high-low - relative intensity') subplot(2,2,4) imshow(abs(Xhh),[]); title('high-high - relative intensity')