I want to find this icon with transparent background
in this image
I tried the following code:
import cv2
method = cv2.TM_SQDIFF_NORMED
small_image = cv2.imread('icons/new/test.png')
large_image = cv2.imread('icons/example.png')
result = cv2.matchTemplate(small_image, large_image, method)
mn,_,mnLoc,_ = cv2.minMaxLoc(result)
MPx,MPy = mnLoc
trows,tcols = small_image.shape[:2]
cv2.rectangle(large_image, (MPx,MPy),(MPx+tcols,MPy+trows),(0,0,255),2)
cv2.imshow('output',large_image)
cv2.waitKey(0)
But, the result is as follows:
I think this is because my small image has transparent background. How can I fix that?