ssl-vision
ssl-vision copied to clipboard
Add support for negative distortion during automatic calibration
The new high resolution cameras of the SSL league have a negative distortion. Support was added to set the distortion to a negative value manually, but the optimizer for the automatic calibration can not optimize for negative values right now.
@joydeep-b Your input in how to solve this would be very helpful.
The problem is three-fold:
- There is some trivial hookups to the slider to the optimizer that needs to be done.
- The optimizer sets constraints on the distortion parameter, which need to be removed
- The cubic solver for undistortion assumes a positive distortion coefficient. Without this assumption, the general form of the cubic solver is MUCH more involved.
We can use some off-the-shelf general purpose cubic solvers (e.g. GSL: https://www.gnu.org/software/gsl/doc/html/poly.html#cubic-equations), remains to be seen how slow they are for calibration.
Alternatively, it could be a good time to ditch the custom implementation of LM with numeric differentiation and adopt Ceres-Solver (http://www.ceres-solver.org/) for optimization, using automatic differentiation. We will not need the inverse formulae, then, just the forward propagation: SE(3) transform -> pinhole projection -> radial distortion .
#163 solves this issue as well