denoising colored image using discrete wavelet transform

2 次查看(过去 30 天)
hi all, i want denoise colored image using discrete wavelet transform i use the following code
%Reading the image pic=imread('A1','jpeg'); figure, imagesc(pic);colormap(gray);
%Define the Noise Variance and adding Gaussian noise %While using 'imnoise' the pixel values(0 to 255) are converted to double in the range 0 to 1 %So variance also has to be suitably converted sig=100; V=(sig/256)^2;
npic=imnoise(pic,'gaussian',0,V); figure, imagesc(npic);colormap(gray);
%Define the type of wavelet(filterbank) used and the number of scales in the wavelet decomp filtertype='db4'; levels=5;
%Doing the wavelet decomposition [C,S]=wavedec2(npic,levels,filtertype);
%Define the threshold(universal threshold) M=size(pic,1)^2; UT=sig*sqrt(2*log(M));
%Hard thresholding %Doing the hard thresholding-threshold only detail coefficients!! hardC=[C(1:S(1,1)^2), hthresh(C(S(1,1)^2+1:length(C)),UT)];
%Reconstructing the image from the hard-thresholded wavelet coefficients newpich=waverec2(hardC,S,filtertype);
%Displaying the hard-denoised image figure, imagesc(newpich);colormap(gray);
%Soft thresholding softC=[C(1:S(1,1)^2), sthresh(C(S(1,1)^2+1:length(C)),UT)];
%Reconstructing the image from the soft-thresholded wavelet coefficients newpics=waverec2(softC,S,filtertype);
%Displaying the soft-denoised image figure, imagesc(newpics);colormap(gray);
the following error is displayed: ??? Error using ==> image Error using ==> image TrueColor CData contains element out of range 0.0 <= value <= 1.0
Error in ==> imagesc at 19 hh = image(varargin{1},'CDataMapping','scaled');
Error in ==> visuthresh at 50 figure, imagesc(newpich);colormap(gray);
>> thank in advance

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Continuous Wavelet Transforms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by