function [img_estimated,energyi,ISNRi,energyo,ISNRo]=tvmm_debluring(img_noisy,h,lambda,varargin)
% function [img_estimated]=tvmm_debluring(img_noisy,h,lamdba,...
% 'optional_parameter_name1',value1,'optional_parameter_name2', value2,...);
%
% Total Variation-based image deconvolution with
% a majorization-minimization approach.
%
% Written by: Joao Oliveira, Jose Bioucas-Dias, Mario Figueiredo
% email: joao.oliveira@lx.it.pt
% SITE: www.lx.it.pt/~jpaos/tvmm
% Date: 21/11/2005
%
%
% ========================== INPUT PARAMETERS (required) =================
% Parameter Values
% name and description
% ========================================================================
% img_noisy (double) Noisy blured image of size ny.
% h (double) Blur kernel.
% lambda Regularization parameter (which is multiplied by the
% TV penalty).
%
% ======================== OPTIONAL INPUT PARAMETERS ====================
% Parameter Values
% name and description
% =======================================================================
% boa_iter (double) The number of outer loop iterations.
% Default: 20
% cg_iter (double) The max number of inner CG iterations.
% Default: 200
% soim_iter (double) The max number of inner SOIM iterations.
% Default: 20
% soim_cg_iter (double) The max number of CG iterations in inner SOIM.
% Default: 6
% cg_thrld (double) Conjugate Gradient threshold.
% Default: 1e-5;
% image (double) Original image.
% displayIm ({'yes','no'}) if 'yes' is passed the restored imaged
% is displayed along the CG iterations
% Default: 'no'
% info_energyi ({'yes','no'}) if 'yes' is passed the isnr and energy of
% the objective function is displayed inside the inner loop.
% Default: 'no'
% info_energyo ({'yes','no'}) if 'yes' is passed the energy of
% the objective function is displayed at each outter loop.
% Default: 'no'
% info_ISNRi ({'yes','no'}) if 'yes' is passed the isnr is displayed.
% Default: 'no'
% Requires: image
% info_ISNRo ({'yes','no'}) if 'yes' is passed the isnr is displayed.
% Default: 'no'
% Requires: image
% x_0 (double) initial image iteration.
% Default: Wiener filter
% method ({'cg','soim'}) Selects the method used to solve the linear
% system: cg=conjugate gradient; soim=second order iterative
% method.
% Default: 'cg'
% l_min (double) Minimum eigenvalue of the system for the second
% order iterative method.
% Default: 1e-5
% l_max (double) Maximum eigenvalue of the system for the second
% order iterative method.
% Default: 1
%
% ===================================================================
% The following functions can be provided in order to overwrite the
% internal ones. Recall that, by default, all calculations are
% performed with circular convolutions. (see Technical Report)
% ===================================================================
%
% mult_H (function_handle) Function handle to the function that
% performes H*x. This function must accept two parameters:
% x : image to apply the convolution kernel h
% h : Blur kernel
% mult_Ht (function_handle) Function handle to the function that
% performes Ht*x (Ht = H transpose). This function must
% accept two parameters:
% x : image to apply the convolution kernel h
% h : Blur kernel
% diffh (function_handle) Function handle to the function that
% computes the horizontal differences of an image x.
% diffv (function_handle) Function handle to the function that
% computes the vertical differences of an image x.
% diffht (function_handle) Function handle to the function that
% computes the horizontal differences (transposed) of an
% image x.
% diffh (function_handle) Function handle to the function that
% computes the vertical differences (transposed) of an
% image x.
%
%
% ====================== Output parameters ===============================
% img_estimated Estimated image
% energyi Energy of inner loop iterations.
% Required input arguments: 'info_energyi' and 'image'.
% ISNRi Improvement Signal-to-noise ratio of inner loop iterations.
% Required input arguments: 'info_ISNRi' and 'image'.
% energyo Energy of outer loop iterations.
% Required input arguments: 'info_energyo' and 'image'.
% ISNRo Improvement Signal-to-noise ratio of outer loop iterations.
% Required input arguments: 'info_ISNRo' and 'image'.
%
% ============= EXAMPLES =========================================
% Normal use:
% [img_estimated]=tvmm_debluring(img_noisy,lambda,sigma)
%
% Display restored images along CG iterations:
% [img_estimated]=tvmm_debluring(img_noisy,lambda,sigma,...
% 'displayIm','yes')
%
% Perform ISNR calculations of the outer loop iterations:
% [img_estimated,energyi,ISNRi,energyo,ISNRo]=tvmm_debluring(img_noisy,...
% lambda,sigma,'info_SNRo','yes','image',image);
%
% ======================= DEFAULT PARAMETERS ===================
global mH mHt diffh diffv diffht diffvt
boa_iter = 20; % Number of outer loop iterations
cg_iter = 200; % Number of inner CG iterations
soim_iter = 20; % Number of inner SOIM iterations
soim_cg_iter = 6; % Number of CG iterations inside SOIM
cg_thrld = 1e-5; % CG threshold
displayIm = 0;
image=[];
info_energyi='no';
info_energyo='no';
info_ISNRi='no';
info_ISNRo='no';
info_int = 0;
info_ext = 0;
energyi=0;
ISNRi=0;
energyo=0;
ISNRo=0;
mH=@conv2c;
mHt=@conv2c;
diffh=@f_diffh;
diffv=@f_diffv;
diffht=@f_diffht;
diffvt=@f_diffvt;
method='cg';
x_0=[];
l_min=1e-5;
l_max=1;
% ====================== INPUT PARAMETERS ========================
% Test for number of required parametres
if (nargin-length(varargin)) ~= 3
error('Wrong number of required parameters');
end
% Read the optional parameters
if (rem(length(varargin),2)==1)
error('Optional parameters should always go by pairs');
else
for i=1:2:(length(varargin)-1)
% change the value of parameter
switch varargin{i}
case 'boa_iter' % Outer loop iterations
boa_iter = varargin{i+1};
case 'cg_iter' % Inner loop iterations
cg_iter = varargin{i+1};
case 'soim_iter' % Inner loop iterations
soim_iter = varargin{i+1};
case 'soim_cg_iter' % CG iterations in Inner loop
soim_cg_iter = varargin{i+1};
case 'displayIm' % display sucessive xe estimates
if (isequal(varargin{i+1},'yes'))
displayIm=1;
end
case 'cg_thrld' % CG threshold
cg_thrld = varargin{i+1};
case 'image' % Original image
image = varargin{i+1};
case 'info_ISNRi' % display ISNR inside inner loop
info_ISNRi = varargin{i+1};
case 'info_ISNRo' % display ISNR on outer loop
没有合适的资源?快使用搜索试试~ 我知道了~
【图像去噪】全变分算法图像去噪(含SNR)【含Matlab源码 626期】.zip
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共7个文件
m:3个
jpg:2个
gif:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 54 浏览量
2024-06-20
16:47:19
上传
评论
收藏 167KB ZIP 举报
温馨提示
Matlab领域上传的代码均可运行,亲测可用,直接替换数据即可,适合小白; 1、代码压缩包内容 主函数:main.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开main.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、仿真咨询 如需其他服务,可私信博主或扫描博客文章底部QQ名片; 4.1 博客或资源的完整代码提供 4.2 期刊或参考文献复现 4.3 Matlab程序定制 4.4 科研合作 图像去噪:小波阙值、BM3D、BdCNN、DCT、均值、中值、平滑滤波、维纳、PM模型、双边滤波、全变分算法、正则化、即插即用法
资源推荐
资源详情
资源评论
![mp4](https://img-home.csdnimg.cn/images/20210720083504.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![mp4](https://img-home.csdnimg.cn/images/20210720083504.png)
![mp4](https://img-home.csdnimg.cn/images/20210720083504.png)
![mp4](https://img-home.csdnimg.cn/images/20210720083504.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![mp4](https://img-home.csdnimg.cn/images/20210720083504.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![mp4](https://img-home.csdnimg.cn/images/20210720083504.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 7 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/f6819b692a8841f6a058b284bba25c7f_weixin_63266434.jpg!1)
![avatar-vip](https://csdnimg.cn/release/downloadcmsfe/public/img/user-vip.1c89f3c5.png)
Matlab领域
- 粉丝: 2w+
- 资源: 2478
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)