There are many instances of subimage present inside the main image. I want to extract all the coordinates of the sub images from the main image. I could able to extract for only one. Kindly assist in the same
import cv2
import numpy as np
image = cv2.imread("Large.png")
template = cv2.imread("small.png")
result = cv2.matchTemplate(image,template,cv2.TM_CCOEFF_NORMED)
print np.unravel_index(result.argmax(),result.shape)
_, w, h = template.shape[::-1]
threshold = 0.5
loc = np.where( res >= threshold)
coordinates = zip(loc[0], loc[1])
print coordinates