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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.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 如何从图像序列计算相对比例?_Opencv_Image Processing_Computer Vision - Fatal编程技术网

Opencv 如何从图像序列计算相对比例?

Opencv 如何从图像序列计算相对比例?,opencv,image-processing,computer-vision,Opencv,Image Processing,Computer Vision,我正在尝试从2D序列估计相机姿势(带比例)。我使用以下代码估计序列中每对相邻图像的相对姿势: Mat essentialMatrix = findEssentialMat(pointsB, pointsA, focalLength, principlePoint, RANSAC, 0.999, 1.0, mask); recoverPose(essentialMatrix, pointsB, pointsA, rotationEstimate, translationEstimate, foca

我正在尝试从2D序列估计相机姿势(带比例)。我使用以下代码估计序列中每对相邻图像的相对姿势:

Mat essentialMatrix = findEssentialMat(pointsB, pointsA, focalLength, principlePoint, RANSAC, 0.999, 1.0, mask);
recoverPose(essentialMatrix, pointsB, pointsA, rotationEstimate, translationEstimate, focalLength, principlePoint);
点SA和点SB是帧A和帧B中特征的二维位置

我想计算每个帧的变换,以获得世界坐标。为此,我将把相对姿势矩阵连接在一起。但是,在连接之前,我需要确定相对比例


我的问题是,如何计算图像序列中相对姿势的相对比例?我可以使用solvePnPRANSAC API吗?

不过有点晚了。但最简单的解决方案是拍摄一对图像和其中的两个特征。然后对各个图像帧中的特征进行三角剖分,然后在各个帧中获取从第一个特征指向第二个特征的向量,并获取比率。我认为这将解决问题。

不过有点晚了。但最简单的解决方案是拍摄一对图像和其中的两个特征。然后对各个图像帧中的特征进行三角剖分,然后在各个帧中取从第一个特征指向第二个特征的向量,并取比率。我认为这将解决问题