function object_recognition()
Ia = single(rgb2gray(imread('query.jpg')));
for i = 1:4
Ib = single(rgb2gray(imread(strcat('db', num2str(i) ,'.jpg'))));
[fa, da] = vl_sift(Ia);
[fb, db] = vl_sift(Ib);
[matches, scores] = vl_ubcmatch(da, db);
[sortedScores, indices] = sort(scores);
sortedMatches = matches(:, indices);
subplot(4,1,i)
imshow(appendimages(Ia,Ib), []); hold on; set(gcf,'color','w');
for i = 1 : 10
ind1 = sortedMatches(1, i);
ind2 = sortedMatches(2, i);
plot(fa(1, ind1), fa(2, ind1), 'ro'); hold on;
plot(size(Ia,2)+fb(1, ind2), fb(2, ind2), 'ro'); hold on;
plot([fa(1, ind1) size(Ia,2)+fb(1, ind2)], ...
[fa(2, ind1) fb(2, ind2)], 'g-');
end
end
end