Class CalibrateMonoPlanar
- All Implemented Interfaces:
VerbosePrint
Performs the full processing loop for calibrating a mono camera from a planar grid. A directory is specified that the images are read in from. Calibration points are detected inside the image and feed into the Zhang99 algorithm for parameter estimation.
Internally it supports status updates for a GUI and skips over bad images. Invoke functions in the following order:
configure(boolean, boofcv.alg.geo.calibration.cameras.Zhang99Camera)
initialize(int, int, java.util.List<georegression.struct.point.Point2D_F64>)
addImage(boofcv.alg.geo.calibration.CalibrationObservation)
process()
getIntrinsic()
Most 3D operations in BoofCV assume that the image coordinate system is right handed and the +Z axis is pointing out of the camera. In standard image coordinate the origin (0,0) is at the top left corner with +x going to the right and +y going down, then if it is right handed +z will be out of the image. However some times this pseudo standard is not followed and the y-axis needs to be inverted by setting isInverted to true.
-
Field Summary
Modifier and TypeFieldDescriptionprotected DetectSingleFiducialCalibration
protected List<ImageResults>
protected CameraModel
protected List<Point2D_F64>
protected List<CalibrationObservation>
protected SceneStructureMetric
@Nullable PrintStream
protected CalibrationPlanarGridZhang99
computes calibration parameters -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addImage
(CalibrationObservation observation) Adds the observations from a calibration target detectorstatic void
computeQuality
(CameraModel intrinsic, ScoreCalibrationFill fillScorer, List<Point2D_F64> worldPoints, List<CalibrationObservation> observations, CalibrationQuality quality) Computes quality metrics to quantify how good of a job the person calibrating didstatic String
computeQualityText
(List<ImageResults> errors, List<String> imageNames, CalibrationQuality quality) Creates human-readable text with metrics that indicate calibration qualitycomputeQualityText
(List<String> imageNames) void
configure
(boolean assumeZeroSkew, Zhang99Camera camera) Specifies the calibration model.void
configureKannalaBrandt
(boolean assumeZeroSkew, int numSymmetric, int numAsymmetric) void
configurePinhole
(boolean assumeZeroSkew, int numRadialParam, boolean includeTangential) void
configureUniversalOmni
(boolean assumeZeroSkew, int numRadialParam, boolean includeTangential) void
configureUniversalOmni
(boolean assumeZeroSkew, int numRadialParam, boolean includeTangential, double mirrorOffset) <T extends CameraModel>
TgetTargetToView
(int viewIdx) Returns estimated transform from calibration target to camera viewvoid
initialize
(int width, int height, List<Point2D_F64> layout) Resets internal data structures.boolean
isExpectedShape
(int width, int height) Convience function which returns true if the provided shape matches the expected image shapestatic void
printErrors
(List<ImageResults> results, PrintStream out) Prints out error information to standard out<T extends CameraModel>
Tprocess()
After calibration points have been found this invokes the Zhang99 algorithm to estimate calibration parameters.void
Removes the most recently added imagevoid
setRobust
(boolean robust) void
setVerbose
(@Nullable PrintStream out, @Nullable Set<String> configuration)
-
Field Details
-
detector
-
layout
-
zhang99
computes calibration parameters -
structure
-
foundIntrinsic
-
observations
-
errors
-
verbose
-
-
Constructor Details
-
CalibrateMonoPlanar
public CalibrateMonoPlanar()
-
-
Method Details
-
initialize
Resets internal data structures. Must call before adding images- Parameters:
width
- Image widthheight
- Image height
-
configure
Specifies the calibration model. -
configurePinhole
public void configurePinhole(boolean assumeZeroSkew, int numRadialParam, boolean includeTangential) -
configureUniversalOmni
public void configureUniversalOmni(boolean assumeZeroSkew, int numRadialParam, boolean includeTangential) -
configureKannalaBrandt
public void configureKannalaBrandt(boolean assumeZeroSkew, int numSymmetric, int numAsymmetric) -
configureUniversalOmni
public void configureUniversalOmni(boolean assumeZeroSkew, int numRadialParam, boolean includeTangential, double mirrorOffset) -
isExpectedShape
public boolean isExpectedShape(int width, int height) Convience function which returns true if the provided shape matches the expected image shape -
addImage
Adds the observations from a calibration target detector- Parameters:
observation
- Detected calibration points
-
removeLatestImage
public void removeLatestImage()Removes the most recently added image -
process
After calibration points have been found this invokes the Zhang99 algorithm to estimate calibration parameters. Error statistics are also computed. -
getTargetToView
Returns estimated transform from calibration target to camera view -
computeQualityText
-
computeQualityText
public static String computeQualityText(List<ImageResults> errors, List<String> imageNames, CalibrationQuality quality) Creates human-readable text with metrics that indicate calibration quality -
computeQuality
public static void computeQuality(CameraModel intrinsic, ScoreCalibrationFill fillScorer, List<Point2D_F64> worldPoints, List<CalibrationObservation> observations, CalibrationQuality quality) Computes quality metrics to quantify how good of a job the person calibrating did- Parameters:
intrinsic
- Estimated camera model from calibrationfillScorer
- Used to compute image fill scoreworldPoints
- Known location of points in world coordinatesobservations
- Observed calibration pointsquality
- (Output) Metrics used to evaluate how good the calibration is
-
printErrors
Prints out error information to standard out -
setRobust
public void setRobust(boolean robust) -
getIntrinsic
-
setVerbose
public void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration) - Specified by:
setVerbose
in interfaceVerbosePrint
-