- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我注意到 opencv stereoCalibrate() 改变了相机矩阵中的焦距,即使我已经设置了适当的标志(即 CV_CALIB_FIX_FOCAL_LENGTH)。我在镜头上使用两个具有相同焦距的相同相机,而且我知道传感器尺寸,因此我可以手动计算内在相机矩阵,我实际上在做什么。
这里是立体校准程序的一些输出 - stereoCalibrate() 之前和之后的相机矩阵。
std::cout << "Before calibration: " << std::endl;
std::cout << "C1: " << _cameraMatrixA << std::endl;
std::cout << "C2: " << _cameraMatrixB << std::endl;
double error = cv::stereoCalibrate(objectPoints, imagePointsA, imagePointsB, _cameraMatrixA, _distCoeffsA, _cameraMatrixB, _distCoeffsB, _imageSize,
R, T, E, F,
cv::TermCriteria((cv::TermCriteria::COUNT + cv::TermCriteria::EPS), 30, 9.999999999999e-7), CV_CALIB_FIX_FOCAL_LENGTH | CV_CALIB_FIX_PRINCIPAL_POINT);
std::cout << "After calibration: " << std::endl;
std::cout << "C1: " << _cameraMatrixA << std::endl;
std::cout << "C2: " << _cameraMatrixB << std::endl;
Before calibration:
C1: [6203.076923076923, 0, 1280; 0, 6203.076923076923, 960; 0, 0, 1]
C2: [6203.076923076923, 0, 1280; 0, 6203.076923076923, 960; 0, 0, 1]
After calibration:
C1: [6311.77650416514, 0, 1279.5; 0, 6331.34531760757, 959.5; 0, 0, 1]
C2: [6152.655897294907, 0, 1279.5; 0, 6206.591406832492, 959.5; 0, 0, 1]
我认为这是奇怪的 opencv 行为。有人遇到过类似的问题吗?我知道这很容易解决,我可以在立体校准后为相机矩阵设置焦距。
最佳答案
为了做你想做的事,你必须调用带有标志的stereoCalibrate
:
CV_CALIB_USE_INTRINSIC_GUESS | CV_CALIB_FIX_FOCAL_LENGTH | CV_CALIB_FIX_PRINCIPAL_POINT
如果不使用CV_CALIB_USE_INTRINSIC_GUESS
标志,stereoCalibrate
会先初始化相机矩阵和畸变系数本身,然后在后续优化中修复其中的一部分。这在 documentation 中说明,虽然相当不清楚并且没有提到那个关键标志:
Besides the stereo-related information, the function can also perform a full calibration of each of two cameras. However, due to the high dimensionality of the parameter space and noise in the input data, the function can diverge from the correct solution. If the intrinsic parameters can be estimated with high accuracy for each of the cameras individually (for example, using calibrateCamera() ), you are recommended to do so [...].
使用 CV_CALIB_USE_INTRINSIC_GUESS
和任何 CV_CALIB_FIX_*
标志告诉函数使用您传递的内容作为输入,否则,此输入将被简单地忽略和覆盖。
关于c++ - stereoCalibrate() 改变焦距,即使它不应该改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23059076/
我正在使用 stereoCalibrate,而 termCriteria 会抛出错误 ' cv :: stereoCalibrate ' : can not convert parameter 13
我有两台分辨率不同的相机,但 stereoCalibrate 函数只有一个图像大小选项。 如果我理解正确的话,stereoCalibrate 会计算从 cam1 到 cam2 的刚性变换矩阵。如果这是
我注意到 opencv stereoCalibrate() 改变了相机矩阵中的焦距,即使我已经设置了适当的标志(即 CV_CALIB_FIX_FOCAL_LENGTH)。我在镜头上使用两个具有相同焦距
我在使用 OpenCV 计算立体声对的校正时遇到一些问题:stereoCalibrate 返回高均方根误差,我得到了错误的校正对。我尝试了我的整改程序和 opencv 提供的 stereo_calib
我有一个立体相机装置。我已经捕获了一个 chessboardPattern 序列(相同的序列,每次曝光两张照片)。我使用 cv2.calibrateCamera 对各个相机执行了单个相机校准。 我的问
我是 OpenCV 的新手,在 Python 上找不到 stereoCalibration 的正常教程。如果您有一些示例,请分享。 我对每个相机都进行了一次校准,然后遇到了下一个问题。左边一个: 正确
我在校准两个摄像头时遇到问题:第一个是 rgb,第二个是红外线。它们具有不同的分辨率(我调整大小并裁剪了更大的图像)、焦距等... 例子: RGB 1920x1080 红外线 512x424 如何相互
大家好,我一直在使用 Python 和 OpenCV 深入研究计算机视觉,并尝试校准我购买的两台相机,以便进行一些 3D 立体重建,但我遇到了一些问题。 我主要关注的是这个tutorial为了分别校准
我已经校准了一对相机,我有一个循环,可以跟踪人腿上的标记并保存他们的位置。现在怎么办? 我是否必须在保存像素坐标之前cv::undistort 图像?在我尝试将这些 2D 坐标对转换为 3D 之前,还
我会尽量让这个问题具体化。 在 opencv 3.0 中调用 stereoCalibrate() 时,出现如下错误信息: Assertion failed 0 && nimages == image
我正在使用 openCV 的 calibrateCamera() 来检索 distCoeffs,我想将其用作 stereoCalibrate() 的输入。但是调用 StereoCalibrate()
我似乎无法确定在哪里可以找到 stereoCalibrate() 方法的输入数组。 opencv 文档将其描述为“校准模式点向量的向量”,这似乎必须来自对象检测校准。然而,我已经为我的相机完成了 op
我正在使用Python 2.7和OpenCV 3.3进行立体摄像机校准。我使用的代码是(我从Stereo Calibration Opencv Python and Disparity Map获得):
我是一名优秀的程序员,十分优秀!