Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用OpenCV/C+;校准带有自定义主点的摄像机+;(梅拉)_Opencv_Computer Vision_Opencv3.0_Camera Calibration - Fatal编程技术网

使用OpenCV/C+;校准带有自定义主点的摄像机+;(梅拉)

使用OpenCV/C+;校准带有自定义主点的摄像机+;(梅拉),opencv,computer-vision,opencv3.0,camera-calibration,Opencv,Computer Vision,Opencv3.0,Camera Calibration,我正试图校准一个主点不在中心的相机。因此,我将摄影机矩阵中的主点设置为: // Image size = 320 x 240; Mat camera_matrix = (Mat_<double>(3, 3) << 1, 0, 214, 0, 1, 106, 0, 0, 1); 但是,当我使用此标志时,相机矩阵不会以任何方式改变;与校准前相同。我错过什么了吗 谢谢 编辑:下面是我如何使用CalibleCamera的标志 // Set custom center b

我正试图校准一个主点不在中心的相机。因此,我将摄影机矩阵中的主点设置为:

// Image size = 320 x 240;
Mat camera_matrix = (Mat_<double>(3, 3) << 1, 0, 214, 0, 1, 106, 0, 0, 1);
但是,当我使用此标志时,相机矩阵不会以任何方式改变;与校准前相同。我错过什么了吗

谢谢

编辑:下面是我如何使用CalibleCamera的标志

    // Set custom center by initializing camera matrix
    Mat camera_matrix = (Mat_<double>(3, 3) << 1, 0, 214, 0, 1, 106, 0, 0, 1);
    .
    .
    .
    .
    double error = calibrateCamera(
        object_points,
        image_points,
        image_sz,
        camera_matrix,
        dist_matrix,
        rvec,
        tvec,
        CALIB_FIX_PRINCIPAL_POINT + CALIB_USE_INTRINSIC_GUESS
    );
    .
    .
    .
    .
    // Getting undistortion maps
    initUndistortRectifyMap(
        camera_matrix, 
        dist_matrix, 
        identity, 
        camera_matrix, 
        image_sz, 
        CV_32FC1, 
        map1, 
        map2);

    // Correcting frame and displaying
    remap(test_image, output_im, map1, map2, INTER_LINEAR);
//通过初始化相机矩阵设置自定义中心

Mat camera_matrix=(Mat_uu3,3)如何使用该标志?如果您共享了代码片段,该标志会很有用。如何使用该标志?如果您共享了代码片段,该标志会很有用
    // Set custom center by initializing camera matrix
    Mat camera_matrix = (Mat_<double>(3, 3) << 1, 0, 214, 0, 1, 106, 0, 0, 1);
    .
    .
    .
    .
    double error = calibrateCamera(
        object_points,
        image_points,
        image_sz,
        camera_matrix,
        dist_matrix,
        rvec,
        tvec,
        CALIB_FIX_PRINCIPAL_POINT + CALIB_USE_INTRINSIC_GUESS
    );
    .
    .
    .
    .
    // Getting undistortion maps
    initUndistortRectifyMap(
        camera_matrix, 
        dist_matrix, 
        identity, 
        camera_matrix, 
        image_sz, 
        CV_32FC1, 
        map1, 
        map2);

    // Correcting frame and displaying
    remap(test_image, output_im, map1, map2, INTER_LINEAR);