DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

calibration/cameramodel/docs/usecase0.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
2 
3 @page cameramodel_usecase0 Ray-to-Pixel and Pixel-to-Ray
4 
5 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
6 
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.
8 
9 ```{.cpp}
10  dwRig_initializeFromFile(...);
11 
12  dwRig_getSensorCount(&sensorCount, ...);
13  for(uint32_t sensorID; sensorID < sensorCount; ++sensorID)
14  {
15  dwRig_getSensorType(&sensorType, sensorID, ...);
16  if(sensorType == DW_SENSOR_CAMERA)
17  {
18  dwCameraModel_initialize(&camera, sensorID, ...);
19 
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);
23  }
24  }
25 ```
26 For the full implementation refer to @ref dwx_rig_sample.