Python 3.x OpenCV错误-215:断言失败,can';我不知道如何诊断这个错误

Python 3.x OpenCV错误-215:断言失败,can';我不知道如何诊断这个错误,python-3.x,numpy,opencv,bots,pynput,Python 3.x,Numpy,Opencv,Bots,Pynput,我一直在遵循为flash游戏Burrito Bison开发模板匹配机器人的教程,但即使使用原始源代码,似乎也无法让机器人运行。错误出现在文件vision.py 完整错误为cv2.error:OpenCV(4.0.0)C:\projects\OpenCV python\OpenCV\modules\imgproc\src\templammatch.cpp:589:error:(-215:Assertion failed)corrsize.height可能重复 def match_template(

我一直在遵循为flash游戏Burrito Bison开发模板匹配机器人的教程,但即使使用原始源代码,似乎也无法让机器人运行。错误出现在文件
vision.py

完整错误为
cv2.error:OpenCV(4.0.0)C:\projects\OpenCV python\OpenCV\modules\imgproc\src\templammatch.cpp:589:error:(-215:Assertion failed)corrsize.height可能重复
def match_template(self, img_grayscale, template, threshold=0.9):
    """ Matches template image in a target grayscaled image """

    res = cv2.matchTemplate(img_grayscale, template, cv2.TM_CCOEFF_NORMED)
    matches = np.where(res >= threshold)