error: (-210:Unsupported format or combination of formats) The matrices must have 32f or 64f data ty

问题

Traceback (most recent call last):
  File "/home/liyi/yolov5_distance_count-master/video_remain.py", line 21, in 
    from dis_count import *
  File "/home/liyi/yolov5_distance_count-master/dis_count.py", line 4, in 
    import camera_configs
  File "/home/liyi/yolov5_distance_count-master/camera_configs.py", line 24, in 
    R1, R2, P1, P2, Q, validPixROI1, validPixROI2 = cv2.stereoRectify(left_camera_matrix, left_distortion,
cv2.error: OpenCV(4.5.2) /tmp/pip-req-build-13uokl4r/opencv/modules/calib3d/src/calibration.cpp:267: error: (-210:Unsupported format or combination of formats) The matrices must have 32f or 64f data type in function 'cvRodrigues2'

由报错可以得知:矩阵在函数中必须具有32f或64f数据类型

因为我的程序之中有一个单位矩阵

1 0 0
0 1 0
0 0 1

需要修改为32f的类型 将1改为1.0000即可 

你可能感兴趣的:(bug报错,opencv,计算机视觉,python)