I have to create a python image processing program which reads in two images, one containing a single object and the other containing several objects. However, the first images object is present in the second image but is surrounded by other objects (some similar).
The ima开发者_StackOverflow中文版ges are both the same size but I am having problems in finding a method of comparing the images, picking out the matching object and then also placing a cross, or pointer of some sort on top of the object which is present in both images.
The Program should therefore open up both images originally needing to be compared, then after the comparison has taken place the image containing many objects should be displayed but with a pointer on the object most similar (matching) the object in the first image.
The following is not Python, but a proof of concept for Image Correlation.
The following example is Mathematic code:
The same for Combos:
I guess the most straightforward way to achieve this is to compute the correlation map of the two images. Just convolve the two images using a scientific library such as scipy, apply a low pass filter and find the maximum value of the result.
You should check out the following packages:
numpy
scipy
matplotlib
PIL if your images are not in png format
精彩评论