Class libCalibGeom::CameraModelBSplineRay¶
General ray based B-Spline Camera Model
This is Calib.io's general B-Spline based camera model that operates in ray space. It models the camera by warping 3D ray directions using bicubic B-spline surfaces, making it capable of representing any central projection lens, including fisheye and omnidirectional cameras.
The model uses a 2D grid of B-spline control points to warp normalized ray directions. This provides smooth, continuously differentiable distortion with excellent fitting capability for complex lens systems.
Knot Count Configuration:The resolution of the B-spline grid (number of knots) is configurable at construction time via CameraModelConfig:
nKnotsX: Number of knots along the horizontal dimension (default: 16)
nKnotsY: Number of knots along the vertical dimension (default: 12)
Higher knot counts provide more flexibility for modeling complex distortions but increase the parameter count and computational cost. Typical values range from 8-20 knots depending on image resolution and lens complexity.
Performance:More generic than BSplineWarp but computationally slower due to ray-space operations. Best suited for wide-angle and fisheye lenses where ray-based modeling is more natural than image-space warping.
CameraModelBSplineWarp for a faster image-space variant suitable for pinhole-like lenses
Inherits from: public libCalibGeom::CameraModelCRT< CameraModelBSplineRay >
Constructors and destructors¶
CameraModelBSplineRay()¶
CameraModelBSplineRay
Returns:
void |
CameraModelBSplineRay()¶
CameraModelBSplineRay()¶
CameraModelBSplineRay
Returns:
void |
~CameraModelBSplineRay()¶
~CameraModelBSplineRay
Returns:
void |
Public member functions¶
initialize()¶
boolinitialize
Initializes the model from calibration observations.
Returns:
bool |
regularizationFunction()¶
std::unique_ptr< ceres::CostFunction >regularizationFunction
Creates a regularization cost function.
Parameters:
nResiduals | Number of residuals to regularize over. |
Returns:
std::unique_ptr< ceres::CostFunction > |
project()¶
boolproject
Returns:
bool |
unproject()¶
boolunproject
Returns:
bool |
project()¶
boolproject
Returns:
bool |
unproject()¶
boolunproject
Returns:
bool |
nKnotsX()¶
intnKnotsX
Returns:
int |
nKnotsY()¶
intnKnotsY
Returns:
int |
config()¶
CameraModelConfigconfig
Returns the parameters needed to reconstruct this model layout.
Returns:
CameraModelConfig |
getUndistortionMaps()¶
voidgetUndistortionMaps
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:
mapU | Map for u-coordinates. |
mapV | Map for v-coordinates. |
K | New camera matrix. |
Returns:
void |
getUnprojectionMaps()¶
voidgetUnprojectionMaps
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:
mapX | Map for X-components. |
mapY | Map for Y-components. |
mapZ | Map for Z-components. |
Returns:
void |
toString()¶
std::stringtoString
Returns a string representation of the model parameters.
Returns:
std::string |
Public data members¶
parameters¶
CameraParametersparameters
No documentation provided.
Public Static Attributes¶
hasDynamicParameterCount¶
constexpr boolhasDynamicParameterCount
No documentation provided.
Public Static Functions¶
name()¶
const std::stringname
Returns:
const std::string |