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. One difference from the original paper is that tangential distortion can be included. No linear estimate if found for tangential, they are estimated by initializing the non-linear estimate with all zero.
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(java.util.List<georegression.struct.point.Point2D_F64> layout,
boolean assumeZeroSkew,
int numRadialParam,
boolean includeTangential)
Configures calibration process.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
applyDistortion(georegression.struct.point.Point2D_F64 normPt,
double[] radial,
double t1,
double t2)
Applies radial and tangential distortion to the normalized image coordinate.
|
static Zhang99ParamAll |
convertIntoZhangParam(java.util.List<georegression.struct.se.Se3_F64> motions,
org.ejml.data.DenseMatrix64F K,
boolean assumeZeroSkew,
double[] distort,
boolean includeTangential)
Converts results fond in the linear algorithms into
Zhang99ParamAll |
Zhang99ParamAll |
getOptimized() |
protected Zhang99ParamAll |
initialParam(java.util.List<CalibrationObservation> observations)
Find an initial estimate for calibration parameters using linear techniques.
|
boolean |
optimizedParam(java.util.List<CalibrationObservation> observations,
java.util.List<georegression.struct.point.Point2D_F64> grid,
Zhang99ParamAll initial,
Zhang99ParamAll found,
org.ddogleg.optimization.UnconstrainedLeastSquares optimizer)
Use non-linear optimization to improve the parameter estimates
|
boolean |
process(java.util.List<CalibrationObservation> 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
|
static int |
totalPoints(java.util.List<CalibrationObservation> observations) |
public CalibrationPlanarGridZhang99(java.util.List<georegression.struct.point.Point2D_F64> layout,
boolean assumeZeroSkew,
int numRadialParam,
boolean includeTangential)
layout - Layout of calibration points on the targetassumeZeroSkew - Should it assumed the camera has zero skew. Typically true.numRadialParam - Number of radial distortion parameters to consider. Typically 0,1,2.includeTangential - Should it include tangential distortion?public void setListener(CalibrationPlanarGridZhang99.Listener listener)
listener - The listenerpublic boolean process(java.util.List<CalibrationObservation> observations)
observations - Set of observed grid locations in pixel coordinates.protected Zhang99ParamAll initialParam(java.util.List<CalibrationObservation> observations)
public boolean optimizedParam(java.util.List<CalibrationObservation> observations, java.util.List<georegression.struct.point.Point2D_F64> grid, Zhang99ParamAll initial, Zhang99ParamAll 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 Zhang99ParamAll convertIntoZhangParam(java.util.List<georegression.struct.se.Se3_F64> motions, org.ejml.data.DenseMatrix64F K, boolean assumeZeroSkew, double[] distort, boolean includeTangential)
Zhang99ParamAllpublic static void applyDistortion(georegression.struct.point.Point2D_F64 normPt,
double[] radial,
double t1,
double t2)
normPt - point in normalized image coordinatesradial - radial distortion parameterst1 - tangential parametert2 - tangential parameterpublic void setOptimizer(org.ddogleg.optimization.UnconstrainedLeastSquares optimizer)
public Zhang99ParamAll getOptimized()
public static int totalPoints(java.util.List<CalibrationObservation> observations)