NeoGeographyToolkit / StereoPipeline

The NASA Ames Stereo Pipeline is a suite of automated geodesy & stereogrammetry tools designed for processing planetary imagery captured from orbiting and landed robotic explorers on other planets.
Apache License 2.0
493 stars 173 forks source link

Fast and accurate undistortion #269

Closed oleg-alexandrov closed 1 year ago

oleg-alexandrov commented 5 years ago

For some distortion models the distortion is computed by a formula, and undistortion needs to be inverted which is very slow. For others it is the reverse. We currently have a bit of haphazard fix for this, where, for example, Brown Conrady and Photometrix models are approximated with a Tsai model on the fly. The latter has two radial distortion and two two tangential distortion coefficients. It is not clear that this is enough.

When the cameras have Tsai distortion to start with, then undistortion is slow, and I don't think we do anything for that.

Lastly, for both Tsai and RPC we compute the the approximation that results in a fast model by using an initial guess for zero distortion and optimizing it. This can run into local minima and produce a poor approximation, particularly for high-degree RPC.

I think some careful thinking needs to be done about how to best support distortion and fast evaluation of distortion/undistortion in our software.

oleg-alexandrov commented 1 year ago

This hasn't been an issue in practice. ASP ships now an auxiliary tool named undistort_image_texrecon that is meant to be used with recently added meshing and texturing functionality. This handles undistortion by interpolating into a lookup table, and also has the ability to set the domain of distortion and undistortion. If needed, could be expanded to a more general solution.