DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

Software ISP Workflow

This workflow is demonstrated in the following sample: Camera Replay Sample

Initialize the parameters using a camera as input.

dwSoftISPParams softISPParams;
dwSoftISP_initParamsFromCamera(&softISPParams, &cameraProps);

Initialize the softISP module

dwSoftISPHandle_t softISP;
dwSoftISP_initialize(&softISP, &softISPParams, sdk);

Set the demosaic method and crop region. The choice of demosaic method will affect the resolution of the output

dwSoftISP_setDemosaicMethod(DW_SOFTISP_DEMOSAIC_METHOD_INTERPOLATION, softISP);
dwSoftISP_setDemosaicROI(cropRegion, softISP); // optional

Get the properties for demosaic image (RCB image) and use them to create a CUDA image, which will be used as the output surface.

dwImageProperties rcbProperties;
dwSoftISP_getDemosaicImageProperties(&rcbProperties, softISP);
dwImage_create(&rcbImage, rcbProperties, sdk);
dwImageCUDA* rcbImageCUDA = nullptr;
dwImage_getCUDA(&rcbImageCUDA, rcbImage);
dwSoftISP_bindOutputDemosaic(rcbImageCUDA, softISP);

Allocate an RGBA CUDA image for the tone map output. Given that there are multiple choices for format, there is no API that returns tone map properties, but the user chooses (the choice is limited)

dwImageProperties rgbaImageProperties = rcbProperties;
rgbaImageProperties.format = DW_IMAGE_FORMAT_RGBA_UINT8;
// CODE: create image with rgbaProperties
dwSoftISP_bindOutputTonemap(rgbaImageCUDA, softISP);

Main loop, reads the camera frame, retrieves a CUDA image of the raw input, binds it to the soft ISP and gets processed. All outputs are now found in the respective bound image, namely rcbImage and rgbaImage

while(loop) {
// CODE: read raw from camera
dwSoftISP_bindInputRaw(rawImageCUDA, softISP);
dwSoftISP_processDeviceAsync(DW_SOFTISP_PROCESS_TYPE_DEMOSAIC | DW_SOFTISP_PROCESS_TYPE_TONEMAP, softISP);
// CODE: use either or both rcbImage and rgbaImage
}

All images allocated are destroyed and dwSoftISP released

// CODE: destroy images
dwSoftISP_release(&rccb);

For more information see dwx_camera_gmsl_raw_sample .