Image type? dwt2 problem? I don't know! the size is incorrect!
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I perform a dwt2 on bmp image with in 5 levels and with filter bior4.4 but always doesn't have the same image size? since the original image size 512*512 =262144 but I get more than this number for the image ...the image is greyscale (black& white) why this happening.... the steps:
X=imread('baboon.bmp'); [C,S] = wavedec2(X,5,'bior4.4'); len=length(C);
and thank you in advance...
0 comentarios
Respuesta aceptada
Wayne King
el 5 de Oct. de 2011
Hi Nizar, You are likely using the default extension mode for the DWT. Use the periodization mode.
dwtmode('per');
[C,S] = wavedec2(X,5,'bior4.4');
len=length(C);
Hope that helps,
Wayne
2 comentarios
Más respuestas (2)
Wayne King
el 5 de Oct. de 2011
Hi, You want to use 'bior4.4' in the reconstruction. The Toolbox knows that the biorthogonal filter has two analysis filters and two synthesis filters. 'rbio4.4' are not the synthesis filters for 'bior4.4'.
X = randn(512,512);
[C,S] = wavedec2(X,2,'bior4.4');
X1 = waverec2(C,S,'bior4.4');
% prefect reconstruction
norm(X1-X,2)
If you try to substitute 'rbio4.4', you'll see that you do not get perfect reconstruction. That is a different biorthogonal quadruplet.
I not sure why you set the dwtmode() back to zero pad at the end.
If you are trying to set it back to the toolbox default, that is:
dwtmode('sym');
Walter Roberson
el 5 de Oct. de 2011
Do you get exactly 3 times what you expect? If so then although your image might appear to be greyscale (single channel), it was stored with 3 equal R, G, and B channels.
You should check size(X) after you read.
You should also try
[X,map] = imread('baboon.bmp');
and check to see isempty(map) . If map is not empty then the image matrix is 2D but stored in pseudocolor.
2 comentarios
Ver también
Categorías
Más información sobre Wavelet Toolbox 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!