inpaint_iterate_ms.m
来自「采用总变分法(TV)进行图像修复的matlab源代码。包括热扩散修复和多尺度方法」· M 代码 · 共 31 行
M
31 行
function [I,Ihist] = inpaint_iterate_ms(I,M,fn,args,tolfn,tolargs)
% function [I,Ihist] = inpaint_iterate_ms(I,M,fn,args,tolfn,tolargs)
%
% recursively calls inpaint_iterate at multiple scales
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% input / output processing
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if nargin < 6, tolargs = []; end
Isc = min(size(I));
sc = 2 / Isc;
ndx = find(M);
while sc < 1
Itmp = imresize(I,sc);
Mtmp = logical(imresize(M,sc));
Itmp = inpaint_iterate(Itmp,Mtmp,fn,args,tolfn,tolargs);
Itmp = imresize(Itmp,size(I));
I(ndx) = Itmp(ndx);
sc = sc * 2;
end
I = inpaint_iterate(I,M,fn,args,tolfn,tolargs);
return
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?