NonLocal Euclidean Medians
by
Kunal Chaudhury
07 Feb 2013
(Updated
11 Feb 2013)
Nonlocal patchbased image denoising using NonLocal Euclidean Medians (NLEM).

findEuclideanMedian (f, w) 
function median = findEuclideanMedian (f, w)
%function for compting the weighted Euclidean median
% f is a matrix of size k^2 x n, where k^2 is the size
% of the patch, and n is the number of neighbors
%
% w is the weight vector of size n X 1
%
% median = arg min_f \sum_j w(j) ( f(:, j)  g(:)_2 )^p
%
% median is conputed using an IRLStype alogrithm (firstorder method)
% initialization
median = (f * w) / sum(w);
n = length(w);
eps = 1e6;
err = 1;
while err > 1e4
residuals = sum( (median * ones(1,n)  f).^2, 1);
gamma = 1./ (residuals + eps * ones(1,n)).^0.5;
ww = gamma' .* w;
f_hold = (f * ww) / sum(ww);
err = norm(f_hold  median);
disp(err);
median = f_hold;
end


Contact us