Closed oleg-alexandrov closed 10 months ago
I did all these except giving stereo the option of using the filtered match file from bundle adjustment. The user still has to copy the file by hand if wants to use it.
I did a lot of testing and results change little. They will have impact only in some narrow situations but the current defaults are a more sensible way forward.
Some tuning of params will still be required every now and then. A stereo pair where a quarter of the planet is seen from very different perspective is different from a stereo pair with a 2 km footprint and a huge focal length and a 1 km mountain, which is different from the snowman shape that we processed that year. Such extreme situations could still use some custom attention.
The options --match-files-prefix, --clean-match-files-prefix, --matches-per-tile, --mapprojected-data, and making --skip-rough-homography the default should address all these.
Bundle adjustment was coded up by using some infrastructure from stereo, which has been implicitly assuming that the images have big footprint, so the heights in z are smaller than the lengths in x and y, cameras are reasonably accurate, and there is always a good datum.
None of these are always true, and then bundle adjustment can filter outliers way too aggressively and preamaturely. The good news is that in bundle adjustment we can filter outliers by reprojection error that we can't do in stereo, and also by other means. We can take advantage of this and disable or delay some of the stereo-inspired filtering. The following changes are proposed for bundle adjustment:
Make --skip-rough-homography the default, and add a flag called--enable-rough-homography.
Make two passes of bundle adjustment (hence with outlier filtering) the default.
Increase --ip-num-ransac-iterations to 1000 from 100 to make it try harder to fit models (also in stereo)
Increase --ip-inlier-factor from 1/15 to maybe 0.15, this will help with not throwing out matches for steep terrain. (Also document that this is the effect.)
Give stereo the option of using the filtered match file obtained in bundle adjustment, say called --match-file-prefix, rather than stereo creating its own suboptimal matches.
Perhaps make the triangulation-based tri ip filtering optional, as cameras are too inaccurate early on for this to work, or move it to the end, after cameras have been optimized.
Perhaps make elevation and lon-lat filtering also work not at the beginning but at the end as well.
The idea is that we will allow bundle adjustment to start with more matches, perhaps even more outliers as well, and filter them later, when cameras are accurate.