DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

Ray-to-Pixel and Pixel-to-Ray

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.

dwRig_getSensorCount(&sensorCount, ...);
for(uint32_t sensorID; sensorID < sensorCount; ++sensorID)
{
dwRig_getSensorType(&sensorType, sensorID, ...);
if(sensorType == DW_SENSOR_CAMERA)
{
dwCameraModel_initialize(&camera, sensorID, ...);
// use calibrated camera to perform unprojection / projection
dwCameraModel_pixel2Ray(&x, &y, &z, camera, u, v);
dwCameraModel_ray2Pixel(&u, &v camera, x, y, z);
}
}

For the full implementation refer to Rig Configuration Sample.