How to image de-noise whit (Wavelet) using dwt3 and idwt3
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello
I have implemented using dwt2 and idwt2
But I have not used dwt3 and idwt3 so far. Is it possible to help me with these commands to de-noiseize ??
Thank you
My code:
pic=imread('lena.jpg');
pic1=rgb2gray(pic);
pic11=im2double(pic1);
pic2 = imnoise(pic1,'gaussian',0.0001);
pic3=im2double(pic2);
%%%%%%Symlet%%%%%%%%%%%%
wavename='sym2';
[LoD,HiD]=wfilters(wavename,'d');
%First level
[cA,cH,cV,cD]=dwt2(pic3,LoD,HiD,'mode','per');
%Second level
[cAA,cAH,cAV,cAD]=dwt2(cA,LoD,HiD,'mode','per');
Level1=[Norm(cAA),Norm(cAH);Norm(cAV),Norm(cAD)];
pic4=([Level1,Norm(cH);Norm(cV),Norm(cD)]);
%%%%%%%%Inverse%%%%%%%%%%
Tr=0.3;
cAH1=cAH;cAH1(abs(cAH1)<Tr)=0;
cAV1=cAV;cAV1(abs(cAV1)<Tr)=0;
cAD1=cAD;cAD1(abs(cAD1)<Tr)=0;
cH1=cH;cH1(abs(cH1)<Tr)=0;
cV1=cV;cV1(abs(cV1)<Tr)=0;
cD1=cD;cD1(abs(cD1)<Tr)=0;
cAr=idwt2(cAA,cAH1,cAV1,cAD1,wavename,size(cA));
pic5=idwt2(cAr,cH1,cV1,cD1,wavename,size(pic3));
Level2=[Norm(cAA),Norm(cAH1);Norm(cAV1),Norm(cAD1)];
pic6=([Level2,Norm(cH1);Norm(cV1),Norm(cD1)]);
%%%%%%Soft Thresholding%%%%%%%
cAH2=abs(cAH1-Tr);
cAV2=abs(cAV1-Tr);
cAD2=abs(cAD1-Tr);
cH2=abs(cH1-Tr);
cV2=abs(cV1-Tr);
cD2=abs (cD1-Tr);
cAr2=idwt2(cAA,cAH2,cAV2,cAD2,wavename,size(cA));
pic7=idwt2(cAr2,cH1,cV1,cD1,wavename,size(pic3));
Level2=[Norm(cAA),Norm(cAH2);Norm(cAV2),Norm(cAD2)];
pic8=([Level2,Norm(cH2);Norm(cV2),Norm(cD2)]);
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!