how to write matlab code for third level DWT ?
11 次查看(过去 30 天)
显示 更早的评论
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’);
回答(1 个)
nadhir nouioua
2020-4-2
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’);
2 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!