I have two images one is full image of 780 x 128 and other one is the cropped image from that 780 x 128(full image).
I want to find if the first image contains the second image, and if so, find out the coordinates of the top-left and right-bottom pixels inside the first image where the match is.
Is there a way to do that purely in Numpy, in a fast enough way, rather than using (4! very slow) pure Python loops?
I only bother about the coordinates other solutions for related questions are not suitable to give the coordinates of small image(img2) over the big image(img1).
Example:
img1 = numpy.array([
[0, 1, 2, 3],
[4, 5, 6, 7],
[8, 9, 10, 11]
])
img2 = numpy.array([
[2, 3],
[6, 7]
])
How to do something like this?
coordinates = a.find(b)
coordinates of small image(img1) would then be [(0, 2), (1, 3)]