compute_total_variation.m

来自「image denoising toolbox in matlab」· M 代码 · 共 23 行

M
23
字号
function TV = compute_total_variation(y, options)% compute_total_variation - compute the total variation of an image%%   TV = compute_total_variation(y);%%   Copyright (c) 2007 Gabriel Peyrenbdims = 2;if size(y,1)==1 || size(y,2)==1    nbdims = 1;endif nbdims==1    TV = sum( abs(diff(y)) );    return;end% options.bound = 'per';options.null = 0;g = grad(y, options);TV = sqrt( sum(g.^2,3) );TV = sum(TV(:));

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?