经过我进一步的测试:
我怀疑这个是版本出现的问题:
把:
- corners2 = cv2.cornerSubPix(gray,corners,(11,11),(-1,-1),criteria)
- imgpoints.append(corners2)
- # Draw and display the corners
- img1 = cv2.drawChessboardCorners(img, (7,6), corners2,ret)
复制代码
改为
- cv2.cornerSubPix(gray,corners,(11,11),(-1,-1),criteria)
- # Draw and display the corners
- cv2.drawChessboardCorners(img, (7,6), corners,ret)
复制代码
就可以了 |