Skip to content

Namespace libCalibGeom

Enums

InitializationMethod

InitializationMethod

Method for camera initialization from detections.

Values:

ZHANGZhang's method (planar targets).
VANISHING_POINTSVanishing points method (planar targets).
FISHEYEFisheye method (planar targets).
TSAITsai's method (3D targets).
OCAMCALIBOCamCalib-oriented initialization (omni models).

RobustifierType

RobustifierType

Type of robust cost function to use in optimization.

Values:

NONENo robustification (squared error).
HUBER_NORMHuber loss function.

TargetGeometry

TargetGeometry

Geometry of the calibration target optimization.

Values:

STATICTarget geometry is fixed and known.
DATUMPOINTSOptimizes target points relative to datum points.
BESTFITOptimizes all target points (requires gauge fix).

TargetPolarity

TargetPolarity

Expected contrast of circles in the image.

Values:

DARKDark print on bright background.
BRIGHTBright print on dark background.

ArucoDictionary

ArucoDictionary

Supported ArUco dictionaries.

Values:

DICT_4X4
DICT_5X5
DICT_6X6
DICT_7X7
DICT_ARUCO_ORIGINAL
DICT_APRILTAG_16h5
DICT_APRILTAG_25h9
DICT_APRILTAG_36h10
DICT_APRILTAG_36h11

CameraModelType

CameraModelType

Values:

ENTRY
Count

ParameterState

ParameterState

Values:

FREE
FIXED
DISABLED

PatternType

PatternType

Calibration target pattern family.

Values:

CHECKERBOARD
CHECKERBOARD_MARKER
CHARUCO
CALIBOARD_DC
CALIBOARD_CC
CALIBOARD_CR
CIRCLES
CIRCLES_ASYMMETRIC
KALIBR
ARUCO_MARKER
ARUCO_TARGET
HALCON_V2
HALCON_V3
UNKNOWN

Typedefs

CameraModelConfigValue

CameraModelConfigValue

Value used to configure camera model construction.

std::variant< bool, std::int64_t, double, std::string >

CameraModelConfig

CameraModelConfig

Named values used to configure camera model construction.

std::map< std::string, CameraModelConfigValue >

OptionalSettings

OptionalSettings

Map of optional settings by name.

Values are stored as strings and parsed on demand with getOption().

Saddle growth detectors accept candidateDetector ("sector", "ring" or "polynomial"). Defaults are "sector" for checkerboards and "polynomial" for Deltille. Each method has independent candidate controls. Sector controls: sectorRadius: measurement-support radius in pixels (default 3). sectorMinimumEnergy: minimum sector energy in grayscale units (default 10 for checkerboards, 20 for Deltille). Checkerboards use E = |k2| / 2. Deltille uses E = sqrt(A^2 - |k1|^2), where A is the recovered sector amplitude and k1, k2 are angular jump moments. sectorMinimumScore: minimum local saddle-quality score (default 0.30, range [0, 1]). The same energy and score thresholds apply at every pyramid level, without normalization to image or level maxima. Checkerboards use geometry q = 1 - |k4|^2 / (4 |k2|^2), where k4 is the fourth angular jump moment; Deltille uses q = E^2 / A^2. Both subtract V_wrong / (V - V_wrong) and a normalized gradient penalty. V is local intensity variance; V_wrong is measured directly from opposite pixels: odd-component variance for checkerboards, centered even-component variance for Deltille. Both topologies localize response peaks and recover boundary directions from direct sector moments, without a polynomial intensity fit. Checkerboards additionally require four significant bright/dark transitions around the localized junction at the support radius. This sampled topology check can reject unresolved narrow sectors as well as six-sector patches. These are rotation/photometric invariants of the ideal sector model, not affine invariants; sampling, blur and finite support affect them. sectorScaleFactor: pyramid downsampling factor (default 2). sectorGradientPenalty: dimensionless gradient-energy penalty weight (default 0.25). Deltille removes the gradient intrinsic to skewed sectors before applying this penalty. sectorMaxLevels: maximum pyramid levels (default 5). sectorMaximumCovariance: maximum propagated unit-noise position-covariance eigenvalue in base-image pixels squared (default 0.25). Base-image noise sigma is fixed at 1 grayscale unit for all images, rather than estimated per image. Covariance is a common relative reference, not physical uncertainty; a shared actual noise sigma scales it by sigma squared. Cross-scale duplicate ranking additionally accounts for noise-corrected two-intensity sector-template mismatch. Its noise correction is conditional on the recovered lines and center, and does not propagate their estimation error; this approximate estimate is not part of the covariance gate. sectorMaxCandidates: candidate cap after cross-scale deduplication (default 8192); non-positive values leave the count unlimited. The former polynomial-assisted sector detector is now "sector" with sector* settings and testbed SECTOR_* environment controls. Checkerboard score/energy, localization, covariance and direction estimates now use the four-sector model; old tuned thresholds need recalibration. Direct opposite-pixel penalties and gradient measurements also change sector scores relative to the former cubic-assisted implementation; settings and defaults are unchanged, but tuned thresholds may need recalibration.

The new "polynomial" method is a different, two-pass detector. It proposes Shi-Tomasi corners on a Gaussian pyramid, then fits a Tukey-weighted cubic on a sparsely sampled, structure-tensor-adapted ellipse at each proposal. Checkerboards require c4^2 - 4 c3 c5 > tau_s. Deltille requires (c6-c8)^2 + (c7-c9)^2 > tau_s and three distinct real cubic zero lines. Deltille also requires E3/(E3+E1) >= polynomialMinimumThreeFoldScore. E3 is the weighted three-fold energy; E1 includes both fitted linear terms and the cubic first harmonic, including their cross-terms. The energies are evaluated directly as Tukey-weighted squared components over the logical patch. There is no BOTH mode: the requested board topology chooses the check. polynomialRadius: logical WLS radius (default 3 for checkerboards, 5 for Deltille; range [3,8]). polynomialTensorRadius: tensor integration radius (default 2 for checkerboards, 4 for Deltille; range [1,32]); gradients use 3x3 Sobel / 8, and tensor components use Gaussian sigma 1.5. polynomialCornerThreshold: tau_c, the minimum Shi-Tomasi eigenvalue (default 25, non-negative, squared grayscale units per level pixel squared). polynomialSaddleThreshold: tau_s, the absolute discriminant/harmonic-energy threshold (default 1 for checkerboards, 3 for Deltille; non-negative). It depends on contrast, radius and topology; it is not interchangeable with sectorMinimumScore. polynomialMinimumThreeFoldScore: minimum Deltille E3/(E3+E1) (default 0.5, range [0,1]); ignored for checkerboards. The ratio is rotation/contrast-invariant in the ideal model, but does not measure even-order contamination; sampling and imperfect adaptation affect it. polynomialScaleFactor: downsampling factor (default 2, range [1.2,4]). polynomialMaxLevels: maximum pyramid levels (default 5, minimum 1). polynomialMaxCandidates: final candidate cap (default 8192); non-positive values leave the count unlimited. Strict NMS compares all available spatial/scale neighbors. Interior peaks use 3D Taylor refinement; endpoints use 2D refinement. Sampling and directions both use det(mu)^(1/4) mu^(-1/2), with support scaled by s^dk. Base positions preserve level-k resize factors and pixel centers, rather than multiplying coordinates by s^(k+dk). Returned radii are area-equivalent base-image radii. Deltille scores are E3/(E3+E1), without corner/energy confidence blending. Checkerboard scores remain C/(C+tau_c) * D/(D+tau_s); a zero threshold substitutes 1 in its denominator. The absolute coefficient-energy gates are unchanged. Cross-scale duplicate suppression keeps the highest score before applying the candidate cap. Debug response maps show only the corner term, and seeds are refined corner proposals before polynomial verification. Polynomial candidates currently have no covariance estimate. Inverse(mu) is not exact covariance for this localizer. One-shot tensor adaptation does not guarantee affine/projective invariance or unbiased junction localization. Testbeds accept CANDIDATE_DETECTOR=polynomial and the corresponding POLYNOMIAL_* controls. Previously removed threshold, gradient and covariance controls remain errors, not aliases. Older polynomial settings must not be reused as though this were the former sector detector.

Ring-only controls use the ring prefix, including ringSeedCountMaximum (default 8192), ringRefinementRadius (default 7), ringRefinementMinimumScore (default 0.95 for checkerboards, 0.90 for Deltille), and ringRefinementMinimumContrast (default 50). Neural saddle candidates use the same ring direction/refinement settings. The older seedCountMaximum, refinementRadius, refinementMinimumScore, and refinementMinimumContrast keys remain aliases; prefixed keys take precedence when both forms are present.

std::map< std::string, std::string >

Image1i

Image1i

Image< int32_t >

Image1b

Image1b

Image< uint8_t >

Image3b

Image3b

Image< std::array< uint8_t, 3 > >

Image1f

Image1f

Image< float >

Image1d

Image1d

Image< double >

Variables

TargetPolarities

const std::map< TargetPolarity, std::string >TargetPolarities

String names for TargetPolarity values (used for serialization).

ArucoDictionaries

const std::map< ArucoDictionary, std::string >ArucoDictionaries

No documentation provided.

PatternTypes

const std::map< PatternType, std::string >PatternTypes

String names for PatternType values.

Functions

findBarcodePatternConfiguration()

boolfindBarcodePatternConfiguration(const Image< uint8_t > & image,BarcodePatternConfiguration & configuration)

Decodes a board configuration barcode from an image.

The function returns true only if a valid barcode configuration is found.

Parameters:

imageInput grayscale image.
configurationDecoded target configuration.

Returns:

boolTrue if one barcode was found and decoded.

setOptimizationCancellationCallback()

voidsetOptimizationCancellationCallback(std::function< bool()> checkCancel)

Returns:

void

isOptimizationCanceled()

boolisOptimizationCanceled()

Returns:

bool

covarSaddlePoint()

voidcovarSaddlePoint(const Image< uint8_t > & image,const std::vector< Point2 > & saddlePoints,std::vector< PixelCovariance > & covars)

Estimates the covariances of detected saddle points.

Parameters:

imageThe image containing the saddle points.
saddlePointsThe detected saddle point locations.
covarsVector to store the estimated covariances.

Returns:

voidNo return value.

getOption()

intgetOption(const OptionalSettings & settings,const std::string & key,int defaultValue)

Reads a typed optional setting by name.

Returns defaultValue when the key is absent or its stored text cannot be parsed as the requested type. The TargetPolarity overload accepts the symbolic names in TargetPolarities (e.g. "DARK"/"BRIGHT").

Returns:

int

getOption()

doublegetOption(const OptionalSettings & settings,const std::string & key,double defaultValue)

Returns:

double

getOption()

boolgetOption(const OptionalSettings & settings,const std::string & key,bool defaultValue)

Returns:

bool

getOption()

TargetPolaritygetOption(const OptionalSettings & settings,const std::string & key,TargetPolarity defaultValue)

Returns:

TargetPolarity

findSymmetricCirclesGrid()

boolfindSymmetricCirclesGrid(const Image< uint8_t > & image,const PatternSize & size,const TargetPolarity contrast,std::vector< Point2 > & circleCenters,std::vector< double > & circleRadii,const OptionalSettings & optSettings = OptionalSettings(),NeuralNet * neuralNet = nullptr)

Finds a symmetric circles grid.

No subpixel circle fitting is performed.

Parameters:

imageThe source image.
sizeSize of the grid pattern.
contrastExpected contrast of the circles.
circleCentersDetected centers of the circles.
circleRadiiEstimated radii of the circles.
optSettingsOptional detector settings. compatibility (bool, default false) uses the established fallback detector implementation.
neuralNetOptional loaded neural network for candidate detection.

Returns:

boolTrue if the grid was found.

findAsymmetricCirclesGrid()

boolfindAsymmetricCirclesGrid(const Image< uint8_t > & image,const PatternSize & size,const TargetPolarity contrast,std::vector< Point2 > & circleCenters,std::vector< double > & circleRadii,const OptionalSettings & optSettings = OptionalSettings(),NeuralNet * neuralNet = nullptr)

Finds an asymmetric circles grid.

No subpixel circle fitting is performed.

Parameters:

imageThe source image.
sizeSize of the grid pattern.
contrastExpected contrast of the circles.
circleCentersDetected centers of the circles.
circleRadiiEstimated radii of the circles.
optSettingsOptional detector settings. compatibility (bool, default false) uses the established fallback detector implementation.
neuralNetOptional loaded neural network for candidate detection.

Returns:

boolTrue if the grid was found.

findPartialCirclesGrid()

boolfindPartialCirclesGrid(const Image< uint8_t > & image,const TargetPolarity contrast,const double circleSpacing,std::vector< Point2 > & q,std::vector< Point3 > & Q,std::vector< double > & circleRadii)

Finds a partial circles grid.

The grid has to be regular, but parts of it may be obscured or outside the FOV. No subpixel circle fitting is performed.

Parameters:

imageThe source image.
contrastExpected contrast of the circles.
circleSpacingPhysical spacing between circles (for scale).
qDetected 2D centers.
QCorresponding 3D object points.
circleRadiiEstimated radii.

Returns:

boolTrue if a grid was found.

findCaliboardDCs()

boolfindCaliboardDCs(const Image< uint8_t > & image,const PatternSize & size,std::vector< std::vector< Point2 >> & featurePoints,std::vector< std::vector< size_t >> & featureIds,const std::vector< int > & boardIds,const OptionalSettings & optSettings = OptionalSettings(),NeuralNet * neuralNet = nullptr)

Finds one or more Caliboard DC (delta circles) boards.

Parameters:

imageThe source image.
sizeSize of the grid pattern (rows x columns).
featurePointsDetected feature points for each matched board.
featureIdsCanonical feature-point IDs for each matched board.
boardIdsPermissible board IDs for matching.
optSettingsOptional detector settings. Supported optional settings: allowPartial (bool, default true): accept partial matched grids. polarity (int, default 0 = [TargetPolarity::DARK](index.md#a00065_1a8f22a31a6979a3a13c43ed9ae295a846aacaef50d33fc86532c260a045c672f3e)).
neuralNetOptional loaded neural network for candidate detection.

Returns:

boolTrue if one or more boards were found.

createCaliboardDCObjectPoints()

std::vector< Point3 >createCaliboardDCObjectPoints(const PatternSize & size,double spacing)

Creates object points for a Caliboard DC (delta circles) board.

Points are ordered by canonical feature ID in a triangular lattice. spacing is the center-to-center distance between adjacent features.

Parameters:

sizeSize of the grid pattern (rows x columns).
spacingPhysical center-to-center feature spacing.

Returns:

std::vector< Point3 >Ordered 3D object points on the \(z=0\) plane.

findCaliboardDC()

boolfindCaliboardDC(const Image< uint8_t > & image,const PatternSize & size,std::vector< Point2 > & featurePoints,std::vector< double > & featureRadii,std::vector< size_t > & featureIds,const int boardId = 0,const OptionalSettings & optSettings = OptionalSettings(),NeuralNet * neuralNet = nullptr)

Finds a single Caliboard DC (delta circles) board.

Parameters:

imageThe source image.
sizeSize of the grid pattern (rows x columns).
featurePointsDetected feature points.
featureRadiiEstimated feature radii.
featureIdsCanonical feature-point IDs.
boardIdExpected board ID.
optSettingsOptional detector settings.
neuralNetOptional loaded neural network for candidate detection.

Returns:

boolTrue if exactly one matching board was found.

findCaliboardCC()

boolfindCaliboardCC(const Image< uint8_t > & image,const PatternSize & size,std::vector< Point2 > & featurePoints,std::vector< double > & featureRadii,std::vector< size_t > & featureIds,int boardId = 0,const OptionalSettings & optSettings = OptionalSettings(),NeuralNet * neuralNet = nullptr)

Finds a Caliboard CC (coded circles board).

The board is a triangular circle lattice with two circle radii. The radius symbols use the Caliboard board-ID encoding for the requested size.

Parameters:

imageThe source image.
sizeSize of the circle grid pattern (rows x columns).
featurePointsDetected circle centers.
featureRadiiDetected circle radii.
featureIdsCanonical feature-point IDs.
boardIdExpected board ID.
optSettingsOptional detector settings. polarity selects dark or bright circles and allowPartial accepts incomplete boards.
neuralNetOptional loaded neural network for candidate detection.

Returns:

boolTrue if exactly one matching board was found.

createCaliboardCCObjectPoints()

std::vector< Point3 >createCaliboardCCObjectPoints(const PatternSize & size,double spacing)

Creates object points for a Caliboard CC (coded circles) board.

Points are ordered by canonical feature ID in a triangular lattice. spacing is the center-to-center distance between adjacent features.

Parameters:

sizeSize of the grid pattern (rows x columns).
spacingPhysical center-to-center feature spacing.

Returns:

std::vector< Point3 >Ordered 3D object points on the \(z=0\) plane.

findCheckerBoard()

boolfindCheckerBoard(const Image< uint8_t > & image,const PatternSize & size,std::vector< Point2 > & saddlePoints,const OptionalSettings & optSettings = OptionalSettings(),NeuralNet * neuralNet = nullptr)

Finds a checkerboard pattern.

No saddle-point subpixel refinement is performed. Input must be 8bit grayscale.

Parameters:

imageThe source image.
sizeSize of the checkerboard (internal corners).
saddlePointsDetected saddle points (corners).
optSettingsOptional detector settings. compatibility (bool, default false) uses the established fallback detector implementation.
neuralNetOptional loaded neural network for candidate detection.

Returns:

boolTrue if the checkerboard was found.

findCheckerBoardMarker()

boolfindCheckerBoardMarker(const Image< uint8_t > & image,const PatternSize & size,const int markerRow,const int markerCol,std::vector< Point2 > & saddlePoints,std::vector< size_t > & ids,const OptionalSettings & optSettings = OptionalSettings())

Finds a checkerboard with a central marker.

No saddle-point subpixel refinement is performed. Input must be 8bit grayscale.

Parameters:

imageThe source image.
sizeSize of the checkerboard.
markerRowRow index of the marker.
markerColColumn index of the marker.
saddlePointsDetected saddle points.
idsIDs of the points (if applicable).
optSettingsOptional detector settings.

Returns:

boolTrue if the board was found.

findChAruCoBoard()

boolfindChAruCoBoard(const Image< uint8_t > & image,const PatternSize & size,std::vector< Point2 > & saddlePoints,std::vector< size_t > & ids,const ArucoDictionary dictionary = ArucoDictionary::DICT_5X5,const int firstId = 0,const double markerSize = 7.0/9.0,const OptionalSettings & optSettings = OptionalSettings(),NeuralNet * neuralNet = nullptr)

Finds a ChAruCo board.

No saddle-point subpixel refinement is performed. Calib.io ChAruCo boards have dictionary DICT_5X5_1000 by default.

Parameters:

imageThe source image.
sizeSize of the board.
saddlePointsDetected saddle points (corners).
idsIDs of the detected corners.
dictionaryThe ArUco dictionary to use.
firstIdFirst ArUco ID on the board.
markerSizeRelative marker size with respect to checker size.
optSettingsOptional detector settings. Partial checkerboard growth and partial final grids (up to size) are always accepted. compatibility (bool, default false) uses the established fallback detector implementation.
neuralNetOptional loaded neural network for candidate detection.

Returns:

boolTrue if the board was found.

findChAruCoBoards()

boolfindChAruCoBoards(const Image< uint8_t > & image,const PatternSize & size,std::vector< std::vector< Point2 >> & saddlePoints,std::vector< std::vector< size_t >> & ids,const ArucoDictionary dictionary = ArucoDictionary::DICT_5X5,const std::vector< int > firstIds = std::vector< int >(),const double markerSize = 7.0/9.0,const OptionalSettings & optSettings = OptionalSettings(),NeuralNet * neuralNet = nullptr)

Finds multiple ChAruCo boards in a single image.

No saddle-point subpixel refinement is performed. Calib.io ChAruCo boards use dictionary DICT_5X5_1000 by default. This function is typically faster and more accurate than calling findChAruCoBoard() repeatedly.

Parameters:

imageThe source image.
sizeSize of each ChAruCo board.
saddlePointsDetected saddle points for each board.
idsDetected corner IDs for each board.
dictionaryThe ArUco dictionary to use.
firstIdsFirst ArUco ID for each board to detect.
markerSizeRelative marker size with respect to checker size.
optSettingsOptional detector settings. Partial checkerboard growth and partial final grids (up to size) are always accepted. compatibility (bool, default false) uses the established fallback detector implementation.
neuralNetOptional loaded neural network for candidate detection.

Returns:

boolTrue if one or more boards were found.

findAruCoTargets()

boolfindAruCoTargets(const Image< uint8_t > & image,std::vector< std::vector< Point2 >> & saddlePoints,std::vector< size_t > & ids,const ArucoDictionary dictionary = ArucoDictionary::DICT_5X5,const OptionalSettings & optSettings = OptionalSettings())

Finds Calib.io ArUco-based coded targets.

Each target consists of a regular ArUco marker surrounded by four saddle points. No saddle-point subpixel refinement is performed.

Parameters:

imageThe source image.
saddlePointsDetected saddle points per target.
idsDetected marker IDs.
dictionaryThe ArUco dictionary to use.
optSettingsOptional detector settings.

Returns:

boolTrue if one or more coded targets were found.

findAruCoMarkers()

boolfindAruCoMarkers(const Image< uint8_t > & image,std::vector< std::vector< Point2 >> & corners,std::vector< size_t > & ids,const ArucoDictionary dictionary = ArucoDictionary::DICT_5X5,const OptionalSettings & optSettings = OptionalSettings())

Finds standard ArUco markers.

No saddle-point subpixel refinement is performed.

Parameters:

imageThe source image.
cornersDetected marker corners per marker.
idsDetected marker IDs.
dictionaryThe ArUco dictionary to use.
optSettingsOptional detector settings.

Returns:

boolTrue if one or more markers were found.

createKalibrTargetObjectPoints()

std::vector< Point3 >createKalibrTargetObjectPoints(const int rows,const int cols,const double tagSize,const double tagSpacing)

Creates object points for a Kalibr-style Aprilgrid.

tagSize is the edge length of the coded AprilTag square. tagSpacing is the ratio of the spacing square to tagSize.

Point ordering (example 2x2 grid): 12--13 14--15 | TAG 3 | | TAG 4 | 8----9 10--11 4----5 6----7 y | TAG 1 | | TAG 2 | ^ 0----1 2----3 |-->x

Parameters:

rowsNumber of tag rows.
colsNumber of tag columns.
tagSizeEdge length of one tag square.
tagSpacingRelative spacing ratio between tags.

Returns:

std::vector< Point3 >Ordered 3D object points for all Kalibr target tag corners.

findKalibrTarget()

boolfindKalibrTarget(const Image< uint8_t > & image,const PatternSize & size,std::vector< Point2 > & corners,std::vector< size_t > & ids,const int firstId = 0)

Find a Kalibr-style target. size refers to the number of tags in x and y. Each tag has four feature points/corners.

Returns:

bool

find3DCirclesTarget()

boolfind3DCirclesTarget(const Image< uint8_t > & image,const std::vector< Point3 > & objectPoints,const std::vector< size_t > & markerIds,const double & focalLength,std::vector< Point2 > & featurePoints,std::vector< size_t > & featureIds,Pose & pose)

Finds 3D circles targets such as OneShot or step targets.

Assumes bright circles on a dark background and dark marker circles.

Parameters:

imageThe source image.
objectPoints3D target points in target coordinates.
markerIdsIDs of marker circles used for indexing.
focalLengthApproximate focal length used during pose estimation.
featurePointsDetected 2D feature points.
featureIdsIDs of detected feature points.
poseEstimated target pose in camera coordinates.

Returns:

boolTrue if the target was found and pose estimation succeeded.

findLidarTarget()

boolfindLidarTarget(const PointCloud & pointCloud,const double & width,const double & height,std::vector< Point3 > & points,Pose & pose,const std::optional< BoundingBox > & bb = std::nullopt,const std::optional< Point3 > & anchorPoint = std::nullopt)

Finds a planar rectangular target in a lidar point cloud.

Search can be restricted to a bounding box and/or guided by an anchor point.

Parameters:

pointCloudInput lidar point cloud.
widthTarget width.
heightTarget height.
pointsInlier points associated with the detected target.
poseEstimated target pose.
bbOptional search bounding box in point cloud coordinates.
anchorPointOptional anchor point to help initialize the search.

Returns:

boolTrue if a valid target was detected.

pointsCollinear()

boolpointsCollinear(const std::vector< Point3 > & Q)

Tests whether a set of 3D points are collinear.

Useful for rejecting partial target observations that are degenerate for initialization and optimization.

Parameters:

QInput 3D points.

Returns:

boolTrue if all points are collinear.

constrainHomography()

boolconstrainHomography(const std::vector< Point2 > & a,const std::vector< Point2 > & b)

Tests whether 2D correspondences constrain a unique homography.

This is generally required for initializing partial observations with Zhang's method. It can also be used with a == b to test object point configurations alone.

Parameters:

aFirst set of 2D points.
bSecond set of corresponding 2D points.

Returns:

boolTrue if the correspondences constrain a unique homography.

disabledInitializationParameter()

ParameterReferencedisabledInitializationParameter()

Returns:

ParameterReference

initializeCameraParametersZhang()

boolinitializeCameraParametersZhang(const std::vector< std::vector< Point3 >> & worldPoints,const std::vector< std::vector< Point2 >> & imagePoints,ParameterReference f,ParameterReference ar,ParameterReference cx,ParameterReference cy,std::vector< Rotation > & Rw,std::vector< Translation > & Tw,double fScale = 1.0)

Initialize camera from planar target using Zhang's method.

Estimates camera intrinsics and extrinsics for a planar calibration target. Reference: Zhang, Z., A Flexible New Technique for Camera Calibration (2002).

Parameters:

worldPointsVector of world coordinate vectors (one vector per view).
imagePointsVector of image coordinate vectors (one vector per view).
fEstimated focal length.
arEstimated aspect ratio.
cxEstimated principal point x.
cyEstimated principal point y.
RwEstimated rotations for each view.
TwEstimated translations for each view.
fScaleOptional focal-length scaling applied during initialization.

Returns:

boolTrue if initialization succeeded.

initializeCameraParametersVanishingPoints()

boolinitializeCameraParametersVanishingPoints(const std::vector< std::vector< Point3 >> & worldPoints,const std::vector< std::vector< Point2 >> & imagePoints,const size_t imageWidth,const size_t imageHeight,ParameterReference f,ParameterReference ar,ParameterReference cx,ParameterReference cy,ParameterReference k1,std::vector< Rotation > & Rw,std::vector< Translation > & Tw,double fScale = 1.0)

Initialize camera from planar target using Vanishing Points.

This is identical to Zhang's for extrinsics estimation, but uses vanishing points for focal length estimation. Central point coordinates are assumed to be in the image center. Reference: Jean-Yves Bouguet, Camera Calibration Toolbox for Matlab.

Parameters:

worldPointsVector of world coordinate vectors.
imagePointsVector of image coordinate vectors.
imageWidthWidth of the image.
imageHeightHeight of the image.
fEstimated focal length.
arEstimated aspect ratio.
cxEstimated principal point x.
cyEstimated principal point y.
k1Estimated first radial distortion coefficient.
RwEstimated rotations.
TwEstimated translations.
fScaleOptional focal-length scaling applied during initialization.

Returns:

boolTrue if initialization succeeded.

initializeCameraParametersFisheye()

boolinitializeCameraParametersFisheye(const std::vector< std::vector< Point3 >> & worldPoints,const std::vector< std::vector< Point2 >> & imagePoints,const size_t imageWidth,const size_t imageHeight,double & f,double & ar,double & cx,double & cy,std::vector< Rotation > & Rw,std::vector< Translation > & Tw)

Initialize fisheye camera parameters.

Based on Bouguet's method for initializing the Brandt/Kannala model.

Parameters:

worldPointsVector of world coordinate vectors.
imagePointsVector of image coordinate vectors.
imageWidthWidth of the image.
imageHeightHeight of the image.
fEstimated focal length.
arEstimated aspect ratio.
cxEstimated principal point x.
cyEstimated principal point y.
RwEstimated rotations.
TwEstimated translations.

Returns:

boolTrue if initialization succeeded.

initializeCameraParametersTsai()

boolinitializeCameraParametersTsai(const std::vector< Point3 > & worldPoints,const std::vector< Point2 > & imagePoints,const int imageWidth,const int imageHeight,double & f,double & ar,double & Cx,double & Cy,double & kappa1,Rotation & Rw,Translation & Tw)

Initialize camera from 3D target using Tsai's method.

Reference: R.Y. Tsai, An Efficient and Accurate Camera Calibration Technique for 3D Machine Vision (1986).

Note that the function makes a few iterations of non-linear optimization.

Parameters:

worldPointsVector of world coordinates.
imagePointsVector of image coordinates.
imageWidthWidth of the image.
imageHeightHeight of the image.
fEstimated focal length.
arEstimated aspect ratio.
CxEstimated principal point x.
CyEstimated principal point y.
kappa1Estimated radial distortion coefficient.
RwEstimated rotation.
TwEstimated translation.

Returns:

boolTrue if initialization succeeded.

initializeCameraParametersOCamCalib()

boolinitializeCameraParametersOCamCalib(const std::vector< std::vector< Point3 >> & worldPoints,const std::vector< std::vector< Point2 >> & imagePoints,const size_t imageWidth,const size_t imageHeight,double & cx,double & cy,std::array< double, 5 > & taylorCoefficients,std::vector< Rotation > & Rw,std::vector< Translation > & Tw)

Initialize OCamCalib-like camera parameters and return full Taylor terms.

Returns the polynomial coefficients [a0, a1, a2, a3, a4] and pose estimates.

Parameters:

worldPointsVector of world coordinate vectors (one vector per view).
imagePointsVector of image coordinate vectors (one vector per view).
imageWidthWidth of the image.
imageHeightHeight of the image.
cxEstimated principal point x.
cyEstimated principal point y.
taylorCoefficientsEstimated OCamCalib polynomial coefficients.
RwEstimated rotations for each view.
TwEstimated translations for each view.

Returns:

boolTrue if initialization succeeded.

initializeCameraParametersOCamCalib()

boolinitializeCameraParametersOCamCalib(const std::vector< std::vector< Point3 >> & worldPoints,const std::vector< std::vector< Point2 >> & imagePoints,const size_t imageWidth,const size_t imageHeight,double & f,double & ar,double & cx,double & cy,std::vector< Rotation > & Rw,std::vector< Translation > & Tw)

Initialize OCamCalib-like camera parameters from planar targets.

Initializes using the full OCamCalib initializer, then finds a best fit focal length approximating the polynomial projection with a pinhole model.

Parameters:

worldPointsVector of world coordinate vectors (one vector per view).
imagePointsVector of image coordinate vectors (one vector per view).
imageWidthWidth of the image.
imageHeightHeight of the image.
fEstimated focal length.
arEstimated aspect ratio.
cxEstimated principal point x.
cyEstimated principal point y.
RwEstimated rotations for each view.
TwEstimated translations for each view.

Returns:

boolTrue if initialization succeeded.

initializeCameraParametersByMethod()

boolinitializeCameraParametersByMethod(const InitializationMethod method,const std::vector< std::vector< Point3 >> & worldPoints,const std::vector< std::vector< Point2 >> & imagePoints,const size_t imageWidth,const size_t imageHeight,ParameterReference f,ParameterReference ar,ParameterReference cx,ParameterReference cy,ParameterReference k1,std::vector< Rotation > & Rw,std::vector< Translation > & Tw,double fScale = 1.0)

Initialize camera parameters using one of the supported methods.

Shared dispatcher for model initializers.

Parameters:

methodInitialization method to use.
worldPointsVector of world coordinate vectors (one vector per view).
imagePointsVector of image coordinate vectors (one vector per view).
imageWidthWidth of the image.
imageHeightHeight of the image.
fEstimated focal length.
arEstimated aspect ratio.
cxEstimated principal point x.
cyEstimated principal point y.
k1Estimated radial distortion coefficient.
RwEstimated rotations for each view.
TwEstimated translations for each view.
fScaleOptional focal-length scaling applied during initialization.

Returns:

boolTrue if initialization succeeded.

meanRelativeRotoTranslation()

voidmeanRelativeRotoTranslation(const std::vector< Rotation > & Rwc1,const std::vector< Translation > & Twc1,const std::vector< Rotation > & Rwc2,const std::vector< Translation > & Twc2,Rotation & R,Translation & T)

Determine mean rotation and translation between two cameras.

Estimates the relative transform between two cameras based on their respective extrinsics w.r.t the target.

Parameters:

Rwc1Rotation of camera 1 from world.
Twc1Translation of camera 1 from world.
Rwc2Rotation of camera 2 from world.
Twc2Translation of camera 2 from world.
RMean relative rotation.
TMean relative translation.

Returns:

void

medianRotoTranslation()

voidmedianRotoTranslation(const std::vector< Pose > & Twc,Pose & T)

Determine the median rototranslation from a set of poses.

Parameters:

TwcVector of poses.
TResulting median pose.

Returns:

void

medianRelativeRotoTranslation()

voidmedianRelativeRotoTranslation(const std::vector< Rotation > & Rwc1,const std::vector< Translation > & Twc1,const std::vector< Rotation > & Rwc2,const std::vector< Translation > & Twc2,Rotation & R,Translation & T)

Determine the median relative rotation and translation.

Parameters:

Rwc1Rotations of camera 1.
Twc1Translations of camera 1.
Rwc2Rotations of camera 2.
Twc2Translations of camera 2.
RMedian relative rotation.
TMedian relative translation.

Returns:

void

validateLicenseWithCertificate()

boolvalidateLicenseWithCertificate(const std::string & licenseCertificate)

Validates license from a signed entitlement certificate.

This certificate is a compact Calib.io-issued entitlement string that can be embedded directly in application code and validated fully offline.

This function must be called before using any other libCalibGeom API functions.

Parameters:

licenseCertificateCompact signed entitlement certificate.

Returns:

boolTrue if license is valid, false otherwise.

validateLicenseWithCertificate()

boolvalidateLicenseWithCertificate()

Validates license using the LIBCALIBGEOM_LICENSE_CERTIFICATE environment variable.

This function must be called before using any other libCalibGeom API functions.

Returns:

boolTrue if license is valid, false otherwise.

subpixSaddlePointFoerstner()

voidsubpixSaddlePointFoerstner(const Image< uint8_t > & image,const int windowHalfWidth,std::vector< Point2 > & saddlePoints,const int maxIterations = 100)

Subpixel refinement using the Foerstner operator.

Parameters:

imageThe source image.
windowHalfWidthHalf-width of the search window.
saddlePointsLocations to refine.
maxIterationsMaximum number of iterations.

Returns:

void

subpixSaddlePointCrossing()

voidsubpixSaddlePointCrossing(const Image< uint8_t > & image,const int windowHalfWidth,std::vector< Point2 > & saddlePoints)

Subpixel refinement based on crossing lines.

Fits lines to the edges around the saddle point and finds their intersection.

Parameters:

imageThe source image.
windowHalfWidthHalf-width of the local window.
saddlePointsLocations to refine.

Returns:

void

subpixSaddlePointPolynomium()

voidsubpixSaddlePointPolynomium(const Image< uint8_t > & image,const int windowHalfWidth,std::vector< Point2 > & saddlePoints,const int maxIterations = 100)

Subpixel refinement using polynomial fitting.

Fits a two-variable polynomial to the intensity surface.

Parameters:

imageThe source image.
windowHalfWidthHalf-width of the local window.
saddlePointsLocations to refine.
maxIterationsMaximum iterations.

Returns:

void

subpixUnbiasedSymmetry()

voidsubpixUnbiasedSymmetry(const cv::Mat_< uint8_t > & image,const int windowHalfWidth,std::vector< Point2 > & saddlePoints)

Subpixel refinement using unbiased symmetry.

Recommended method for most data sets with saddle points.

Parameters:

imageThe source image.
windowHalfWidthHalf-width of the local window.
saddlePointsLocations to refine.

Returns:

void

subpixPerspectiveSymmetry()

boolsubpixPerspectiveSymmetry(const Image< uint8_t > & image,const int windowHalfWidth,const std::vector< Point3 > & objectPoints,std::vector< Point2 > & saddlePoints,const int maxIterations = 100)

Subpixel refinement using perspective symmetry.

Estimates a local homography with symmetry around the optimized location. Recommended for checkerboard saddle points.

Parameters:

imageThe source image.
windowHalfWidthHalf-width of the window.
objectPointsCorresponding 3D object points.
saddlePointsLocations to refine.
maxIterationsMaximum number of refinement iterations.

Returns:

boolTrue if successful.

subpixCircleEllipseFit()

boolsubpixCircleEllipseFit(const Image< uint8_t > & image,const std::vector< Point3 > & objectPoints,std::vector< Point2 > & circleCenters,const std::vector< double > & circleRadii,const bool perspectiveBiasCorrection = true)

A subpixel routine based on robust ellipse fitting with correction of the circle center projection.

Parameters:

imageThe source image.
objectPointsCorresponding 3D circle-center object points.
circleCentersCircle centers to refine in-place.
circleRadiiCircle radii used for robust fitting.
perspectiveBiasCorrectionWhether to correct perspective bias.

Returns:

boolTrue if refinement succeeded.

subpixCircleNonLinear()

voidsubpixCircleNonLinear(const Image< uint8_t > & image,const TargetPolarity contrast,std::vector< Point2 > & circleCenters,std::vector< double > & circleRadii,const int maxIterations = 100,const double maxRotationRad = M_PI/2,const double maxRadiusChageFactor = std::numeric_limits< double >::infinity())

Iterative subpixel routine finding the center under the weak perspective assumption. This is justified when circles radii are comparably small.

Parameters:

imageThe source image.
contrastExpected circle contrast polarity in the image.
circleCentersCircle centers to refine in-place.
circleRadiiCircle radii to refine in-place.
maxIterationsMaximum number of refinement iterations.
maxRotationRadMaximum allowed local rotation in radians.
maxRadiusChageFactorMaximum allowed multiplicative radius change.

Returns:

void