...

Find Waldo with OpenCV Template Matching in Python

wally

Last Updated on 22/04/2026 by Eran Feit

Introduction

This tutorial shows how to use OpenCV template matching in Python to find a smaller image inside a larger image.
We will solve a fun Where’s Waldo style problem using a single, simple algorithm.
The code reads two images, converts the scene to grayscale, and runs cv2.matchTemplate to measure visual similarity.
We then extract the best match location and draw a bounding box to highlight Waldo in the scene.
This approach is fast, easy to understand, and requires no training data.
It is perfect for quick image matching tasks and for learning the fundamentals of search by template in computer vision.