3

I am a novice when it comes to the topic of Structure From Motion. I have been trying to follow the tutorial here in the MathWorks webpage for SFM: LINK.

However, after running the code, I get this error message:

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(...

Could someone help me understand why this is happening? Could someone provide me an different approach?

troymyname00
  • 670
  • 1
  • 14
  • 32

2 Answers2

0

I just managed to solve this same error. In my case, it seems I was using too many images, so the resulting equation system was overdetermined and, therefore, the matrix could not be computed. I just tested with a number of images similar to the example (6, in my case) and enough camera movement from frame to frame, and it works like it should.

Hope this helps.

Victor Medina
  • 171
  • 1
  • 5
0

As @Ander Biguri said, consider increasing the maximum distance or decreasing the desired confidence. You can do this by modifying the Matlab built-in function helperEstimateRelativePose.m: line 43. Then you can add as many images as you want. After modification, it should look like this:

 [E, inlierIdx] = estimateEssentialMatrix(matchedPoints1, matchedPoints2,...
    cameraParams, 'Confidence', 50, 'MaxDistance', 5);

But be careful editing the built-in functions. In my case, I modified the function and saved into another folder by another name and add that folder into path. I hope this will help someone.

jHz
  • 79
  • 1
  • 11