Got an error in stereo vision fish eye camera calibration

asked 2018-08-23 08:13:00 -0600

Kush gravatar image

updated 2018-08-23 08:15:22 -0600

The error I am geting is: error: (-5:Bad argument) When the input arrays in add/subtract/multiply/divide functions have different types, the output array type must be explicitly specified in function 'arithm_op'

function related imagesize

"

filenames = [] objectPoints = [] imagePoints = [] imageSize = None for imagePath in sorted(imagePaths): image = cv2.imread(imagePath) grayImage = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

    newSize = grayImage.shape[::-1]
    if imageSize != None and newSize != imageSize:
        raise ValueError(
                "Calibration image at {0} is not the same size as the others"
                .format(imagePath))
    imageSize = newSize
    ret, corners = cv2.findChessboardCorners(grayImage,
            CHESSBOARD_SIZE, cv2.CALIB_CB_FAST_CHECK)

And Stereo Calibration function: (rms,K1, D1, K2, D2, R, T) = cv2.fisheye.stereoCalibrate( objectPoints, leftImagePoints, rightImagePoints, K_left, D_left, K_right, D_right, imageSize, flags = flags)

"

edit retag flag offensive close merge delete

Comments

i can't see any "arithm_op" in your code.

also, again: WHERE EXACTLY does it happen ?

berak gravatar imageberak ( 2018-08-23 08:14:51 -0600 )edit

I think it is talking about cv2.fisheye.stereocalibrate because there is no function like 'arithm_op' when I added imageSize it throws the error.

Traceback (most recent call last): File "fisheye_calib1.py", line 179, in <module> flags = flags) cv2.error: OpenCV(4.0.0-pre) /home/compute/OpenCV-tmp/opencv-3/modules/core/src/arithm.cpp:683: error: (-5:Bad argument) When the input arrays in add/subtract/multiply/divide functions have different types, the output array type must be explicitly specified in function 'arithm_op'

Kush gravatar imageKush ( 2018-08-23 08:29:49 -0600 )edit