calculate multi-level DWT of an image

9 views (last 30 days)
Bareq Raad
Bareq Raad on 19 Jan 2021
Commented: KALYAN ACHARJYA on 19 Jan 2021
am Traying to caclulate the 4th level of discrete wavelet transform (dwt2) of an image to get the LL band of this level I tried the old fation way beacsue am a new to matlab the prblem that the numbers should be between 0-255 but instead its keep growing as the image below what is the prblem and is there a faster way to do this?
I2 = imresize(image,[256 256])
[cA1,~,~,~] = dwt2(I2,'haar')
[cA2,~,~,~] = dwt2(cA1,'haar')
[cA3,~,~,~] = dwt2(cA2,'haar')
[cA4,~,~,~] = dwt2(cA3,'haar')

Answers (1)

KALYAN ACHARJYA
KALYAN ACHARJYA on 19 Jan 2021
"the numbers should be between 0-255"
No, pixel values ​​depend on the data types, the original image probably uint8 data type, and the decomposition results (LL,LH, HL, and HH) are probably double. The value is changing due to the kernels used in the DTW case. Suppose for the case of LL, the image goes through LPF and downsampling 2 times, both steps affecting the values ​​on the image data. Red the following link for more detail about uint8 and double precision data type
Hope this clarifies your doubt.
  2 Comments
Bareq Raad
Bareq Raad on 19 Jan 2021
I resacaled the values by using
cA4 = double(255 * mat2gray(cA4));
its converted back to 0-255 values

Sign in to comment.

Categories

Find more on Discrete Multiresolution Analysis in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!