% CIS 601 Computer Graphics and Image Processing
% Homework 2                    Spring 2007
% Riu Baring
% ==============================================
% Main function (Task #1)
% ==============================================

% Array pre-allocation
queryImg = zeros(240, 320);
matchOne = zeros(240, 320);
matchTwo = zeros(240, 320);

for r = 1:8
    % Read image files
    queryImg = imresize(imread(sprintf('image%d.jpg', r)), [240 320]);
    
    % Make a query to the image database
    [matchOne matchTwo] = query(queryImg);
    
    % Show images
    subplot(3, 8, r);       imshow(queryImg);
    subplot(3, 8, r + 8);   imshow(matchOne);
    subplot(3, 8, r + 16);  imshow(matchTwo);
end