Decomposition of Image using dyadic wavelet transform

15 次查看(过去 30 天)
Hii, Can some one help me in providing code for decomposition of image using dyadic wavelet transform into LL and HH subbands.

回答(1 个)

Prasanna
Prasanna 2024-10-22
Hi Nishtha,
Decomposition of image into LL and HH subbands can be done using the ‘dwt2’ function present in MATLAB. To perform the decomposition you can perform the following steps:
  • Load the image.
  • Convert the image to grayscale.
  • Perform wavelet decomposition.
  • Extract the LL and HH sub bands from the decomposition.
Below is a MATLAB example on how to perform a 2D wavelet decomposition using the ‘dwt2’ function. 
% load the image and convert it to grayscale
image = imread('cameraman.tif');
grayImage = im2gray(image)
% perform wavelet decomposition using the dwt2 function
[LL1,LH1,HL1,HH1]=dwt2(grayImage,'db1');
[LL2,LH2,HL2,HH2]=dwt2(LL1,'db1');
[LL3,LH3,HL3,HH3]=dwt2(LL2,'db1');
% Display the original image and the subbands
figure;
subplot(1, 3, 1);
imshow(image);
title('Original Image');
subplot(1, 3, 2);
imshow(LL1, []);
title('LL Subband');
subplot(1, 3, 3);
imshow(HH1, []);
title('HH Subband');
The above code gives the following output:
For more information regarding the functions used and some other examples, you can refer to the following resources:

类别

Help CenterFile Exchange 中查找有关 Signal Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by