how to write matlab code for third level DWT ?

22 views (last 30 days)
hello..im writing a code for getting an image and perform dwt for one level to get 4 sub bands, ,but i want to apply third level DWT for getting image of 3rd level decomposion, so kindly help me and correct my code for 3rd level DWT. the code i have written is shown below.
%Read Input Image
Input_Image=imread(‘rose.bmp’);
%Red Component of Colour Image
Red_Input_Image=Input_Image(:,:,1);
%Green Component of Colour Image
Green_Input_Image=Input_Image(:,:,2);
%Blue Component of Colour Image
Blue_Input_Image=Input_Image(:,:,3);
%Apply Two Dimensional Discrete Wavelet Transform
[LLr,LHr,HLr,HHr]=dwt2(Red_Input_Image,’haar’);
[LLg,LHg,HLg,HHg]=dwt2(Green_Input_Image,’haar’);
[LLb,LHb,HLb,HHb]=dwt2(Blue_Input_Image,’haar’);
First_Level_Decomposition(:,:,1)=[LLr,LHr;HLr,HHr];
First_Level_Decomposition(:,:,2)=[LLg,LHg;HLg,HHg];
First_Level_Decomposition(:,:,3)=[LLb,LHb;HLb,HHb];
First_Level_Decomposition=uint8(First_Level_Decomposition);
%Display Image
subplot(1,2,1);imshow(Input_Image);title(‘Input Image’);
subplot(1,2,2);imshow(First_Level_Decomposition,[]);title(‘First Level Decomposition’);

Answers (1)

nadhir nouioua
nadhir nouioua on 2 Apr 2020
Hello sir,
Here is a way of decomposition into third level, I think u can do the rest now, good luck.
[LLr1,LHr1,HLr1,HHr1]=dwt2(Red_Input_Image,’haar’);
[LLr2,LHr2,HLr2,HHr2]=dwt2(LLr1,’haar’);
[LLr3,LHr3,HLr3,HHr3]=dwt2(LLr2,’haar’);

Categories

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

Products

Community Treasure Hunt

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

Start Hunting!