对于Structure From Motion这个话题,我是一个新手。我一直在尝试按照SFM的MathWorks网页上的教程:LINK。
但是,运行代码后,我收到以下错误消息:
Warning: Maximum number of trials reached. Consider increasing the maximum
distance or decreasing the desired confidence.
> In vision.internal.ransac.msac (line 136)
In estimateEssentialMatrix (line 161)
In helperEstimateRelativePose (line 43)
In PERFORM_SFM (line 70)
Error using helperEstimateRelativePose (line 70)
Unable to compute the Essential matrix
Error in PERFORM_SFM (line 70)
[relativeOrient, relativeLoc, inlierIdx] = helperEstimateRelativePose(...
有人可以帮我理解为什么会这样吗?有人能给我一个不同的方法吗?
答案 0 :(得分:0)
我设法解决了同样的错误。在我的情况下,似乎我使用了太多的图像,因此得到的方程系统是超定的,因此无法计算矩阵。我刚刚测试了一些类似于示例的图像(在我的情况下为6),并且帧与帧之间的相机运动足够多,并且它的工作方式应该如此。
希望这有帮助。
答案 1 :(得分:0)
正如@Ander Biguri所说,请考虑增加最大距离或减小所需的置信度。您可以通过修改Matlab内置函数 helperEstimateRelativePose.m :第43行来实现。然后,您可以根据需要添加任意数量的图像。修改后,它应如下所示:
[E, inlierIdx] = estimateEssentialMatrix(matchedPoints1, matchedPoints2,...
cameraParams, 'Confidence', 50, 'MaxDistance', 5);
但是要小心编辑内置功能。就我而言,我修改了该函数并用另一个名称保存到另一个文件夹中,然后将该文件夹添加到路径中。 我希望这会对某人有所帮助。