Sign in

username or email:

password:



Not a member?
Forgot your password?

Search code



Search tips

Ads

See Also

Embedded SystemsFPGA

DSP Code Sharing > Image Denoising - Bayesshrink

Image Denoising - Bayesshrink

Language: Matlab

Processor: Not Relevant

Submitted by Senthilkumar R on Jul 30 2011

Licensed under a Creative Commons Attribution 3.0 Unported License

Image Denoising - Bayesshrink


 

This function used to denoise the noisy image using Bayesoft method

 
%Using BAYESSHRINK
%subband dependent threshold
%Soft  threshold
function [soft_X1,SOFT_PSNR] = Bayes_soft(X,Y)
%One -level decomposition
[CA,CH,CV,CD] = dwt2(Y,'haar');
%Call the function to calculate the threshold
CH =CH/1.2;
CV = CV/1.2;
CD = CD/1.2;
T1_CH = bayeshrink(CD,CH);
T1_CV = bayeshrink(CD,CV);
T1_CD = bayeshrink(CD,CD);
% Call the function to perfom soft shrinkage
de_CH = soft1(CH,T1_CH);
de_CV = soft1(CV,T1_CV);
de_CD = soft1(CD,T1_CD);
%Two -level decomposition
[CA1,CH1,CV1,CD1] = dwt2(CA,'haar');
CH1 = CH1/1.2;
CV1 = CV1/1.2;
CD1 = CD1/1.2;
%Call the function to calculate the threshold
T1_CH1 = bayeshrink(CD1,CH1);
T1_CV1 = bayeshrink(CD1,CV1);
T1_CD1 = bayeshrink(CD1,CD1);

% Call the function to perfom soft shrinkage
de_CH1 = soft1(CH1,T1_CH1);
de_CV1 = soft1(CV1,T1_CV1);
de_CD1 = soft1(CD1,T1_CD1);
%Reconstruction for soft shrinkage
X2 = idwt2(CA1,de_CH1,de_CV1,de_CD1,'haar');
X1 = idwt2(X2,de_CH,de_CV,de_CD,'haar');
SOFT_PSNR = PSNR(X,X1);
soft_X1 = uint8(X1);
 
Rate this code snippet:
4
Rating: 4 | Votes: 1
 
   
 
posted by Senthilkumar R



Comments


 

beyond13031 wrote:

8/16/2011
 
very good
 

sudhamohan wrote:

11/1/2011
 
sir in this coding i have error as

Undefined function or method 'bayeshrink' for input arguments of type 'double'.

Error in ==> Bayes_soft at 12
T1_CH = bayeshrink(CD,CH);



Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )