Hi Matt, It is better to compute features once instead of creating it every time when you run your code. An easy idea is to use some shape descriptor (like seven moments) to capture the shape. Say knife - contains some value and racket contains some other. Save your workspace as .mat and load it next time whenever you want to compare. If the name is like 1.jpg , 2.jpg then use num2str to generate the names. Otherwise you can use this code to read all the images.
if true
tifFiles = dir('*.tif');
for k = 1:length(tifFiles)
filename = tifFiles(k).name;
I = imread(filename);
end
Use euclidean distance to find the nearest entry.