Hierarchical-Localization
Hierarchical-Localization copied to clipboard
3D mapping vs localization accuracy of tvec
I would like to ask whoever can help me clarification about 3D mapping and localization accuracy of tvec. I did this experiment:
- I choose 20 positions in a grid in which each point is 1 meter distant each other. I assumed the first position in the bottom left side is (0,0,0). From this assumption I have the real position of each photo.
- For each position, I shot 2 photos using a camera stand.
- I used 1 photo for each position for the 3d mapping (green frustum below) and then I localized the remaining ones (red frustum below).
- 3d mapping ("sfm") and localization ("loc") parameters
- I scaled the sfm model using the model_aligner function in colmap giving the real position of 3 photos.
- I computed the average errors (measured as linear distance and using ransac.max_error = 12) between
- tvec error between mapping (green frustum) and localization (red frustum) photos: 0.060 m
- tvec error between mapping (green frustum) and real positions: 0.030 m
- tvec error between localization (red frustum) and real positions: 0.067 m
- I replicated the same experiment using as ransac.max_error = 4 and I computed the average errors (measured as linear distance) between
- tvec error between mapping (green frustum) and localization (red frustum) photos: 0.169 m
- tvec error between mapping (green frustum) and real positions: 0.030 m
- tvec error between localization (red frustum) and real positions: 0.174 m
and finally using as ransac.max_error = 50 and I computed the average errors (measured as linear distance) between
- tvec error between mapping (green frustum) and localization (red frustum) photos: 0.096 m
- tvec error between mapping (green frustum) and real positions: 0.029 m
- tvec error between localization (red frustum) and real positions: 0.101 m
- My questions are
- Why 3d mapping is more accurate than localization? I am aware that configuration parameters are different between 3d mapping and localization (I did that to make localization faster), but this can be the real explanation?
- Why tvec error are higher with ransac.max_error = 4 than with ransac.max_error = 12 or 50? What is the real meaning of the ransac.max_error and what is the logic for a proper setting?
Many thanks in advance to everyone can help me!
With reference to the first question
"
Why 3d mapping is more accurate than localization? I am aware that configuration parameters are different between 3d mapping and localization (I did that to make localization faster), but this can be the real explanation?
"
I did another test with the same configuration between 3d mapping and localization
and I copmuted the average errors (measured as linear distance and using ransac.max_error = 12) between
- tvec error between mapping (green frustum) and localization (red frustum) photos: 0.064 m
- tvec error between mapping (green frustum) and real positions: 0.028 m
- tvec error between localization (red frustum) and real positions: 0.074 m
Error are very similar to the case with different configuration. So, why 3d mapping is more accurate than localization (about 3 cm error vs 6.5 cm error respectively)? Many thanks
I will try to sum up my questions.
- What could be possible causes of different accuracy between mapping (about 3 cm error) and localization (about 6.5 cm error)?
- Since I noticed that lower ransac.max_error threshold do not provide better localization results, what could be the logic to follow to properly set this value?
Many thanks to everyone can help me.
The mapping of each image starts the estimate the absolute pose, which is identical to the localization process, and it followed by a retriangulation of the 3D points and by a full bundle adjustment, which refines both poses and camera intrinsic parameters. This explains why mapping poses and more accurate than poses estimated by the localization process.
Many thanks @sarlinpe ! What about ransac.max_error threshold during localization? Can you suggest a logic to set it or a minimum number of inliers to get for a good localization or what else? Thanks again!
It depends on your data. The default value is generally sufficient, and it can be decreased if necessary.