WindowedPatchDistance.m in standardmodelrelease
function D = WindowedPatchDistance(Im,Patch)
%function D = WindowedPatchDistance(Im,Patch)
%computes the euclidean distance between Patch and all crops of Im of
% sum_over_p(W(p)-I(p))^2 is factored as
% sum_over_p(W(p)^2) + sum_over_p(I(p)^2) - 2*(W(p)*I(p));
% Im and Patch must have the same number of channels
dIm = size(Im,3);
dPatch = size(Im,3);
if(dIm ~= dPatch)
... to be continued.
This is a preview. To get the complete source file,
please click here to download the whole source code package.