import cv2
import matplotlib.pyplot as plt
import numpy as np
def cv_show(name,img):#定义图片展示函数
cv2.imshow(name,img)
cv2.waitKey(0)
cv2.destroyAllWindows()
img = cv2.imread('peerlady.jpg',0)
template = cv2.imread('peerladyface.jpg', 0)
h,w = template.shape[:2]
print(img.shape)
print(template.shape)
res = cv2.matchTemplate(img, template, cv2.TM_SQDIFF)
print(res.shape)
您好!我在学习opencv模板匹配的时候用cv2.matchTemplate的时候一直报错但是我去其他地方搜也没有搜到解决方案
可以麻烦您帮我看一下吗谢谢了