Hello Mat

 找回密码
 立即注册
查看: 4958|回复: 0

基于haar小波变换的图像去噪

[复制链接]

1303

主题

1529

帖子

114

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22673
发表于 2017-2-5 11:10:00 | 显示全部楼层 |阅读模式
    读入图片和利用haar算子对图像进行小波降噪的结果,编程如下:
  1. function [XDEN,cfsDEN,dimCFS] = func_denoise_dw2d(X)
  2. %   X: 图像矩阵数据
  3. %   XDEN: 图像去噪矩阵数据
  4. %   cfsDEN: 分解向量
  5. %   dimCFS: 对应的数据缓存矩阵
  6. wname = 'haar';   % 小波名称
  7. level = 2;         % 2级小波
  8. % 去噪参数设置
  9. sorh = 's';    % Specified soft or hard thresholding
  10. thrSettings =  [...
  11.     4.405464908006699      4.078667960675236 ; ...
  12.     4.405464908006699      4.078667960675236 ; ...
  13.     4.405464908006699      4.078667960675236   ...
  14.     ];
  15. roundFLAG = true;
  16. % 使用WDENCMP函数降噪
  17. [coefs,sizes] = wavedec2(X,level,wname);
  18. [XDEN,cfsDEN,dimCFS] = wdencmp('lvd',coefs,sizes, ...
  19.     wname,level,thrSettings,sorh);
  20. if roundFLAG , XDEN = round(XDEN); end           % 取整
  21. if isequal(class(X),'uint8') , XDEN = uint8(XDEN); end  % 数据类型转换
复制代码



算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-5-27 06:27 , Processed in 0.225515 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表