Matlab bundleAdjustment not converging to the true solution
2 views (last 30 days)
Show older comments
Hi everybody, I'm currently trying to incorporate Matlab's bundleAdjustment function into my project. While it seems to work in the examples (even though there is no ground thruth to compare the results), in my project the refined camera poses and 3d points are far from the true solution.
I am evaluating the motion of a camera moving exactly in the -x (left) direction. The images are captured exactly 50mm apart. A point cloud is triangulated in the first two frames and the true scale is given knowing the length of the motion. From the 3rd frame, p3p-RANSAC is used to retrieve the global camera positions. Let's say I compute 5 camera poses and i compute also the reprojection error of the triangulated cloud. The mean reprojection error is approx 1 pixel for each point. The reconstruction of these 5 views is pretty accurate, the maximum error is approximately 5mm.
Now I want to refine those 5 poses using the bundle adjustment function embedded in Matlab and here I have issues.
->If I use the default settings the function will not Iterate more than once, saying that the variation of the reprojection error is below the threshold
->If I set ... 'AbsoluteTolerance', 1e-9, 'RelativeTolerance', 1e-9, 'MaxIterations', 300 (as in the Monocular Visual Odometry example) and fix the two initial camera position, the optimization will converge to wrong results.
Now I'm asking if someone that has succesfully implemented this function have experienced some issues or if there are some other factors to consider while performing bundle adjustment.
Thank you
2 Comments
Ramanpreet
on 1 Feb 2017
Edited: Walter Roberson
on 1 Feb 2017
How did you get the BundleAdjustment function to run? When i run the example at https://www.mathworks.com/help/vision/ref/bundleadjustment.html#inputarg_xyzPoints
I get an error:
Error using getPrmDflt (line 47) odd number of parameters in prm
Error in bundleAdjustment (line 49) getPrmDflt( varargin,{ 'KMask', [], 'nItr', 500, ...
at this line:
[xyzRefinedPoints,refinedPoses] = bundleAdjustment(xyzPoints,pointTracks,cameraPoses,cameraParams);
After looking more into it the input to getPrmDflt is totally different that what the function expects. Is there some bug or wrong function call in bundle adjustment code?
Answers (0)
See Also
Categories
Find more on Code Generation, GPU, and Third-Party Support in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!