% task2
clear im;
im{1}=imread('DSC_9209.jpg');
im{2}=imread('DSC_8958.jpg');
im{3}=imread('DSC_8911.jpg');
im{4}=imread('DSC_8648.jpg');
im{5}=imread('DSC_0588.jpg');
im{6}=imread('DSC_0315.jpg');
im{7}=imread('DSC_0218.jpg');
im{8}=imread('DSC_0037.jpg');

for i=1:8
   im{i}=rgb2gray(im{i})';
end;

for i=1:8
   img=im{i};   
   subplot(3,8,i);
   imshow(img);
   [im1,im2]=query(img, im);   
   subplot(3,8,i+8);
   imshow(im1);   
   subplot(3,8,i+16);
   imshow(im2);
end


