Class CalibrationPlanarGridZhang99
- java.lang.Object
-
- boofcv.alg.geo.calibration.CalibrationPlanarGridZhang99
-
public class CalibrationPlanarGridZhang99 extends java.lang.ObjectFull 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interfaceCalibrationPlanarGridZhang99.Listener
-
Constructor Summary
Constructors Constructor and Description CalibrationPlanarGridZhang99(java.util.List<Point2D_F64> layout, boolean assumeZeroSkew, int numRadialParam, boolean includeTangential)Configures calibration process.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static voidapplyDistortion(Point2D_F64 normPt, double[] radial, double t1, double t2)Applies radial and tangential distortion to the normalized image coordinate.static Zhang99ParamAllconvertIntoZhangParam(java.util.List<Se3_F64> motions, org.ejml.data.DenseMatrix64F K, boolean assumeZeroSkew, double[] distort, boolean includeTangential)Converts results fond in the linear algorithms intoZhang99ParamAllZhang99ParamAllgetOptimized()booleanoptimizedParam(java.util.List<CalibrationObservation> observations, java.util.List<Point2D_F64> grid, Zhang99ParamAll initial, Zhang99ParamAll found, UnconstrainedLeastSquares optimizer)Use non-linear optimization to improve the parameter estimatesbooleanprocess(java.util.List<CalibrationObservation> observations)Processes observed calibration point coordinates and computes camera intrinsic and extrinsic parameters.voidsetListener(CalibrationPlanarGridZhang99.Listener listener)Used to listen in on progress and request that processing be stoppedvoidsetOptimizer(UnconstrainedLeastSquares optimizer)Specify which optimization algorithm to usestatic inttotalPoints(java.util.List<CalibrationObservation> observations)
-
-
-
Constructor Detail
-
CalibrationPlanarGridZhang99
public CalibrationPlanarGridZhang99(java.util.List<Point2D_F64> layout, boolean assumeZeroSkew, int numRadialParam, boolean includeTangential)
Configures calibration process.- Parameters:
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?
-
-
Method Detail
-
setListener
public void setListener(CalibrationPlanarGridZhang99.Listener listener)
Used to listen in on progress and request that processing be stopped- Parameters:
listener- The listener
-
process
public boolean process(java.util.List<CalibrationObservation> observations)
Processes observed calibration point coordinates and computes camera intrinsic and extrinsic parameters.- Parameters:
observations- Set of observed grid locations in pixel coordinates.- Returns:
- true if successful and false if it failed
-
optimizedParam
public boolean optimizedParam(java.util.List<CalibrationObservation> observations, java.util.List<Point2D_F64> grid, Zhang99ParamAll initial, Zhang99ParamAll found, UnconstrainedLeastSquares optimizer)
Use non-linear optimization to improve the parameter estimates- Parameters:
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 parameters
-
convertIntoZhangParam
public static Zhang99ParamAll convertIntoZhangParam(java.util.List<Se3_F64> motions, org.ejml.data.DenseMatrix64F K, boolean assumeZeroSkew, double[] distort, boolean includeTangential)
Converts results fond in the linear algorithms intoZhang99ParamAll
-
applyDistortion
public static void applyDistortion(Point2D_F64 normPt, double[] radial, double t1, double t2)
Applies radial and tangential distortion to the normalized image coordinate.- Parameters:
normPt- point in normalized image coordinatesradial- radial distortion parameterst1- tangential parametert2- tangential parameter
-
setOptimizer
public void setOptimizer(UnconstrainedLeastSquares optimizer)
Specify which optimization algorithm to use
-
getOptimized
public Zhang99ParamAll getOptimized()
-
totalPoints
public static int totalPoints(java.util.List<CalibrationObservation> observations)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG