資源簡介
利用MCA技術(shù)可以對圖像進(jìn)行分解與修復(fù),其核心是對圖像分解成紋理圖像和平滑圖像,然后分別進(jìn)行修復(fù)。
代碼片段和文件信息
function?ML=perform_mca(?xoptions)
%ML=perform_mca(xoptions)執(zhí)行對輸入的圖像進(jìn)行分解
%Inputs:
????????%x為一個二維圖像矩陣
????????%components為一個單元數(shù)組,它的長度為所要分解的元素個數(shù)
????????%options為結(jié)構(gòu)體,它用來傳輸用戶所設(shè)定的迭代次數(shù),門限,收縮步長等參數(shù)
?%Outputs:
????????%ML用來存儲已經(jīng)分解開的形態(tài)元素
?%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%??????
options.null?=?0;
if?isfield(options?‘niter‘)
????niter?=?options.niter;
else
????niter?=?20;
end
if?isfield(options?‘Tmax‘)
????Tmax?=?options.Tmax;
else
????Tmax?=?max(abs(x(:)));
end
if?isfield(options?‘Tmin‘)
????Tmin?=?options.Tmin;
else
????Tmin?=?0;
end
if?isfield(options?‘lamda‘)
????lamda?=?options.lamda;
else
????lamda?=?1;
end
???
if?isfield(options?‘threshold‘)
????threshold?=?options.threshold;
else
??
評論
共有 條評論