1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
3 @page cameramodel_usecase0 Ray-to-Pixel and Pixel-to-Ray
5 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
7 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.
10 dwRig_initializeFromFile(...);
12 dwRig_getSensorCount(&sensorCount, ...);
13 for(uint32_t sensorID; sensorID < sensorCount; ++sensorID)
15 dwRig_getSensorType(&sensorType, sensorID, ...);
16 if(sensorType == DW_SENSOR_CAMERA)
18 dwCameraModel_initialize(&camera, sensorID, ...);
20 // use calibrated camera to perform unprojection / projection
21 dwCameraModel_pixel2Ray(&x, &y, &z, camera, u, v);
22 dwCameraModel_ray2Pixel(&u, &v camera, x, y, z);
26 For the full implementation refer to @ref dwx_rig_sample.