Code covered by the BSD License  

Highlights from
Image Quality - Index Analysis GUI

image thumbnail

Image Quality - Index Analysis GUI

by

 

29 Apr 2013 (Updated )

This GUI measures the image quality/error between 2 or more images (original,test1/test2/.../testn).

ccc_fs(x,y,ws)
function [cc, cc_map] = ccc_fs(x,y,ws)

% Correlation Coefficient Calculator

% 07/03/2010 Version 1.0
% 25/06/2010 Version 1.2    - Excel Output option
% 04/08/2011 Version 1.2F   - Function Version
% 04/12/2012 Version 2.2F   - Sliding Window
% 27/01/2013 Version 3.2F   - Calculates index from valid area

% Author: Aristidis D. Vaiopoulos

if nargin < 2
    error('This function needs at least 2 arguments')
end
% Default window size
if nargin == 2
    ws = 8;
end

x = single(x);
y = single(y);

% Sum filter
sf = ones(ws);
% Mean filter
mf = sf / (ws^2);

mx = filter2(mf,x);
mx = x - mx;
my = filter2(mf,y);
my = y - my;
% Local CC
cc_map = filter2(sf,(mx.*my))./sqrt(filter2(sf,mx.^2).*filter2(sf,my.^2));
% Kill Nans
cc_map = nankill(cc_map,1);
% Kill Infs
cc_map = infkill(cc_map,1);
% Overall CC
s = round(ws/2);
cc = mean2( cc_map(s:end-s,s:end-s) );

end

Contact us