The Software Image Signal Processor (ISP) converts RAW images from a specific camera and converts them into images with a linear response curve.
The output format can be either a Bayer pattern image, a demosaiced image, or both. Bayer image means a linear response image that has the same position varying color filter as the camera physical sensor. The demosiced image is the final result where each pixel has all color channels available, either via interpolation or downsampling. For optimization purposes, if only a subregion of the image is of interest, demosaicing can be run on that sub-region only.
The state of the software ISP pipeline controls the demosaic output. Use the following methods to control the pipeline state:
- Note
- The Bayer image is always the full resolution and not affected by the demosaic state.
Currently, the pipeline supports RAW images from the following types of cameras.
|
DW_API_PUBLIC dwStatus | dwSoftISP_bindInputRaw (const dwImageCUDA *rawImage, dwSoftISPHandle_t obj) |
| Binds the input image to the softISP. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_bindOutputBayer (dwImageCUDA *bayerImage, dwSoftISPHandle_t obj) |
| Binds a Bayer image to the softISP. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_bindOutputDemosaic (dwImageCUDA *demosaicImage, dwSoftISPHandle_t obj) |
| Binds a demosaic image to the softISP. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_bindOutputTonemap (dwImageCUDA *tonemappedImage, dwSoftISPHandle_t obj) |
| Binds a tone-mapped image to the softISP. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_getBayerImageProperties (dwImageProperties *imageProperties, dwSoftISPHandle_t obj) |
| Gets the image properties for the produced Bayer images. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_getCUDAStream (cudaStream_t *stream, dwSoftISPHandle_t obj) |
| Gets the CUDA stream for the softISP pipeline. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_getDemosaicImageProperties (dwImageProperties *imageProperties, dwSoftISPHandle_t obj) |
| Gets the image properties for the produced demosaiced images. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_getDemosaicMethod (dwSoftISPDemosaicMethod *method, dwSoftISPHandle_t obj) |
| Gets the method used for demosaic. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_getDemosaicROI (dwRect *cropRegion, dwSoftISPHandle_t obj) |
| Gets the cropping region in the Bayer image used for demosaicing. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_getDenoiseMethod (dwSoftISPDenoiseMethod *method, dwSoftISPHandle_t obj) |
| Gets the method used for denoising. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_getTonemapType (dwTonemapMethod *type, dwSoftISPHandle_t obj) |
| Gets the tonemap type. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_getWhiteBalanceMode (dwSoftISPWhiteBalanceMode *mode, dwSoftISPHandle_t obj) |
| Gets the whitebalance mode. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_initialize (dwSoftISPHandle_t *obj, const dwSoftISPParams *params, const dwContextHandle_t ctx) |
| Creates and initializes the software ISP pipeline. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_initParamsFromCamera (dwSoftISPParams *params, const dwCameraProperties *cameraProps) |
| Initializes the parameters for the softISP using dwCameraProperties. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_processDeviceAsync (dwSoftISPHandle_t obj) |
| Runs the Software ISP to convert the bound raw image into whatever output was bound beforehand. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_release (dwSoftISPHandle_t obj) |
| Releases the softISP pipeline object. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_reset (dwSoftISPHandle_t obj) |
| Resets the softISP pipeline. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_setCUDAStream (cudaStream_t stream, dwSoftISPHandle_t obj) |
| Sets the CUDA stream for the softISP pipeline. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_setDemosaicMethod (dwSoftISPDemosaicMethod method, dwSoftISPHandle_t obj) |
| Sets the method used to demosaic. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_setDemosaicROI (dwRect cropRegion, dwSoftISPHandle_t obj) |
| Sets the cropping region in the Bayer image used for demosaicing. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_setDenoiseMethod (dwSoftISPDenoiseMethod method, dwSoftISPHandle_t obj) |
| Sets the method used to denoise. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_setProcessType (const int32_t processType, dwSoftISPHandle_t obj) |
| Sets the proceesed output type that will be computed. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_setTonemapType (dwTonemapMethod type, dwSoftISPHandle_t obj) |
| Sets the tonemap type. More...
|
|
DW_API_PUBLIC dwStatus | dwSoftISP_setWhiteBalanceMode (dwSoftISPWhiteBalanceMode mode, dwSoftISPHandle_t obj) |
| Sets the whitebalance mode. More...
|
|
◆ dwSoftISPParams
Data Fields |
const char * |
cameraModuleName |
|
dwCameraRawFormat |
cameraRawFormat |
|
uint32_t |
cameraRevision |
|
dwCameraType |
cameraType |
Camera Type. |
uint32_t |
height |
Input Image Height. |
dwTonemapMethod |
method |
Tonemapper type (select UNKNOWN for default/no tonemapping) |
uint32_t |
width |
Input Image Width. |
◆ dwSoftISPHandle_t
Handle representing the Software ISP.
Definition at line 81 of file SoftISP.h.
◆ dwSoftISPDemosaicMethod
Enumerator |
---|
DW_SOFTISP_DEMOSAIC_METHOD_INTERPOLATION | Full camera resolution using interpolation.
|
DW_SOFTISP_DEMOSAIC_METHOD_DOWNSAMPLE | Half camera resolution combining a 2x2 Bayer cell into one output pixel.
|
Definition at line 83 of file SoftISP.h.
◆ dwSoftISPDenoiseMethod
Enumerator |
---|
DW_SOFTISP_DENOISE_METHOD_NONE | No denoising.
|
DW_SOFTISP_DENOISE_METHOD_BILATERAL | Bilateral denoising.
|
Definition at line 90 of file SoftISP.h.
◆ dwSoftISPProcessType
Enumerator |
---|
DW_SOFTISP_PROCESS_TYPE_BAYER | Compute Bayer.
|
DW_SOFTISP_PROCESS_TYPE_DEMOSAIC | Compute demosaic.
|
DW_SOFTISP_PROCESS_TYPE_TONEMAP | Compute tone map.
|
Definition at line 97 of file SoftISP.h.
◆ dwSoftISPWhiteBalanceMode
Enumerator |
---|
DW_SOFTISP_WHITEBALANCE_MODE_FIXED | Image is white-balanced according to fixed parameters from the sensor.
|
DW_SOFTISP_WHITEBALANCE_MODE_AUTO | Image is automatically white-balanced.
|
Definition at line 106 of file SoftISP.h.
◆ dwSoftISP_bindInputRaw()
Binds the input image to the softISP.
It will be the source used by processDeviceAsync()
.
- Parameters
-
[in] | rawImage | A pointer to the raw image. Passing nullptr will unbound. |
[in] | obj | A pointer to the Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_INVALID_ARGUMENT - If the given pointer to the raw image is null
- Note
- Bound image must be valid until unbound, i.e. passing nullptr.
◆ dwSoftISP_bindOutputBayer()
Binds a Bayer image to the softISP.
The caller must allocate the image, using the properties returned by dwSoftISP_getBayerImageProperties()
- Parameters
-
[in] | bayerImage | A pointer to the output Bayer image. Passing nullptr will unbound. |
[in] | obj | A pointer to the Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
- Note
- Bound image must be valid until unbound, i.e. passing nullptr.
◆ dwSoftISP_bindOutputDemosaic()
Binds a demosaic image to the softISP.
The caller must allocate the image, using the properties returned by dwSoftISP_getDemosaicImageProperties().
- Parameters
-
[in] | demosaicImage | A pointer to the output demosaic image. Passing nullptr will unbound. |
[in] | obj | A pointer to the Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given ISP handle is invalid,i.e. null or of wrong type
DW_INVALID_ARGUMENT - If the image type is not DW_IMAGE_CUDA and not null
- Note
- Bound image must be valid until unbound, i.e. passing nullptr.
◆ dwSoftISP_bindOutputTonemap()
Binds a tone-mapped image to the softISP.
The caller must allocate the image. The properties of the tone-mapped image can be:
- pxlFormat: DW_IMAGE_RGB or DW_IMAGE_RGBA
- pxlType: DW_TYPE_UINT8 or DW_TYPE_UINT16 The rest of the properties match the demosaic image.
- Note
- To have a tone-mapped image, the caller must bind a tone-map image as well. If the tone-mapped image is not bound,
processDeviceAsync()
will skip tone-mapping.
- Parameters
-
[in] | tonemappedImage | A pointer to the output tone-mapped image. Passing nullptr will unbound. |
[in] | obj | A pointer to the Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is of wrong type
DW_INVALID_ARGUMENT -If the given ISP handle or image pointer is null or image type is not RGB/RGBA UINT8/FLOAT16
- Note
- Bound image must be valid until unbound, i.e. passing nullptr.
◆ dwSoftISP_getBayerImageProperties()
Gets the image properties for the produced Bayer images.
- Parameters
-
[out] | imageProperties | A pointer to the image properties for Bayer output. |
[in] | obj | The Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_getCUDAStream()
Gets the CUDA stream for the softISP pipeline.
- Parameters
-
[out] | stream | Current CUDA stream that is used by the module. |
[in] | obj | Specifies the softISP pipeline handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_getDemosaicImageProperties()
Gets the image properties for the produced demosaiced images.
The output size depends on the ROI set via dwSoftISP_setDemosaicROI.
- Parameters
-
[out] | imageProperties | A pointer to the image properties for demosaic output. |
[in] | obj | The Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_ARGUMENT - If the image properties pointer is null
DW_INVALID_HANDLE - If the given isp handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_getDemosaicMethod()
Gets the method used for demosaic.
- Parameters
-
[out] | method | Method used to demosaic. |
[in] | obj | Specifies the softISP pipeline handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_getDemosaicROI()
Gets the cropping region in the Bayer image used for demosaicing.
- Parameters
-
[out] | cropRegion | Crop region used in the Bayer image. |
[in] | obj | Specifies the softISP pipeline handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_getDenoiseMethod()
Gets the method used for denoising.
- Parameters
-
[out] | method | Method used to denoise. |
[in] | obj | Specifies the softISP pipeline handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_getTonemapType()
Gets the tonemap type.
- Parameters
-
[out] | type | The tonemap type currently used. DW_TONEMAP_UNKNOWN if no tonemap is in use |
[in] | obj | The Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_getWhiteBalanceMode()
Gets the whitebalance mode.
- Parameters
-
[out] | mode | the whitebalance mode currently used. |
[in] | obj | The Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_initialize()
Creates and initializes the software ISP pipeline.
- Parameters
-
[out] | obj | A pointer to the created softISP pipeline handle. |
[in] | params | The parameters of the softISP. |
[in] | ctx | Driveworks context handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given drivework context handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
DW_INVALID_ARGUMENT- If softISP pipeline handle or softISP parameters is null
◆ dwSoftISP_initParamsFromCamera()
Initializes the parameters for the softISP using dwCameraProperties.
- Parameters
-
[out] | params | A pointer to the initialized parameters. |
[in] | cameraProps | Properties of the camera. |
- Returns
- DW_SUCCESS
DW_INVALID_ARGUMENT - If the given handles are invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_processDeviceAsync()
Runs the Software ISP to convert the bound raw image into whatever output was bound beforehand.
The command will process as explained in the table at the beginning of the page (DW_SOFTISP_ is omitted).
- Parameters
-
[in] | obj | A pointer to the Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
◆ dwSoftISP_release()
Releases the softISP pipeline object.
This method releases all resources associated with the RAW camera processing pipeline. Such resources include NVIDIA® CUDA® memory.
- Note
- This method renders the handle unusable.
- Parameters
-
[in] | obj | The object handle to release. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_reset()
Resets the softISP pipeline.
(Reserved for future use.)
- Parameters
-
[in] | obj | Specifies the softISP pipeline handle to reset. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_setCUDAStream()
Sets the CUDA stream for the softISP pipeline.
- Parameters
-
[in] | stream | Specifies the CUDA stream. |
[in] | obj | Specifies the softISP pipeline handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_setDemosaicMethod()
Sets the method used to demosaic.
Depending on the camera, not all methods may be implemented.
- Parameters
-
[in] | method | Specifies the demosaic method. |
[in] | obj | Specifies the softISP pipeline handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_setDemosaicROI()
Sets the cropping region in the Bayer image used for demosaicing.
- Parameters
-
[in] | cropRegion | Specifies the crop region in the Bayer image. |
[in] | obj | Specifies the softISP pipeline handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_setDenoiseMethod()
Sets the method used to denoise.
Depending on the camera, not all methods may be implemented.
- Parameters
-
[in] | method | Specifies the denoise method. |
[in] | obj | Specifies the softISP pipeline handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_setProcessType()
Sets the proceesed output type that will be computed.
Output resources need to be bounded with the corresponding bind calls.
- Parameters
-
[in] | processType | A bitwise mask of the process output chosen (must match or be a subset of the bound images) |
[in] | obj | The Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
◆ dwSoftISP_setTonemapType()
Sets the tonemap type.
All resources are allocated by the softISP at initialization, this call only chooses the current one in use
- Parameters
-
[in] | type | The tonemap type currently used. DW_TONEMAP_UNKNOWN if no tonemap is in use |
[in] | obj | The Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST
◆ dwSoftISP_setWhiteBalanceMode()
Sets the whitebalance mode.
- Parameters
-
[in] | mode | the whitebalance mode to set. |
[in] | obj | The Software ISP handle. |
- Returns
- DW_SUCCESS
DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type
DW_BAD_CAST