Skip to content

Class libCalibGeom::CameraModelCRT

Inherits from: public libCalibGeom::CameraModelBase

Public member functions

getName()

const std::stringgetName() const override

Returns the name of the camera model.

Returns:

const std::string

getParameterNames()

const std::vector< ParameterSpec > &getParameterNames() const override

Returns the specifications for all parameters.

Returns:

const std::vector< ParameterSpec > &

getNParams()

intgetNParams() const override

Returns the total number of parameters.

Returns:

int

hasParam()

boolhasParam(const std::string &name) const override

Checks if a parameter with the given name exists.

Returns:

bool

param()

ParameterConstReferenceparam(const int idx) const override

Returns a constant reference to a parameter by index.

Returns:

ParameterConstReference

param()

ParameterConstReferenceparam(const std::string name) const override

Returns a constant reference to a parameter by name.

Returns:

ParameterConstReference

param()

ParameterReferenceparam(const int idx) override

Returns a mutable reference to a parameter by index.

Returns:

ParameterReference

param()

ParameterReferenceparam(const std::string name) override

Returns a mutable reference to a parameter by name.

Returns:

ParameterReference

parameterValues()

std::vector< double >parameterValues() const override

Returns the parameter values in optimizer order.

Returns:

std::vector< double >

setParameterValues()

voidsetParameterValues(const std::vector< double > &values) override

Replaces the parameter values from optimizer-order storage.

Returns:

void

isCentral()

boolisCentral() const override

Returns whether the model is central.

Central models have a single ray origin at (0, 0, 0) for all pixels. Non-central models may expose per-pixel ray origins via unprojectRay() and getRayMaps().

Returns:

bool

clone()

std::unique_ptr< CameraModelBase >clone() const override

Clones the camera model.

Returns:

std::unique_ptr< CameraModelBase >

defaultInitializationMethod()

InitializationMethoddefaultInitializationMethod() const override

Returns the default initialization method for this camera model.

Returns:

InitializationMethod

projectPoint()

boolprojectPoint(const double X, const double Y, const double Z, double &u, double &v) const override

Projects a 3D point into image coordinates (u, v).

Parameters:

XX-coordinate in camera frame.
YY-coordinate in camera frame.
ZZ-coordinate in camera frame.
uResulting horizontal image coordinate.
vResulting vertical image coordinate.

Returns:

boolTrue if the point is projectable (e.g. not behind camera).

unprojectPoint()

boolunprojectPoint(const double &u, const double &v, double &X, double &Y, double &Z) const override

Unprojects an image point (u, v) into a 3D direction.

For central models, the resulting vector (X, Y, Z) is a unit bearing vector in camera coordinates. For models that expose richer ray geometry, this method still returns the normalized ray direction only; use unprojectRay() when the ray origin also matters.

Parameters:

uHorizontal image coordinate.
vVertical image coordinate.
XX component of direction.
YY component of direction.
ZZ component of direction.

Returns:

boolTrue if unprojection was successful.

unprojectRay()

boolunprojectRay(const double &u, const double &v, Point3 &origin, Point3 &direction) const override

Unprojects an image point (u, v) into a full 3D ray.

For central models, the ray origin is (0, 0, 0) and the direction is a unit bearing vector. Models with non-zero per-pixel ray origins should override this function to return the full ray geometry.

Parameters:

uHorizontal image coordinate.
vVertical image coordinate.
originRay origin in camera coordinates.
directionUnit ray direction in camera coordinates.

Returns:

boolTrue if unprojection was successful.

getUndistortionMaps()

voidgetUndistortionMaps(Image< float > &mapU, Image< float > &mapV, Matrix< double, 3, 3 > &K) const override

Computes undistortion maps and the new camera matrix.

The returned maps define a source-image remap induced by a default virtual linear camera. For each output pixel, K maps the pixel to a point on the virtual camera plane at Z==1, which in turn defines the corresponding virtual camera ray. The maps contain the source-image lookup coordinates produced by projecting that ray through the camera model.

For central models this rectification is exact. For non-central models, a single depth-independent 2D remap is only an approximation, so the result should be interpreted as a convenient best-fit rectification.

Parameters:

mapUMap for u-coordinates.
mapVMap for v-coordinates.
KNew camera matrix.

Returns:

void

getUnprojectionMaps()

voidgetUnprojectionMaps(Image< float > &mapX, Image< float > &mapY, Image< float > &mapZ) const override

Computes 3-channel bearing-vector maps.

The returned maps store the unit ray direction (X, Y, Z) associated with each pixel.

For non-central models, these maps describe direction only and do not encode any per-pixel ray origin. Use getRayMaps() for the full geometry.

Parameters:

mapXMap for X-components.
mapYMap for Y-components.
mapZMap for Z-components.

Returns:

void

getRayMaps()

voidgetRayMaps(Image< float > &mapOx, Image< float > &mapOy, Image< float > &mapOz, Image< float > &mapDx, Image< float > &mapDy, Image< float > &mapDz) const override

Computes per-pixel ray origin and direction maps.

Central models return zero origin everywhere and a unit bearing vector in the direction maps. Models with per-pixel ray origins can override this to expose the full ray geometry.

Parameters:

mapOxMap for ray-origin X-coordinates.
mapOyMap for ray-origin Y-coordinates.
mapOzMap for ray-origin Z-coordinates.
mapDxMap for ray-direction X-coordinates.
mapDyMap for ray-direction Y-coordinates.
mapDzMap for ray-direction Z-coordinates.

Returns:

void

regularizationFunction()

std::unique_ptr< ceres::CostFunction >regularizationFunction(const int nResiduals) const override

Creates a regularization cost function.

Parameters:

nResidualsNumber of residuals to regularize over.

Returns:

std::unique_ptr< ceres::CostFunction >

getConstantParamIds()

std::vector< int >getConstantParamIds() const override

Returns the indices of constant (fixed) parameters.

Returns:

std::vector< int >

newCostFunction()

std::unique_ptr< ceres::CostFunction >newCostFunction(const Point2 &imagePoint) const override

Creates a Ceres CostFunction for optimizing Reprojection Error.

Parameters:

imagePointThe detected 2D point.

Returns:

std::unique_ptr< ceres::CostFunction >

newCostFunction()

std::unique_ptr< ceres::CostFunction >newCostFunction(const Point2 &imagePoint, const Matrix< double, 2, 2 > &W) const override

Creates a Ceres CostFunction with uncertainty weighting.

Parameters:

imagePointThe detected 2D point.
WWeight matrix.

Returns:

std::unique_ptr< ceres::CostFunction >

toString()

std::stringtoString() const override

Returns a string representation of the model parameters.

Returns:

std::string

CameraModelBase()

CameraModelBase(const ImageSize imageSize,const ImageRegion validRegion = ImageRegion())

Returns:

void

CameraModelBase()

CameraModelBase()

Returns:

void

Public Static Attributes

hasDynamicParameterCount

constexpr boolhasDynamicParameterCount

No documentation provided.

Protected Functions

CameraModelCRT()

CameraModelCRT()=default

Returns:

void