The following code works for me:
import numpy from PIL import Image here = Image.open(r"eye.png") big = Image.open(r"lenna.png") herear = numpy.asarray(here) bigar = numpy.asarray(big) hereary, herearx = herear.shape[:2] bigary, bigarx = bigar.shape[:2] stopx = bigarx - herearx + 1 stopy = bigary - hereary + 1 for x in range(0, stopx): for y in range(0, stopy): x2 = x + herearx y2 = y + hereary pic = bigar[y:y2, x:x2] test = (pic == herear) if test.all(): print(x,y)
Conclusion: 312 237
Graphically:

Test Images Used
lenna.png

eye.png

Note It is important that you use a lossless image format when you create a smaller, cropped version (lossless PNG, JPEG is usually lost). If you use a lossy format, you risk that the pixel values ββare close but not identical. The above code based on yours will only find exact pixel matches. In this regard, the OpenCV pattern matching features are a bit more flexible. This does not mean that you cannot change your code to work just as well, you could. But, as it is, the code in this answer has this limitation.
More general version
Here, as a function, this collects all the matching coordinates and returns them as a list of (x, y) tuples:
import numpy as np from PIL import Image im_haystack = Image.open(r"lenna.png") im_needle = Image.open(r"eye.png") def find_matches(haystack, needle): arr_h = np.asarray(haystack) arr_n = np.asarray(needle) y_h, x_h = arr_h.shape[:2] y_n, x_n = arr_n.shape[:2] xstop = x_h - x_n + 1 ystop = y_h - y_n + 1 matches = [] for xmin in range(0, xstop): for ymin in range(0, ystop): xmax = xmin + x_n ymax = ymin + y_n arr_s = arr_h[ymin:ymax, xmin:xmax]
Update:
Given the images you have provided, you will notice that the matching method is configured, it will correspond to only one of the two. The top left is the one that you cropped for the needle image, so it exactly matches. The bottom right image should match exactly the pixel for the pixel. With this implementation, even a one-difference difference in one of the color channels will lead to its ignoring.
As it turned out, the two here are changing quite a bit: 
Verified Versions:
- Python 2.7.10, Numpy 1.11.1, PIL (pillow) 1.1.7
- Python 3.5.0, Numpy 1.10.4, PIL (pillow) 1.1.7