# displayImages

## PURPOSE

displayImage - display a set of images of the same size (bx, by) on

## SYNOPSIS

function im = displayImages(images,ncol,bx,by,normalize, widthMargin, heightMargin)

## DESCRIPTION

     displayImage - display a set of images of the same size (bx, by) on
       a specified tabular.

     ncol: number of columns

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

- GenerateEgretFigure GenerateEgretFigure - Generate the egret-pelican figure: a single figure with all detection results for egrets and pelicans.
- GenerateHtml GenerteHtml - Generates html page for experimental results
- GenerateLatex GenerateLatex - Generate a simple latex file together with a folder of eps figures
- generateTransformedS2Templates generateTransformedS2Templates - Affine transforms of the S2
- generateTransformedTemplates generateTransformedTemplates - Affine transforms of the ellipsoid

## SOURCE CODE

    0001 function im = displayImages(images,ncol,bx,by,normalize, widthMargin, heightMargin)
    0002 % displayImage - display a set of images of the same size (bx, by) on
    0003 %   a specified tabular.
    0004 %
    0005 % ncol: number of columns
    0006
    0007 if nargin < 5
    0008     normalize = true;
    0009 end
    0010
    0011 if nargin < 6
    0012     widthMargin = 5;
    0013     heightMargin = 5;
    0014 end
    0015
    0016 n = length(images);
    0017 nrow = ceil(n/ncol);
    0018 width = by*ncol + (ncol-1)*widthMargin;
    0019 height = bx*nrow + (nrow-1)*heightMargin;
    0020 im = 255-zeros(height,width);
    0021 for i=1:n
    0022     row = ceil(i/ncol);
    0023     col = i-(row-1)*ncol;
    0024     startx = (row-1)*(bx+heightMargin);
    0025     starty = (col-1)*(by+widthMargin);
    0026     towrite = imresize(double(images{i}),[bx,by]);
    0027     if normalize
    0028         towrite = uint8(255 * (towrite-min(towrite(:)))/(max(towrite(:))-min(towrite(:))));
    0029     else
    0030         towrite = uint8(towrite);
    0031     end
    0032     im((startx+1):(startx+bx),(starty+1):(starty+by)) = towrite;
    0033 end
    0034 im = uint8(im);