DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Camera Color Correction Workflow
SW Release Applicability: This tutorial is applicable to modules in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.


The workflow of the color correction module is:

  • Create a handle that points to the rig.json file, which is a file containing the camera's calibration data. With the handle, the module can extract the ground area from each camera view.
dwRig_initializeFromFile(&rigConfig, sdk, "rig.json");
ccParams.cameraWidth = g_imageWidth;
ccParams.cameraHeight = g_imageHeight;
dwColorCorrect_initializeFromRig(&cc, sdk, rigConfig, &ccParams);
  • Send the master camera's image to the handle to extract its statistical color distribution data.
dwColorCorrect_setReferenceCameraView(frameCUDAyuv, cameraIdx, cc);
  • Send the images captured from the rest of the cameras to the handle. It calculates their statistical color data and matches them to the statistical color distribution of the image from the master camera. The input images shall be in the format of YUV420.
dwColorCorrect_correctByReferenceView(frameCUDAyuv, cameraIdx, 0.8f, cc);

The third argument of the function is a factor that controls how much the master camera affects the current view. The range of input for the factor argument is [0.f to 1.f], where:

  • 0.f means that there is no correction. Instead, the function uses the current camera's own color.
  • 1.f means 100% dependency on the master camera's color distribution.

The default value is 0.8f.

For a demonstration of this workflow, see Camera Color Correction Sample.