Class RadialDistortionEstimateLinear


public class RadialDistortionEstimateLinear extends Object

Estimates radial lens distortion by solving a linear equation with observed features on a calibration grid. Typically used as an initial estimate for use in non-linear optimization. An arbitrary number of distortion parameters can be solved for, but typically only two are found. The estimated is computed using a known intrinsic camera matrix,and homographies relating grid to camera coordinates. Based upon the description found in Section 3.3 in [1].

Radial distortion is modeled using the following equations:
u' = u + (u - u0)*[ k1(x2 + y2) +k2(x2 + y2)2]
v' = v + (v - v0)*[ k1(x2 + y2) +k2(x2 + y2)2]
where (u',v') is the observed distortion in pixel coordinates, (u0,v0) is the image center in pixel coordinates, (x,y) is the predicted distortion free calibrated coordinates.

The algorithm works by solving the system of equations below:

[ (u-u0)*r2 , (u-u0)*r4 ][k1] = [u'-u]
[ (v-v0)*r2 , (v-v0)*r4 ][k2] = [v'-v]

where r2 = (x2+y2).

[1] Zhengyou Zhang, "Flexible Camera Calibration By Viewing a Plane From Unknown Orientations," 1999

  • Constructor Details

    • RadialDistortionEstimateLinear

      public RadialDistortionEstimateLinear(int numParam)
      Creates a estimator for the specified number of distortion parameters.
      numParam - Number of radial distortion parameters. Two is a good number.
  • Method Details

    • process

      public void process(DMatrixRMaj cameraCalibration, List<DMatrixRMaj> homographies, List<CalibrationObservation> observations)
      Computes radial distortion using a linear method.
      cameraCalibration - Camera calibration matrix. Not modified.
      observations - Observations of calibration grid. Not modified.
    • getParameters

      public double[] getParameters()
      Returns radial distortion parameters.
      radial distortion parameters.