The following code snippet shows the general structure of a program that uses a rig to initialize a calibrated camera model and perform projection / unprojection using that model.
for(uint32_t sensorID; sensorID < sensorCount; ++sensorID)
{
{
}
}
DW_API_PUBLIC dwStatus dwCameraModel_initialize(dwCameraModelHandle_t *camera, uint32_t sensorId, dwConstRigHandle_t obj)
Creates a calibrated camera model polymorphically for a compatible sensor.
DW_API_PUBLIC dwStatus dwCameraModel_ray2Pixel(float32_t *u, float32_t *v, float32_t x, float32_t y, float32_t z, dwConstCameraModelHandle_t obj)
Projects a 3D point in camera coordinates to a 2D pixel position.
DW_API_PUBLIC dwStatus dwCameraModel_pixel2Ray(float32_t *x, float32_t *y, float32_t *z, float32_t u, float32_t v, dwConstCameraModelHandle_t obj)
Back-projects a 2D point in pixel coordinates to a 3D optical ray direction.
DW_API_PUBLIC dwStatus dwRig_getSensorType(dwSensorType *const sensorType, uint32_t const sensorId, dwConstRigHandle_t const obj)
Returns the type of sensor based upon the sensorID sent into the method.
DW_API_PUBLIC dwStatus dwRig_getSensorCount(uint32_t *const sensorCount, dwConstRigHandle_t const obj)
Gets the number of all available sensors.
DW_API_PUBLIC dwStatus dwRig_initializeFromFile(dwRigHandle_t *const obj, dwContextHandle_t const ctx, char8_t const *const configurationFile)
Initializes the Rig Configuration module from a file.
@ DW_SENSOR_CAMERA
CAMERA.