MATLAB: “Spot the difference” game code

differencesImage Processing Toolboxspot the difference

hi i need a code which 1. detect 2 similar image and crop them out(example from browser) 2. detect the differences between 2 images 3. show the differences, count and label them(example difference no.1,difference no.2)
basically the code is like a cheat to the "spot the differences" game and tell u how many and where are the differences. Appreciate if some1 could help me on the code. Thanks in advance.

Best Answer

Try to just subtract them:
differenceImage = single(image1) - single(image2);
imshow(differenceImage, []);
Then you can threshold and blacken the differences, or make them red, or outline them, or whatever you want to do.