DriveWorks SDK Reference

| 0.6.67 Release

Calibrated Camera

Detailed Description

Calibrates camera abstraction and functionality.

Typedefs

typedef struct dwCalibratedCameraObject * dwCalibratedCameraHandle_t
 A pointer to the handle representing a calibrated camera. More...
 
typedef struct dwCalibratedCameraObject const * dwConstCalibratedCameraHandle_t
 A pointer to the handle representing a const calibrated camera. More...
 

Functions

DW_API_PUBLIC dwStatus dwCalibratedCamera_getHorizontalFOV (float32_t *hfov, dwConstCalibratedCameraHandle_t obj)
 Gets the horizontal Field of View (FOV) of the calibrated camera, in radians. More...
 
DW_API_PUBLIC dwStatus dwCalibratedCamera_getInversePolynomial (float32_t *invPoly, size_t *size, dwCalibratedCameraHandle_t obj)
 Returns the inverse polynomial used for the inverse distortion model. More...
 
DW_API_PUBLIC dwStatus dwCalibratedCamera_initializeFTheta (dwCalibratedCameraHandle_t *obj, dwContextHandle_t context, const dwFThetaCameraConfig *config)
 Creates and initializes a calibrated camera for the F-Theta distortion model. More...
 
DW_API_PUBLIC dwStatus dwCalibratedCamera_initializeOCam (dwCalibratedCameraHandle_t *obj, dwContextHandle_t context, const dwOCamCameraConfig *config)
 Creates and initializes a calibrated omnidirectional camera. More...
 
DW_API_PUBLIC dwStatus dwCalibratedCamera_initializePinhole (dwCalibratedCameraHandle_t *obj, dwContextHandle_t context, const dwPinholeCameraConfig *config)
 Creates and initializes a calibrated pinhole camera. More...
 
DW_API_PUBLIC dwStatus dwCalibratedCamera_pixel2Ray (float32_t *x, float32_t *y, float32_t *z, dwConstCalibratedCameraHandle_t obj, float32_t u, float32_t v)
 Back-projects a 2D point in pixel coordinates to a 3D optical ray direction. More...
 
DW_API_PUBLIC dwStatus dwCalibratedCamera_ray2Pixel (float32_t *u, float32_t *v, dwConstCalibratedCameraHandle_t obj, float32_t x, float32_t y, float32_t z)
 Projects a 3D point in pixel coordinates to a 2D pixel position. More...
 
DW_API_PUBLIC dwStatus dwCalibratedCamera_release (dwCalibratedCameraHandle_t *obj)
 Releases the calibrated camera. More...
 

Typedef Documentation

◆ dwCalibratedCameraHandle_t

typedef struct dwCalibratedCameraObject* dwCalibratedCameraHandle_t

A pointer to the handle representing a calibrated camera.

This object allows the forward projection of 3D points onto 2D image pixels (ray2Pixel) and the corresponding back-projection (pixel2Ray).

Definition at line 66 of file Camera.h.

◆ dwConstCalibratedCameraHandle_t

typedef struct dwCalibratedCameraObject const* dwConstCalibratedCameraHandle_t

A pointer to the handle representing a const calibrated camera.

Definition at line 70 of file Camera.h.

Function Documentation

◆ dwCalibratedCamera_getHorizontalFOV()

DW_API_PUBLIC dwStatus dwCalibratedCamera_getHorizontalFOV ( float32_t hfov,
dwConstCalibratedCameraHandle_t  obj 
)

Gets the horizontal Field of View (FOV) of the calibrated camera, in radians.

Parameters
[out]hfovA pointer to the camera horizontal FOV in radians.
[in]objHandle to the calibrated camera model.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT

◆ dwCalibratedCamera_getInversePolynomial()

DW_API_PUBLIC dwStatus dwCalibratedCamera_getInversePolynomial ( float32_t invPoly,
size_t *  size,
dwCalibratedCameraHandle_t  obj 
)

Returns the inverse polynomial used for the inverse distortion model.

  • Pinhole cameras use this for the back-projection model.
  • OCam cameras use this for the forward projection model.
Parameters
[out]invPolyArray of coefficients, lower degrees first.
[in,out]sizeInput: size of the polynomial buffer. Output: on success, the number of coefficients returned / the effective polynomial degree.
[in]objCamera handle.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT, DW_INVALID_HANDLE, DW_BAD_CAST

◆ dwCalibratedCamera_initializeFTheta()

DW_API_PUBLIC dwStatus dwCalibratedCamera_initializeFTheta ( dwCalibratedCameraHandle_t obj,
dwContextHandle_t  context,
const dwFThetaCameraConfig config 
)

Creates and initializes a calibrated camera for the F-Theta distortion model.

Parameters
[out]objA pointer to the calibrated camera handle is returned here.
[in]contextSpecifies the handle to the context under which it is created.
[in]configA pointer to the configuration values for the camera.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT

◆ dwCalibratedCamera_initializeOCam()

DW_API_PUBLIC dwStatus dwCalibratedCamera_initializeOCam ( dwCalibratedCameraHandle_t obj,
dwContextHandle_t  context,
const dwOCamCameraConfig config 
)

Creates and initializes a calibrated omnidirectional camera.

See the orignal paper for a description of the model: https://sites.google.com/site/scarabotix/ocamcalib-toolbox Scaramuzza, D. (2008). Omnidirectional Vision: from Calibration to Robot Motion Estimation, ETH Zurich, PhD Thesis no. 17635., February 22, 2008.

Parameters
[out]objA pointer to the calibrated camera handle is returned here.
[in]contextSpecifies the handle to the context under which it is created.
[in]configA pointer to the configuration values for the camera.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT

◆ dwCalibratedCamera_initializePinhole()

DW_API_PUBLIC dwStatus dwCalibratedCamera_initializePinhole ( dwCalibratedCameraHandle_t obj,
dwContextHandle_t  context,
const dwPinholeCameraConfig config 
)

Creates and initializes a calibrated pinhole camera.

Parameters
[out]objA pointer to the calibrated camera handle is returned here.
[in]contextSpecifies the handle to the context under which it is created.
[in]configA pointer to the configuration values for the camera.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT

◆ dwCalibratedCamera_pixel2Ray()

DW_API_PUBLIC dwStatus dwCalibratedCamera_pixel2Ray ( float32_t x,
float32_t y,
float32_t z,
dwConstCalibratedCameraHandle_t  obj,
float32_t  u,
float32_t  v 
)

Back-projects a 2D point in pixel coordinates to a 3D optical ray direction.

The ray is normalized to have a norm of 1.

Parameters
[out]xA pointer to the X coordinate of the ray's direction.
[out]yA pointer to the Y coordinate of the ray's direction.
[out]zA pointer to the Z coordinate of the ray's direction.
[in]objSpecifies the handle to the calibrated camera model.
[in]uSpecifies the horizontal coordinate of the pixel.
[in]vSpecifies the vertical coordinate of the pixel.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT

◆ dwCalibratedCamera_ray2Pixel()

DW_API_PUBLIC dwStatus dwCalibratedCamera_ray2Pixel ( float32_t u,
float32_t v,
dwConstCalibratedCameraHandle_t  obj,
float32_t  x,
float32_t  y,
float32_t  z 
)

Projects a 3D point in pixel coordinates to a 2D pixel position.

Parameters
[out]uA pointer to the horizontal coordinate of the pixel.
[out]vA pointer to the vertical coordinate of the pixel.
[in]objSpecifies the handle to the calibrated camera model.
[in]xSpecifies the X coordinate of the point.
[in]ySpecifies the Y coordinate of the point.
[in]zSpecifies the Z coordinate of the point.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT

◆ dwCalibratedCamera_release()

DW_API_PUBLIC dwStatus dwCalibratedCamera_release ( dwCalibratedCameraHandle_t obj)

Releases the calibrated camera.

This method releases all resources associated with a calibrated camera.

Note
This method renders the handle unusable.
Parameters
[in]objA pointer to the object handle to be released.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST