在用opencv做图像识别的过程中报错,一共10个相同物体,只能识别出6个,且count为0
for pos in posList:
angle = recRota(imgDilate, pos[0], pos[1], pos[0], pos[1], w, h, 0, draw=False)
rota_params = cv2.getRotationMatrix2D(angle[0], angle=0, scale=1)
rota_img = cv2.warpAffine(imgDilate, rota_params, (img_w, img_h))
imgCrop = rota_img[pos[1]:pos[1] + h, pos[0]:pos[0] + w]
#cv2.imshow('imgCrop', imgCrop)
count = cv2.countNonZero(imgCrop)
识别出的imgCrop为
未识别出的imgCrop则报错
求各位大神指教