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

div3d(x, y, ws, absval)
function [ds, dm, dmaps] = div3d(x, y, ws, absval)

% Focal DIV for 3D images/arrays (m*n*z)

% 27/01/2013     -  Version 1.0
% 21/02/2013     -  Version 2.0

% Author:           Aristidis D. Vaiopoulos

if nargin == 2
   ws = 8;
   absval = 1;
end
if nargin == 3
    absval = 1;
end
% Find dimensions
sizex = size(x);
sizey = size(y);
if ~isequal(sizex,sizey)
    error('Images must have equal dimensions.')
end
% Number of bands
nb = size(x,3);
% Preallocate mean ds
ds = zeros(nb,1);
if nargout == 3
    % Preallocate dmaps (memory voracious)
    dmaps = single(zeros(sizex));
    for b = 1:nb
        [ds(b), dmaps(:,:,b)] = div_fs( x(:,:,b),y(:,:,b),ws, absval );
    end
else
    for b = 1:nb
        ds(b) = div_fs( x(:,:,b),y(:,:,b),ws, absval );
    end
end
% Average quality 
dm = mean(ds);

end

Contact us