run_amer.m

来自「amer s noise level estimation implementa」· M 代码 · 共 42 行

M
42
字号
%===========================================================================
%  Amer Noise Level Estimation (by europium 2008)
%===========================================================================

clear all;
close all;
clc;

img_id =  30;
w_size = 5;
th = 25;

% Estimation = 1 : Averaging local standard deviations
% Estimation = 2 : Adaptive averaging local standard deviations(mean of 'local std - ref_std')
% Estimation = 3 : Histogram Approximation (68% -> sigma)

% Adaptive = 0 : No Adaptive
% Adaptive = 1 : Bosco(est_std) -> Gaussian Filtering (sigma = est_std, Homo = loc_std < th)
% Adaptive = 2 : Bosco(est_std) -> Gaussian Filteing (sigma = est_std, Homo = abs(est_std - loc_std) < th)

Estimation = 1;      %default = 1
Adaptive = 0;         %default = 0
showimg = 0;

tic
for i=1:15
   std = i;
   [est_std(i), blknum(i), homoblk(i)] = amer(img_id, std, w_size, th, Estimation, Adaptive, showimg);
   est_std
end
toc

figure;
plot(1:15, est_std,'b-o');hold on;
plot(1:15,1:15, 'r');hold off;grid
xlabel('Given standard deviation');
ylabel('Estimated standard deviation');

% for i=1:15
%     text(i-0.5,est_std(i)+1, [num2str(homoblk(i))]);
% end
title(['image id='  ,num2str(img_id),', window size='  ,num2str(w_size),  ', threshold =',  num2str(th), ' ,blk number =', num2str(blknum(1))]);

⌨️ 快捷键说明

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