Trouble with LL in DWT2
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
After performing DWT
y=imread('lena.jpg');
x=rgb2gray(y);
[LL,LH,HL,HH]=dwt2(x,'haar');
figure(1),imshow(uint8(LL));
Image at LL is not same as output shown in matlab "wavelet tool box" after performing 1-level dwt
Not same Indicates: My output image looks brighter than matlab "wavelet tool box"
Pls help
0 comentarios
Respuestas (8)
Wayne King
el 29 de Feb. de 2012
Hi Jagdeesh, you're not giving us enough to go on. The classic Lena image is not included in the Wavelet Toolbox as far as I am aware.
dwt2.m is a file in the Wavelet Toolbox, so I'm not sure what you mean that the output is not the same as shown in the Wavelet Toolbox.
Also, an image appearing "brighter" can just be a matter of colormap (scaling) so I think you need to be much clearer in your explanation of how you are viewing this image in the Wavelet Toolbox.
Wayne King
el 1 de Mzo. de 2012
That looks like just a colormap (display) problem to me. But you do not provide the Lena file and you do not show your MATLAB commands. Please put your file somewhere and show your MATLAB commands.
0 comentarios
UJJWAL
el 1 de Mzo. de 2012
Hi,
The problem is with your understanding of the Wavelet Theory. The yy which you are showing is basically the approximation matrix of the Lena Image. It is not the same as the original image. When you reconstruct that is upsampling and all through MRA using the approximation matrix and all the detail matrix (corresponding to horizontal , vertical and diagonal directions) then only you would get the original image.
In Wavelet toolbox , the output image is the reconstructed image while in ur code you are displaying the approximation image only. Hence your output is a brighter version of the original image. There is no problem with the program or the toolbox or the colormap. The problem is basically a conceptual one.
Hope this helps Happy to help UJJWAL
0 comentarios
Wayne King
el 1 de Mzo. de 2012
Why are you converting back to uint8 and then using imshow:
y=imread('lena.jpg');
x=rgb2gray(y);
[LL,LH,HL,HH]=dwt2(x,'haar');
imagesc(LL); colormap gray;
2 comentarios
UJJWAL
el 1 de Mzo. de 2012
converting back to uint8 is important to bring the data to the same type as the input data. Imagesc is just scaling the data to the full range of the colormap.
Moreover , the output data ( in wavelet toolbox) will definitely be different from this because here he has not carried out the reconstruction but instead is displaying only the approximation matrix while the toolbox will give the reconstructed image
Wayne King
el 1 de Mzo. de 2012
The poster does not indicate that he is concerned about maintaining data type. He only indicates that he has trouble seeing agreement between his output and the output displayed in some document.
Also, the image the OP points to on p.34 of the document is an image of the level-1 scaling coefficients not a reconstruction. My impression was that he just thought the output of imshow() looks brighter than the display of the LL image in his document.
UJJWAL
el 2 de Mzo. de 2012
Hi, Jagdeesh,
Ok. Now I understand. Previously i was thinking that maybe you are referring to the idwt image of the toolbox. My bad.
Actually the reason which i now realise is that , you are trying to plot the matrix LL which is the approximation matrix. However it contains many values outside the range of the colormap (like there are many values exceeding 255). Due to this when you directly imshow, those are sealed off to 255 and hence you see a considerably brighter image.
To solve this problem you will have to scale the data values so as to bring the values into the colormap of grayscale(that is 0 to 255). for that use imagesc function. The image will now be displayed properly
0 comentarios
Ver también
Categorías
Más información sobre Discrete Multiresolution Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!