Calico
A visual-inertial calibration library designed for rapid problem construction and debugging.
Enumerations | Functions
calico::utils Namespace Reference

Utils namespace. More...

Enumerations

enum class  LossFunctionType : int { kNone , kHuber , kCauchy }
 

Functions

ceres::LossFunction * CreateLossFunction (LossFunctionType loss, double scale)
 
int AddPoseToProblem (ceres::Problem &problem, Pose3d &pose)
 
void SetPoseConstantInProblem (ceres::Problem &problem, Pose3d &pose)
 
Tuple[np.ndarray, np.ndarray, np.ndarray] ComputeRmseHeatmapAndFeatureCount (List[Tuple[calico.CameraMeasurement, np.ndarray]] measurement_residual_pairs, int image_width, int image_height, int num_rows=8, int num_cols=12)
 
np.ndarray DrawDetections (np.ndarray img, Dict[int, np.ndarray] detections)
 
List[calico.CameraMeasurement] DetectionsToCameraMeasurements (Dict[int, np.ndarray] detections, float stamp, int seq)
 
Tuple[np.ndarray, List[np.ndarray], List[np.ndarray]] InitializePinholeAndPoses (List[Dict[int, np.ndarray]] all_detections, Dict[int, np.ndarray] model_definition)
 

Detailed Description

Utils namespace.

@package Python utils
Utility functions for calico python bindings.

Enumeration Type Documentation

◆ LossFunctionType

LossFunctionType. For more information, visit the Ceres Solver documentation page on loss functions

Enumerator
kNone 

Standard least-squares.

kHuber 

Huber loss.

kCauchy 

Cauchy loss.

Function Documentation

◆ AddPoseToProblem()

int calico::utils::AddPoseToProblem ( ceres::Problem &  problem,
Pose3d pose 
)
inline

Convenience function for adding a Pose3d type to a ceres problem with correct parameterization and manifold specification.

◆ ComputeRmseHeatmapAndFeatureCount()

Tuple[np.ndarray, np.ndarray, np.ndarray] calico.utils.ComputeRmseHeatmapAndFeatureCount ( List[Tuple[calico.CameraMeasurement, np.ndarray]]  measurement_residual_pairs,
int  image_width,
int  image_height,
int   num_rows = 8,
int   num_cols = 12 
)
 Compute the RMSE heatmap with specified resolution.

Args:
  measurement_residual_pairs:
    List of camera measurements paired with their residuals.
  image_width:
    Width of the original image.
  image_height:
    Height of the original image.
  num_rows:
    Number of rows we want to divide the image into.
  num_cols:
    Number of columns we want to divide the image into.

Returns:
  A tuple containing:
    1. An rmse heatmap image with dimensions image_width x image_height.
    2. A binned version of the RMSE heatmap as a num_rows x num_cols array.
    3. A num_rows x num_cols array representing the number of features detected
       in a particular region of the image space.

◆ CreateLossFunction()

ceres::LossFunction* calico::utils::CreateLossFunction ( LossFunctionType  loss,
double  scale 
)
inline

Convenience function for allocating a ceres::LossFunction object of of specified type and scale. For more information, visit the Ceres Solver documentation page on loss functions

◆ DetectionsToCameraMeasurements()

List[calico.CameraMeasurement] calico.utils.DetectionsToCameraMeasurements ( Dict[int, np.ndarray]  detections,
float  stamp,
int  seq 
)
Convenience function for converting a calibration chart detection into
camera measurement types.

◆ DrawDetections()

np.ndarray calico.utils.DrawDetections ( np.ndarray  img,
Dict[int, np.ndarray]   detections 
)
Small helper function for drawing detections onto the original image.

Args:
  img: Original grayscale image.
  detections: Dictionary mapping feature id to its pixel location.

Returns:
  Color image with detections drawn.

◆ InitializePinholeAndPoses()

Tuple[np.ndarray, List[np.ndarray], List[np.ndarray]] calico.utils.InitializePinholeAndPoses ( List[Dict[int, np.ndarray]]  all_detections,
Dict[int, np.ndarray]   model_definition 
)
Implements Zhang's pinhole estimation algorithm.
https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr98-71.pdf
For convenience, we also return the pose of the camera w.r.t. the calibration
chart.

Args:
  measurements:
    List of calibration chart detections where each list element represents
    detections for one image frame.
  model_definition:
    Dictionary mapping feature ID of a calibration chart to its metric
    coordinate resolved in the chart's frame.

Returns:
  intrinsics:
    Pinhole parameters as a 5-vector in the order [fx, fy, s, cx, cy] such that
    K = [fx  s cx]
        [ 0 fy cy]
        [ 0  0  1]
  R_chart_camera:
    List of 3x3 

◆ SetPoseConstantInProblem()

void calico::utils::SetPoseConstantInProblem ( ceres::Problem &  problem,
Pose3d pose 
)
inline

Convenience function for setting a Pose3d object parameters constant within a ceres problem.