Namespace libCalibGeom¶
Enums¶
InitializationMethod¶
InitializationMethod
Method for camera initialization from detections.
Values:
ZHANG | Zhang's method (planar targets). |
VANISHING_POINTS | Vanishing points method (planar targets). |
FISHEYE | Fisheye method (planar targets). |
TSAI | Tsai's method (3D targets). |
OCAMCALIB | OCamCalib-oriented initialization (omni models). |
RobustifierType¶
RobustifierType
Type of robust cost function to use in optimization.
Values:
NONE | No robustification (squared error). |
HUBER_NORM | Huber loss function. |
TargetGeometry¶
TargetGeometry
Geometry of the calibration target optimization.
Values:
STATIC | Target geometry is fixed and known. |
DATUMPOINTS | Optimizes target points relative to datum points. |
BESTFIT | Optimizes all target points (requires gauge fix). |
TargetPolarity¶
TargetPolarity
Expected contrast of circles in the image.
Values:
DARK | Dark print on bright background. |
BRIGHT | Bright 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()¶
boolfindBarcodePatternConfigurationconst 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:
image | Input grayscale image. |
configuration | Decoded target configuration. |
Returns:
bool | True if one barcode was found and decoded. |
setOptimizationCancellationCallback()¶
voidsetOptimizationCancellationCallback
Returns:
void |
isOptimizationCanceled()¶
boolisOptimizationCanceled
Returns:
bool |
covarSaddlePoint()¶
voidcovarSaddlePointconst Image< uint8_t > & image,const std::vector< Point2 > & saddlePoints,std::vector< PixelCovariance > & covars
Estimates the covariances of detected saddle points.
Parameters:
image | The image containing the saddle points. |
saddlePoints | The detected saddle point locations. |
covars | Vector to store the estimated covariances. |
Returns:
void | No return value. |
getOption()¶
intgetOptionconst 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()¶
doublegetOptionconst OptionalSettings & settings,const std::string & key,double defaultValue
Returns:
double |
getOption()¶
boolgetOptionconst OptionalSettings & settings,const std::string & key,bool defaultValue
Returns:
bool |
getOption()¶
TargetPolaritygetOptionconst OptionalSettings & settings,const std::string & key,TargetPolarity defaultValue
Returns:
TargetPolarity |
findSymmetricCirclesGrid()¶
boolfindSymmetricCirclesGridconst 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:
image | The source image. |
size | Size of the grid pattern. |
contrast | Expected contrast of the circles. |
circleCenters | Detected centers of the circles. |
circleRadii | Estimated radii of the circles. |
optSettings | Optional detector settings. compatibility (bool, default false) uses the established fallback detector implementation. |
neuralNet | Optional loaded neural network for candidate detection. |
Returns:
bool | True if the grid was found. |
findAsymmetricCirclesGrid()¶
boolfindAsymmetricCirclesGridconst 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:
image | The source image. |
size | Size of the grid pattern. |
contrast | Expected contrast of the circles. |
circleCenters | Detected centers of the circles. |
circleRadii | Estimated radii of the circles. |
optSettings | Optional detector settings. compatibility (bool, default false) uses the established fallback detector implementation. |
neuralNet | Optional loaded neural network for candidate detection. |
Returns:
bool | True if the grid was found. |
findPartialCirclesGrid()¶
boolfindPartialCirclesGridconst 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:
image | The source image. |
contrast | Expected contrast of the circles. |
circleSpacing | Physical spacing between circles (for scale). |
q | Detected 2D centers. |
Q | Corresponding 3D object points. |
circleRadii | Estimated radii. |
Returns:
bool | True if a grid was found. |
findCaliboardDCs()¶
boolfindCaliboardDCsconst 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:
image | The source image. |
size | Size of the grid pattern (rows x columns). |
featurePoints | Detected feature points for each matched board. |
featureIds | Canonical feature-point IDs for each matched board. |
boardIds | Permissible board IDs for matching. |
optSettings | Optional detector settings. Supported optional settings: allowPartial (bool, default true): accept partial matched grids. polarity (int, default 0 = [TargetPolarity::DARK](index.md#a00065_1a8f22a31a6979a3a13c43ed9ae295a846aacaef50d33fc86532c260a045c672f3e)). |
neuralNet | Optional loaded neural network for candidate detection. |
Returns:
bool | True if one or more boards were found. |
createCaliboardDCObjectPoints()¶
std::vector< Point3 >createCaliboardDCObjectPointsconst 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:
size | Size of the grid pattern (rows x columns). |
spacing | Physical center-to-center feature spacing. |
Returns:
std::vector< Point3 > | Ordered 3D object points on the \(z=0\) plane. |
findCaliboardDC()¶
boolfindCaliboardDCconst 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:
image | The source image. |
size | Size of the grid pattern (rows x columns). |
featurePoints | Detected feature points. |
featureRadii | Estimated feature radii. |
featureIds | Canonical feature-point IDs. |
boardId | Expected board ID. |
optSettings | Optional detector settings. |
neuralNet | Optional loaded neural network for candidate detection. |
Returns:
bool | True if exactly one matching board was found. |
findCaliboardCC()¶
boolfindCaliboardCCconst 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:
image | The source image. |
size | Size of the circle grid pattern (rows x columns). |
featurePoints | Detected circle centers. |
featureRadii | Detected circle radii. |
featureIds | Canonical feature-point IDs. |
boardId | Expected board ID. |
optSettings | Optional detector settings. polarity selects dark or bright circles and allowPartial accepts incomplete boards. |
neuralNet | Optional loaded neural network for candidate detection. |
Returns:
bool | True if exactly one matching board was found. |
createCaliboardCCObjectPoints()¶
std::vector< Point3 >createCaliboardCCObjectPointsconst 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:
size | Size of the grid pattern (rows x columns). |
spacing | Physical center-to-center feature spacing. |
Returns:
std::vector< Point3 > | Ordered 3D object points on the \(z=0\) plane. |
findCheckerBoard()¶
boolfindCheckerBoardconst 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:
image | The source image. |
size | Size of the checkerboard (internal corners). |
saddlePoints | Detected saddle points (corners). |
optSettings | Optional detector settings. compatibility (bool, default false) uses the established fallback detector implementation. |
neuralNet | Optional loaded neural network for candidate detection. |
Returns:
bool | True if the checkerboard was found. |
findCheckerBoardMarker()¶
boolfindCheckerBoardMarkerconst 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:
image | The source image. |
size | Size of the checkerboard. |
markerRow | Row index of the marker. |
markerCol | Column index of the marker. |
saddlePoints | Detected saddle points. |
ids | IDs of the points (if applicable). |
optSettings | Optional detector settings. |
Returns:
bool | True if the board was found. |
findChAruCoBoard()¶
boolfindChAruCoBoardconst 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:
image | The source image. |
size | Size of the board. |
saddlePoints | Detected saddle points (corners). |
ids | IDs of the detected corners. |
dictionary | The ArUco dictionary to use. |
firstId | First ArUco ID on the board. |
markerSize | Relative marker size with respect to checker size. |
optSettings | Optional 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. |
neuralNet | Optional loaded neural network for candidate detection. |
Returns:
bool | True if the board was found. |
findChAruCoBoards()¶
boolfindChAruCoBoardsconst 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:
image | The source image. |
size | Size of each ChAruCo board. |
saddlePoints | Detected saddle points for each board. |
ids | Detected corner IDs for each board. |
dictionary | The ArUco dictionary to use. |
firstIds | First ArUco ID for each board to detect. |
markerSize | Relative marker size with respect to checker size. |
optSettings | Optional 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. |
neuralNet | Optional loaded neural network for candidate detection. |
Returns:
bool | True if one or more boards were found. |
findAruCoTargets()¶
boolfindAruCoTargetsconst 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:
image | The source image. |
saddlePoints | Detected saddle points per target. |
ids | Detected marker IDs. |
dictionary | The ArUco dictionary to use. |
optSettings | Optional detector settings. |
Returns:
bool | True if one or more coded targets were found. |
findAruCoMarkers()¶
boolfindAruCoMarkersconst 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:
image | The source image. |
corners | Detected marker corners per marker. |
ids | Detected marker IDs. |
dictionary | The ArUco dictionary to use. |
optSettings | Optional detector settings. |
Returns:
bool | True if one or more markers were found. |
createKalibrTargetObjectPoints()¶
std::vector< Point3 >createKalibrTargetObjectPointsconst 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:
rows | Number of tag rows. |
cols | Number of tag columns. |
tagSize | Edge length of one tag square. |
tagSpacing | Relative spacing ratio between tags. |
Returns:
std::vector< Point3 > | Ordered 3D object points for all Kalibr target tag corners. |
findKalibrTarget()¶
boolfindKalibrTargetconst 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()¶
boolfind3DCirclesTargetconst 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:
image | The source image. |
objectPoints | 3D target points in target coordinates. |
markerIds | IDs of marker circles used for indexing. |
focalLength | Approximate focal length used during pose estimation. |
featurePoints | Detected 2D feature points. |
featureIds | IDs of detected feature points. |
pose | Estimated target pose in camera coordinates. |
Returns:
bool | True if the target was found and pose estimation succeeded. |
findLidarTarget()¶
boolfindLidarTargetconst 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:
pointCloud | Input lidar point cloud. |
width | Target width. |
height | Target height. |
points | Inlier points associated with the detected target. |
pose | Estimated target pose. |
bb | Optional search bounding box in point cloud coordinates. |
anchorPoint | Optional anchor point to help initialize the search. |
Returns:
bool | True if a valid target was detected. |
pointsCollinear()¶
boolpointsCollinear
Tests whether a set of 3D points are collinear.
Useful for rejecting partial target observations that are degenerate for initialization and optimization.
Parameters:
Q | Input 3D points. |
Returns:
bool | True if all points are collinear. |
constrainHomography()¶
boolconstrainHomographyconst 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:
a | First set of 2D points. |
b | Second set of corresponding 2D points. |
Returns:
bool | True if the correspondences constrain a unique homography. |
disabledInitializationParameter()¶
initializeCameraParametersZhang()¶
boolinitializeCameraParametersZhangconst 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:
worldPoints | Vector of world coordinate vectors (one vector per view). |
imagePoints | Vector of image coordinate vectors (one vector per view). |
f | Estimated focal length. |
ar | Estimated aspect ratio. |
cx | Estimated principal point x. |
cy | Estimated principal point y. |
Rw | Estimated rotations for each view. |
Tw | Estimated translations for each view. |
fScale | Optional focal-length scaling applied during initialization. |
Returns:
bool | True if initialization succeeded. |
initializeCameraParametersVanishingPoints()¶
boolinitializeCameraParametersVanishingPointsconst 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:
worldPoints | Vector of world coordinate vectors. |
imagePoints | Vector of image coordinate vectors. |
imageWidth | Width of the image. |
imageHeight | Height of the image. |
f | Estimated focal length. |
ar | Estimated aspect ratio. |
cx | Estimated principal point x. |
cy | Estimated principal point y. |
k1 | Estimated first radial distortion coefficient. |
Rw | Estimated rotations. |
Tw | Estimated translations. |
fScale | Optional focal-length scaling applied during initialization. |
Returns:
bool | True if initialization succeeded. |
initializeCameraParametersFisheye()¶
boolinitializeCameraParametersFisheyeconst 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:
worldPoints | Vector of world coordinate vectors. |
imagePoints | Vector of image coordinate vectors. |
imageWidth | Width of the image. |
imageHeight | Height of the image. |
f | Estimated focal length. |
ar | Estimated aspect ratio. |
cx | Estimated principal point x. |
cy | Estimated principal point y. |
Rw | Estimated rotations. |
Tw | Estimated translations. |
Returns:
bool | True if initialization succeeded. |
initializeCameraParametersTsai()¶
boolinitializeCameraParametersTsaiconst 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:
worldPoints | Vector of world coordinates. |
imagePoints | Vector of image coordinates. |
imageWidth | Width of the image. |
imageHeight | Height of the image. |
f | Estimated focal length. |
ar | Estimated aspect ratio. |
Cx | Estimated principal point x. |
Cy | Estimated principal point y. |
kappa1 | Estimated radial distortion coefficient. |
Rw | Estimated rotation. |
Tw | Estimated translation. |
Returns:
bool | True if initialization succeeded. |
initializeCameraParametersOCamCalib()¶
boolinitializeCameraParametersOCamCalibconst 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:
worldPoints | Vector of world coordinate vectors (one vector per view). |
imagePoints | Vector of image coordinate vectors (one vector per view). |
imageWidth | Width of the image. |
imageHeight | Height of the image. |
cx | Estimated principal point x. |
cy | Estimated principal point y. |
taylorCoefficients | Estimated OCamCalib polynomial coefficients. |
Rw | Estimated rotations for each view. |
Tw | Estimated translations for each view. |
Returns:
bool | True if initialization succeeded. |
initializeCameraParametersOCamCalib()¶
boolinitializeCameraParametersOCamCalibconst 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:
worldPoints | Vector of world coordinate vectors (one vector per view). |
imagePoints | Vector of image coordinate vectors (one vector per view). |
imageWidth | Width of the image. |
imageHeight | Height of the image. |
f | Estimated focal length. |
ar | Estimated aspect ratio. |
cx | Estimated principal point x. |
cy | Estimated principal point y. |
Rw | Estimated rotations for each view. |
Tw | Estimated translations for each view. |
Returns:
bool | True if initialization succeeded. |
initializeCameraParametersByMethod()¶
boolinitializeCameraParametersByMethodconst 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:
method | Initialization method to use. |
worldPoints | Vector of world coordinate vectors (one vector per view). |
imagePoints | Vector of image coordinate vectors (one vector per view). |
imageWidth | Width of the image. |
imageHeight | Height of the image. |
f | Estimated focal length. |
ar | Estimated aspect ratio. |
cx | Estimated principal point x. |
cy | Estimated principal point y. |
k1 | Estimated radial distortion coefficient. |
Rw | Estimated rotations for each view. |
Tw | Estimated translations for each view. |
fScale | Optional focal-length scaling applied during initialization. |
Returns:
bool | True if initialization succeeded. |
meanRelativeRotoTranslation()¶
voidmeanRelativeRotoTranslationconst 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:
Rwc1 | Rotation of camera 1 from world. |
Twc1 | Translation of camera 1 from world. |
Rwc2 | Rotation of camera 2 from world. |
Twc2 | Translation of camera 2 from world. |
R | Mean relative rotation. |
T | Mean relative translation. |
Returns:
void |
medianRotoTranslation()¶
voidmedianRotoTranslationconst std::vector< Pose > & Twc,Pose & T
Determine the median rototranslation from a set of poses.
Parameters:
Twc | Vector of poses. |
T | Resulting median pose. |
Returns:
void |
medianRelativeRotoTranslation()¶
voidmedianRelativeRotoTranslationconst 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:
Rwc1 | Rotations of camera 1. |
Twc1 | Translations of camera 1. |
Rwc2 | Rotations of camera 2. |
Twc2 | Translations of camera 2. |
R | Median relative rotation. |
T | Median relative translation. |
Returns:
void |
validateLicenseWithCertificate()¶
boolvalidateLicenseWithCertificate
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:
licenseCertificate | Compact signed entitlement certificate. |
Returns:
bool | True 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:
bool | True if license is valid, false otherwise. |
subpixSaddlePointFoerstner()¶
voidsubpixSaddlePointFoerstnerconst Image< uint8_t > & image,const int windowHalfWidth,std::vector< Point2 > & saddlePoints,const int maxIterations = 100
Subpixel refinement using the Foerstner operator.
Parameters:
image | The source image. |
windowHalfWidth | Half-width of the search window. |
saddlePoints | Locations to refine. |
maxIterations | Maximum number of iterations. |
Returns:
void |
subpixSaddlePointCrossing()¶
voidsubpixSaddlePointCrossingconst 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:
image | The source image. |
windowHalfWidth | Half-width of the local window. |
saddlePoints | Locations to refine. |
Returns:
void |
subpixSaddlePointPolynomium()¶
voidsubpixSaddlePointPolynomiumconst 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:
image | The source image. |
windowHalfWidth | Half-width of the local window. |
saddlePoints | Locations to refine. |
maxIterations | Maximum iterations. |
Returns:
void |
subpixUnbiasedSymmetry()¶
voidsubpixUnbiasedSymmetryconst 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:
image | The source image. |
windowHalfWidth | Half-width of the local window. |
saddlePoints | Locations to refine. |
Returns:
void |
subpixPerspectiveSymmetry()¶
boolsubpixPerspectiveSymmetryconst 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:
image | The source image. |
windowHalfWidth | Half-width of the window. |
objectPoints | Corresponding 3D object points. |
saddlePoints | Locations to refine. |
maxIterations | Maximum number of refinement iterations. |
Returns:
bool | True if successful. |
subpixCircleEllipseFit()¶
boolsubpixCircleEllipseFitconst 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:
image | The source image. |
objectPoints | Corresponding 3D circle-center object points. |
circleCenters | Circle centers to refine in-place. |
circleRadii | Circle radii used for robust fitting. |
perspectiveBiasCorrection | Whether to correct perspective bias. |
Returns:
bool | True if refinement succeeded. |
subpixCircleNonLinear()¶
voidsubpixCircleNonLinearconst 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:
image | The source image. |
contrast | Expected circle contrast polarity in the image. |
circleCenters | Circle centers to refine in-place. |
circleRadii | Circle radii to refine in-place. |
maxIterations | Maximum number of refinement iterations. |
maxRotationRad | Maximum allowed local rotation in radians. |
maxRadiusChageFactor | Maximum allowed multiplicative radius change. |
Returns:
void |