I want to display second level dwt. If I display seperatly to frequency components, it works fine. But when I try to merge and display, It appears just black color. Here is my code:

cd 'C:\Users\LENOVO\OneDrive\Masaüstü' %% Uploading picture to Matlab

X=imread('Coleen.jpg','jpg');%Reading picture by Matlab

[LoD,HiD] = wfilters('haar','d');

[cA,cH,cV,cD] = dwt2(X,LoD,HiD,'mode','symh');

[cA2,cH2,cV2,cD2]=dwt2(cA,LoD,HiD,'mode','symh');

subplot(2,2,1)

imagesc(cA)

colormap gray

title('Approximation')

subplot(2,2,2)

imagesc(cH)

colormap gray

title('Horizontal')

subplot(2,2,3)

imagesc(cV)

colormap gray

title('Vertical')

subplot(2,2,4)

imagesc(cD)

colormap gray

title('Diagonal')

figure

Level2=[cA2,cH2; cV2,cD2];

colormap gray

imshow([Level2,cH; cV,cD],[]);

Below is the output of this code.

But I want to display it like this:

More Ömer Faruk Günaydın's questions See All
Similar questions and discussions