% HistSearch.m
% Tom McGrath
% CIS 601, Fall 2004
%

% This program compares histograms between some images.
%

% acquire source image
sourceimage = imread( 'sourceflower.jpg' );
sourceimage = sourceimage(:,1:32);
% compute and show histogram
imshow( sourceimage );
pause;
imhist( sourceimage );
pause;

files = dir( 'flowers' );
% for every image in the subdir
% we will show it's histogram.
for i = 3 : size(files);
    targetimage = imread( ['flowers\',files(i).name]);
    targetimage = targetimage(:,1:1600);
    imshow( targetimage);
    pause;
    imhist( targetimage);
    pause;
end


% acquire source image
sourceimage = imread( 'sourcecoin.jpg' );
sourceimage = sourceimage(:,1:52);
% compute and show histogram
imshow( sourceimage );
pause;
imhist( sourceimage );
pause;

files = dir( 'coins' );
% for every image in the subdir
% we will show it's histogram.
for i = 3 : size(files);
    targetimage = imread( ['coins\',files(i).name]);
    targetimage = targetimage(:,1:1600);
    imshow( targetimage );
    pause;
    imhist( targetimage);
    pause;
end

% acquire source image
sourceimage = imread( 'sourcestapler.jpg' );
sourceimage = sourceimage(:,1:320);
% compute and show histogram
imshow( sourceimage );
pause;
imhist( sourceimage );
pause;

files = dir( 'stapler' );
% for every image in the subdir
% we will show it's histogram.
for i = 3 : size(files);
    targetimage = imread( ['stapler\',files(i).name]);
    targetimage = targetimage(:,1:1600);
    imshow( targetimage );
    pause;
    imhist( targetimage);
    pause;
end

