den1_10.m
上传用户:lcj80317
上传日期:2007-01-26
资源大小:625k
文件大小:1k
- function X = den1_10(x, wname, n, thr, thr1)
- % 半软阈值改进
- % 使用阈值去噪的方法 再次对重构图像进行滤波
- % thr1 = 0.6 * thr;
- [C, S] = wavedec2(x, n, wname); %对图像进行小波分解
- dcoef = C( prod(S(1, :)) + 1 : end); %高频部分系数
- ind = find( abs(dcoef) < thr1) + prod(S(1, :)); %小于thr1的系数
- C(ind) = 0; % 直接置零
- ind = find( abs(dcoef) >= thr1 & abs(dcoef) < thr )...
- + prod(S(1, :)); %大于thr1小于thr的系数
- C(ind) = sign(C(ind)) .* ...
- ( (thr / (thr - thr1)) * (abs(C(ind)) - thr1) );
- % 重构至第1层
- A1 = wrcoef2('a', C, S, wname, 1);
- H1 = wrcoef2('h', C, S, wname, 1);
- V1 = wrcoef2('v', C, S, wname, 1);
- D1 = wrcoef2('d', C, S, wname, 1);
- thr_h = Donoho(H1);
- thr_v = Donoho(V1);
- thr_d = Donoho(D1);
- % 对重构图像进行去噪 采用Donoho公式 软阈值方法
- H1 = wdencmp('gbl', H1, 'sym4', 2, thr_h, 's', 1);
- V1 = wdencmp('gbl', V1, 'sym4', 2, thr_v, 's', 1);
- D1 = wdencmp('gbl', D1, 'sym4', 2, thr_d, 's', 1);
- % 重构图像
- X = A1 + H1 + V1 + D1;