estworldpose giving different answers on each run.

2 views (last 30 days)
I have the a setero camera calibration file and am using the first image from the set of images to define a target line for my application. To find this orientation I am using the estworldpose function (I have attached the calibration file, the image points and the world points in use). Each run with the function gives different rotation matrix and translation values, (I can see the error in tranlation clearly). For refrence: translation should be roughly [100,50,-1900].
Are the different values because of one/all of these reasons?:
  1. An image used in calibration should not be used
  2. The ransac method method is not working because the world points I gave are planar (I want to use the checkerboard to define the target line)
If there is another reason can you explain it please.
Thank you.

Accepted Answer

Qu Cao
Qu Cao on 29 Sep 2023
estworldpose is a RANSAC-based method. You may want to set the random seed before running the function to get persistent results.
https://www.mathworks.com/help/matlab/ref/rng.html
  2 Comments
Ali
Ali on 29 Sep 2023
I set the random seed and it does give me persistent results.
But the solutions are still wrong. Why does the random seed make a difference when the estworldpose is doing multiple iterations to give a final solution and why is the solution wrong? Is it because the world points are planar?
Ali
Ali on 2 Oct 2023
I figured out why the solutions were completely wrong or sometimes close to correct. I had not aligned the world points in the same order as the Image points. So during the RANSAC the combination of random points sometimes was close to the correct orientation which gave a close to correct answer. The solution still changes on multiple runs but it does not give a outright wrong solution, for example: The solution for translation should be roughly [100,50,-1900], now all the solutions are in the correct order of magnitude unlike before when the solutions were of wrong order of magnitude.
Setting the random seed will give persistent solutions.

Sign in to comment.

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!