且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用PIL库查找子图像?

更新时间:2023-11-26 11:41:58

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)

这对我来说很好且有效.

This works fine and in efficient way for me.