<p>Consider looking into normalized cross correlation. Note that this works best only if the the size and the aspect ratios of the objects dont change between the two images. Here is a link to the matlab function and in fact they are doing something similar to what you want as an example
<a href="https://www.mathworks.com/help/images/ref/normxcorr2.html" rel="nofollow noreferrer">MATLAB NCC</a></p>

<p>Now suppose the sizes and aspect ratios are changing then thats when sophisticated image processing/machine learning algorithms need to be used. If you can have large amount of training examples then you could use deep learning for this task. My personal choice would be to transform this into a image segmentation problem and then use a <a href="https://arxiv.org/abs/1505.04597" rel="nofollow noreferrer">U-Net</a></p>
Compare two images in Matlab and object identification
<p>I'm new to matlab. I was involved in a project in high school. The project will have two pictures with objects in it. There will be more than one object in the first picture. In the second picture there will be only one of the objects in the first picture. The two images are compared and if the object in the second image matches one of the objects in the first picture, only the object will be shown in color in the first picture. Other objects will be displayed in gray.</p>

<p>I've done research, but I still don't know how to proceed. How do I follow a path? Or is there an example like this? How can I investigate and learn about this?</p>

<p><a href="https://i.stack.imgur.com/AJAj6.jpg" rel="nofollow noreferrer">first image</a>
<a href="https://i.stack.imgur.com/vZhmP.jpg" rel="nofollow noreferrer">second image</a>
Pictures are in the attachment.</p>