ssl-vision icon indicating copy to clipboard operation
ssl-vision copied to clipboard

Add support for negative distortion during automatic calibration

Open g3force opened this issue 5 years ago • 2 comments

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.

g3force avatar Sep 10 '19 14:09 g3force

The problem is three-fold:

  1. There is some trivial hookups to the slider to the optimizer that needs to be done.
  2. The optimizer sets constraints on the distortion parameter, which need to be removed
  3. 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 .

joydeep-b avatar Sep 10 '19 14:09 joydeep-b

#163 solves this issue as well

g3force avatar Jan 26 '20 16:01 g3force