Ocean
Loading...
Searching...
No Matches
Ocean::CV::Calibration::Utilities Class Reference

This class implements utility functions for calibration. More...

#include <Utilities.h>

Static Public Member Functions

static bool paintCalibrationBoardOutline (Frame &frame, const AnyCamera &camera, const HomogenousMatrix4 &board_T_camera, const MetricCalibrationBoard &calibrationBoard, const uint8_t *color, const unsigned int thickness=1u)
 Paints the outline of a calibration board.
 
static bool paintCalibrationBoardObservation (Frame &frame, const MetricCalibrationBoard &calibrationBoard, const CalibrationBoardObservation &calibrationBoardObservation, const bool drawCorrespondences)
 Paints the observation information of a calibration board.
 
static Frame visualizeDistortionGrid (const AnyCamera &camera, const unsigned int horizontalBins, const unsigned int verticalBins, const bool undistort, Worker *worker=nullptr)
 Visualizes the distortion of a camera with a grid.
 
static Frame visualizeDistortionVectors (const AnyCamera &camera, const unsigned int horizontalBins, const unsigned int verticalBins)
 Visualizes the distortion of a camera with displacement vectors.
 
static bool parseCalibrationBoard (const std::string &calibrationBoardType, CalibrationBoard &calibrationBoard)
 Parses the type of a calibration board from a string.
 
static bool parseMarkerDimension (const std::string &markerDimension, int32_t &horizontalMarkers, int32_t &verticalMarkers)
 Parses the marker dimension from a string.
 
static CalibrationBoard createBoardForPaper (const MetricSize::PaperType paperType, const unsigned int id, MetricSize *paperWidth=nullptr, MetricSize *paperHeight=nullptr)
 Returns an ideal calibration board for a specific paper type.
 

Detailed Description

This class implements utility functions for calibration.

Member Function Documentation

◆ createBoardForPaper()

static CalibrationBoard Ocean::CV::Calibration::Utilities::createBoardForPaper ( const MetricSize::PaperType  paperType,
const unsigned int  id,
MetricSize paperWidth = nullptr,
MetricSize paperHeight = nullptr 
)
static

Returns an ideal calibration board for a specific paper type.

Parameters
paperTypeThe type of the paper to be used, must be valid
idThe id of the calibration board, with range [0, infinity)
paperWidthOptional resulting width of the paper, nullptr if not of interest
paperHeightOptional resulting height of the paper, nullptr if not of interest
Returns
The calibration board optimized for the specified paper type, invalid if the calibration board could not be created

◆ paintCalibrationBoardObservation()

static bool Ocean::CV::Calibration::Utilities::paintCalibrationBoardObservation ( Frame frame,
const MetricCalibrationBoard calibrationBoard,
const CalibrationBoardObservation calibrationBoardObservation,
const bool  drawCorrespondences 
)
static

Paints the observation information of a calibration board.

Parameters
frameThe frame to which the observation information will be painted, must be valid
calibrationBoardThe calibration board for which the observation information will be painted, must be valid
calibrationBoardObservationThe observation information of the calibration board, must be valid
drawCorrespondencesTrue to draw the 2D/3D correspondences of the observation; False, to draw the projected 3D object points of all visible marker points
Returns
True, if succeeded

◆ paintCalibrationBoardOutline()

static bool Ocean::CV::Calibration::Utilities::paintCalibrationBoardOutline ( Frame frame,
const AnyCamera camera,
const HomogenousMatrix4 board_T_camera,
const MetricCalibrationBoard calibrationBoard,
const uint8_t *  color,
const unsigned int  thickness = 1u 
)
static

Paints the outline of a calibration board.

Parameters
frameThe frame to which the outline will be painted, must be valid
cameraThe camera profile defining the projection, must be valid
board_T_cameraThe camera pose transforming camera to board, with default camera looking towards the negative z-space with y-axis upwards, must be valid
calibrationBoardThe calibration board for which the outline will be painted, must be valid
colorThe color of the outline, must be valid
thicknessThe thickness of the outline, possible values are {1, 3, 5, 7}
Returns
True, if succeeded

◆ parseCalibrationBoard()

static bool Ocean::CV::Calibration::Utilities::parseCalibrationBoard ( const std::string &  calibrationBoardType,
CalibrationBoard calibrationBoard 
)
static

Parses the type of a calibration board from a string.

The string must have the format 'calibrationBoard_<Id>_<HorizontalMarkers>x<VerticalMarkers> - e.g., 'calibrationBoard_0_8x13'

Parameters
calibrationBoardTypeThe string with the calibration board type to parse
calibrationBoardThe resulting calibration board
Returns
True, if succeeded

◆ parseMarkerDimension()

static bool Ocean::CV::Calibration::Utilities::parseMarkerDimension ( const std::string &  markerDimension,
int32_t &  horizontalMarkers,
int32_t &  verticalMarkers 
)
static

Parses the marker dimension from a string.

The string must have the format '<HorizontalMarkers>x<VerticalMarkers>' - e.g., '8x13'

Parameters
markerDimensionThe string with the marker dimension to parse
horizontalMarkersThe resulting number of horizontal markers, with range [1, infinity)
verticalMarkersThe resulting number of vertical markers, with range [1, infinity)
Returns
True, if succeeded

◆ visualizeDistortionGrid()

static Frame Ocean::CV::Calibration::Utilities::visualizeDistortionGrid ( const AnyCamera camera,
const unsigned int  horizontalBins,
const unsigned int  verticalBins,
const bool  undistort,
Worker worker = nullptr 
)
static

Visualizes the distortion of a camera with a grid.

Parameters
cameraThe camera profile for which the distortion/undistortion is visualized, must be valid
horizontalBinsNumber of horizontal bins, with range [1, camera.width() / 2u)
verticalBinsNumber of vertical bins, with range [1, camera.height() / 2u)
undistortTrue, to visualize the undistorted frame, otherwise the distorted frame is visualized
workerOptional worker object to distribute the computation
Returns
Resulting frame with visualized distortion/undistortion

◆ visualizeDistortionVectors()

static Frame Ocean::CV::Calibration::Utilities::visualizeDistortionVectors ( const AnyCamera camera,
const unsigned int  horizontalBins,
const unsigned int  verticalBins 
)
static

Visualizes the distortion of a camera with displacement vectors.

Parameters
cameraThe camera profile for which the distortion is visualized, must be valid
horizontalBinsNumber of horizontal bins, with range [1, camera.width() / 2]
verticalBinsNumber of vertical bins, with range [1, camera.height() / 2]
Returns
Resulting distortion frame with visualized distortion

The documentation for this class was generated from the following file: