Decomposition of Image using dyadic wavelet transform
Mostra commenti meno recenti
Hii, Can some one help me in providing code for decomposition of image using dyadic wavelet transform into LL and HH subbands.
Risposte (1)
Prasanna
il 22 Ott 2024
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:
- dwt2: https://www.mathworks.com/help/wavelet/ref/dwt2.html
- LL,LH,HL,HH decomposition: https://www.mathworks.com/matlabcentral/answers/634054-what-are-ll-lh-hl-hh-in-dwt
- MATLAB code for third level DWT: https://www.mathworks.com/matlabcentral/answers/163844-how-to-write-matlab-code-for-third-level-dwt
Categorie
Scopri di più su Image Analysis in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!