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).

bias_fs(x,y,ws,absval)
function [bias, bmap] = bias_fs(x,y,ws,absval)

% Bias calculator

% Formula: 1 - mean(fused image)/mean(original image)
% (Ideal value = 0)

% 07/03/2010 Version 1.0
% 25/06/2010 Version 1.2    - Excel Output option
% 04/08/2011 Version 1.2F   - Function Version
% 25/10/2012 Version 2.2F   - Sliding window
% 27/01/2013 Version 3.2F   - Calculates index from valid area
% 21/02/2013 Version 4.2F   - Absolute value option

% Author: Aristidis D. Vaiopoulos

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

% Average filter
af = 1/(ws^2) * ones(ws);
% Filter images
mx = filter2(af,x);
my = filter2(af,y);
% Bias map
bmap = 1 - my./mx;
% Kill Nans
bmap = nankill(bmap,0);
% Kill Infs
bmap = infkill(bmap,0);
% Bias value
if absval == 1
    bmap = abs(bmap);
end
s = round(ws/2);
bias = mean2( bmap(s:end-s,s:end-s) );

end

Contact us