DSPRelated.com
Code
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →

Image denoise: Threshold for sureshrink method

Senthilkumar ● July 30, 2011●1 comment ● Coded in Matlab

This function used to calculate threshold for sureshrink image denoising method

function thr = sureshrink(CD,T)
%function used to calculate threshold using sureshrink method
CD = CD(:)';
n = length(CD);
sx2 = sort(abs(CD)-T).^2;  % sorting in descending order
b  = cumsum(sx2);           %cumulative sum
risks = (n-(2*(1:n))+b)/n;
[risk,best] = min(risks);
thr = sqrt(sx2(best));