Python image processing – object recognition

When looking for a function enabling me to do normalized cross correlation of images, for purposes of object recognition, I stumbled upon an extension to the SciPy library: SciKit-image.

After a few minutes of browsing that site I was able to find what I was looking for, the ‘match_template’ function, that performs normalized cross correlation.

The object (image) I wanted to recognize in a set of other objects (images) is below:

(Btw, even though all the pics below might look like coming from FBI’s list for ‘Most Wanted Grumpy Old Men) all these gentlemen are in fact pillars of their societies, highly trained professionals, and friends of mine…! 🙂

So, here’s the ‘target’, i.e the object we are searching for:


And here’s the group of images within which to search:


Below the results of the search. The program is able to identify the correct image.


The heatmap below shows where within the search domain the best match is found, illustrated by the red circle around the best match area.


About swdevperestroika

High tech industry veteran, avid hacker reluctantly transformed to mgmt consultant.
This entry was posted in development, Math, software and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s