Image processing problem
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to decompose an image with wavedec2 and reconstruct it with waverec2 using the below simple codes.
The problem is that the resulting image imshow(y) is totally white, while imshow(x) shows a normal photo. Any help is much appreciated!
x = imread('flower.jpg');
x = rgb2gray(x);
[c,s] = wavedec2(x,2,'haar');
y = waverec2(c,s,'haar');
imshow(y);
0 Kommentare
Antworten (2)
UJJWAL
am 1 Mär. 2012
Before imshow(y); enter this statement
y = uint8(y);
Now you will get the correct result.
This is because x is of type uint8 while y is double. So you will not see them in the same way unless you change from double to uint8 which is accomplished by the above command
Image Analyst
am 2 Mär. 2012
If your numbers don't cover the range 0-255 fairly well, your image may not look good if you cast it to uint8. I suggest just using [] for display:
imshow(y, []);
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!