MATLAB Examples

Contents

How to use imagecat?

% Generate some images.
im1=imread('cameraman.tif');
imthresh=im1>graythresh(im1)*255;
imedge=edge(im1);

Compare two or more images.

figure(1); clf; colormap gray;
set(1,'Position',[10 10 800 600],'Color','white');
imagecat(im1,imthresh);

Optionally set the axes to be equal.

imagecat(im1,imthresh,'equal');

Set the axes to be cartesian.

imagecat(im1,imthresh,'equal','xy');

Link the axes and zoom into the same region.

imagecat(im1,imthresh,imedge,'equal','link');
xlim([50 150]); ylim([60 160]);

Set the scale for pixels and zoom in.

scale=6/256; % Assuming real height of the scene to be 6 feet.
xaxis=scale*[0 size(im1,2)-1];
yaxis=scale*[0 size(im1,1)-1];
imagecat(xaxis,yaxis,im1,imedge,'equal','link');
xlim([1 4]); ylim([2 6]);