public class CalibrationPlanarGridZhang99
extends java.lang.Object
Full implementation of the Zhang99 camera calibration algorithm using planar calibration targets. First linear approximations of camera parameters are computed, which are then refined using non-linear estimation.
When processing the results be sure to take in account the coordinate system being left or right handed. Calibration works just fine with either coordinate system, but most 3D geometric algorithms assume a right handed coordinate system while most images are left handed.
A listener can be provide that will give status updates and allows requests for early termination. If a request for early termination is made then a RuntimeException will be thrown.
[1] Zhengyou Zhang, "Flexible Camera Calibration By Viewing a Plane From Unknown Orientations,", International Conference on Computer Vision (ICCV'99), Corfu, Greece, pages 666-673, September 1999.
| Modifier and Type | Class and Description |
|---|---|
static interface |
CalibrationPlanarGridZhang99.Listener |
| Constructor and Description |
|---|
CalibrationPlanarGridZhang99(PlanarCalibrationTarget target,
boolean assumeZeroSkew,
int numRadialParam)
Configures calibration process.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
applyDistortion(georegression.struct.point.Point2D_F64 pt,
double[] radial)
Applies radial distortion to the point.
|
static Zhang99Parameters |
convertIntoZhangParam(java.util.List<georegression.struct.se.Se3_F64> motions,
org.ejml.data.DenseMatrix64F K,
boolean assumeZeroSkew,
double[] distort)
Converts results fond in the linear algorithms into
Zhang99Parameters |
Zhang99Parameters |
getOptimized() |
protected Zhang99Parameters |
initialParam(java.util.List<java.util.List<georegression.struct.point.Point2D_F64>> observations)
Find an initial estimate for calibration parameters using linear techniques.
|
boolean |
optimizedParam(java.util.List<java.util.List<georegression.struct.point.Point2D_F64>> observations,
java.util.List<georegression.struct.point.Point2D_F64> grid,
Zhang99Parameters initial,
Zhang99Parameters found,
org.ddogleg.optimization.UnconstrainedLeastSquares optimizer)
Use non-linear optimization to improve the parameter estimates
|
boolean |
process(java.util.List<java.util.List<georegression.struct.point.Point2D_F64>> observations)
Processes observed calibration point coordinates and computes camera intrinsic and extrinsic
parameters.
|
void |
setListener(CalibrationPlanarGridZhang99.Listener listener)
Used to listen in on progress and request that processing be stopped
|
void |
setOptimizer(org.ddogleg.optimization.UnconstrainedLeastSquares optimizer)
Specify which optimization algorithm to use
|
public CalibrationPlanarGridZhang99(PlanarCalibrationTarget target, boolean assumeZeroSkew, int numRadialParam)
target - Description of the known calibration targetassumeZeroSkew - Should it assumed the camera has zero skew. Typically true.numRadialParam - Number of radial distortion parameters to consider. Typically 0,1,2.public void setListener(CalibrationPlanarGridZhang99.Listener listener)
listener - The listenerpublic boolean process(java.util.List<java.util.List<georegression.struct.point.Point2D_F64>> observations)
observations - Set of observed grid locations in pixel coordinates.protected Zhang99Parameters initialParam(java.util.List<java.util.List<georegression.struct.point.Point2D_F64>> observations)
public boolean optimizedParam(java.util.List<java.util.List<georegression.struct.point.Point2D_F64>> observations,
java.util.List<georegression.struct.point.Point2D_F64> grid,
Zhang99Parameters initial,
Zhang99Parameters found,
org.ddogleg.optimization.UnconstrainedLeastSquares optimizer)
observations - Observations of calibration points in each imagegrid - Location of calibration points on calibration targetinitial - Initial estimate of calibration parameters.found - The refined calibration parameters.optimizer - Algorithm used to optimize parameterspublic static Zhang99Parameters convertIntoZhangParam(java.util.List<georegression.struct.se.Se3_F64> motions, org.ejml.data.DenseMatrix64F K, boolean assumeZeroSkew, double[] distort)
Zhang99Parameterspublic static void applyDistortion(georegression.struct.point.Point2D_F64 pt,
double[] radial)
pt - point in calibrated pixel coordinatesradial - radial distortion parameterspublic void setOptimizer(org.ddogleg.optimization.UnconstrainedLeastSquares optimizer)
public Zhang99Parameters getOptimized()