DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Ray-to-Pixel and Pixel-to-Ray
SW Release Applicability: This tutorial is applicable to modules in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

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.