Loading [MathJax]/extensions/tex2jax.js
  • <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>

  • DriveWorks SDK Reference
    5.10.90 Release
    For Test and Development only

    All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
    Software ISP Interface

    Detailed Description

    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.

    Data Structures

    struct  dwSoftISPParams
     

    Typedefs

    typedef struct dwSoftISPObject * dwSoftISPHandle_t
     Handle representing the Software ISP. More...
     

    Enumerations

    enum  dwSoftISPDemosaicMethod {
      DW_SOFTISP_DEMOSAIC_METHOD_INTERPOLATION ,
      DW_SOFTISP_DEMOSAIC_METHOD_DOWNSAMPLE
    }
     
    enum  dwSoftISPDenoiseMethod {
      DW_SOFTISP_DENOISE_METHOD_NONE ,
      DW_SOFTISP_DENOISE_METHOD_BILATERAL
    }
     
    enum  dwSoftISPProcessType {
      DW_SOFTISP_PROCESS_TYPE_BAYER = 1 << 0 ,
      DW_SOFTISP_PROCESS_TYPE_DEMOSAIC = 1 << 1 ,
      DW_SOFTISP_PROCESS_TYPE_TONEMAP = 1 << 2
    }
     
    enum  dwSoftISPWhiteBalanceMode {
      DW_SOFTISP_WHITEBALANCE_MODE_FIXED ,
      DW_SOFTISP_WHITEBALANCE_MODE_AUTO
    }
     

    Functions

    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...
     

    Data Structure Documentation

    ◆ dwSoftISPParams

    struct 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.

    Typedef Documentation

    ◆ dwSoftISPHandle_t

    typedef struct dwSoftISPObject* dwSoftISPHandle_t

    Handle representing the Software ISP.

    Definition at line 81 of file SoftISP.h.

    Enumeration Type Documentation

    ◆ 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.

    Function Documentation

    ◆ dwSoftISP_bindInputRaw()

    DW_API_PUBLIC dwStatus dwSoftISP_bindInputRaw ( const dwImageCUDA rawImage,
    dwSoftISPHandle_t  obj 
    )

    Binds the input image to the softISP.

    It will be the source used by processDeviceAsync().

    Parameters
    [in]rawImageA pointer to the raw image. Passing nullptr will unbound.
    [in]objA 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()

    DW_API_PUBLIC dwStatus dwSoftISP_bindOutputBayer ( dwImageCUDA bayerImage,
    dwSoftISPHandle_t  obj 
    )

    Binds a Bayer image to the softISP.

    The caller must allocate the image, using the properties returned by dwSoftISP_getBayerImageProperties()

    Parameters
    [in]bayerImageA pointer to the output Bayer image. Passing nullptr will unbound.
    [in]objA 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()

    DW_API_PUBLIC dwStatus dwSoftISP_bindOutputDemosaic ( dwImageCUDA demosaicImage,
    dwSoftISPHandle_t  obj 
    )

    Binds a demosaic image to the softISP.

    The caller must allocate the image, using the properties returned by dwSoftISP_getDemosaicImageProperties().

    Parameters
    [in]demosaicImageA pointer to the output demosaic image. Passing nullptr will unbound.
    [in]objA 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()

    DW_API_PUBLIC dwStatus dwSoftISP_bindOutputTonemap ( dwImageCUDA tonemappedImage,
    dwSoftISPHandle_t  obj 
    )

    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]tonemappedImageA pointer to the output tone-mapped image. Passing nullptr will unbound.
      [in]objA 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()

    DW_API_PUBLIC dwStatus dwSoftISP_getBayerImageProperties ( dwImageProperties imageProperties,
    dwSoftISPHandle_t  obj 
    )

    Gets the image properties for the produced Bayer images.

    Parameters
    [out]imagePropertiesA pointer to the image properties for Bayer output.
    [in]objThe 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()

    DW_API_PUBLIC dwStatus dwSoftISP_getCUDAStream ( cudaStream_t *  stream,
    dwSoftISPHandle_t  obj 
    )

    Gets the CUDA stream for the softISP pipeline.

    Parameters
    [out]streamCurrent CUDA stream that is used by the module.
    [in]objSpecifies 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()

    DW_API_PUBLIC dwStatus dwSoftISP_getDemosaicImageProperties ( dwImageProperties imageProperties,
    dwSoftISPHandle_t  obj 
    )

    Gets the image properties for the produced demosaiced images.

    The output size depends on the ROI set via dwSoftISP_setDemosaicROI.

    Parameters
    [out]imagePropertiesA pointer to the image properties for demosaic output.
    [in]objThe 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()

    DW_API_PUBLIC dwStatus dwSoftISP_getDemosaicMethod ( dwSoftISPDemosaicMethod method,
    dwSoftISPHandle_t  obj 
    )

    Gets the method used for demosaic.

    Parameters
    [out]methodMethod used to demosaic.
    [in]objSpecifies 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()

    DW_API_PUBLIC dwStatus dwSoftISP_getDemosaicROI ( dwRect cropRegion,
    dwSoftISPHandle_t  obj 
    )

    Gets the cropping region in the Bayer image used for demosaicing.

    Parameters
    [out]cropRegionCrop region used in the Bayer image.
    [in]objSpecifies 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()

    DW_API_PUBLIC dwStatus dwSoftISP_getDenoiseMethod ( dwSoftISPDenoiseMethod method,
    dwSoftISPHandle_t  obj 
    )

    Gets the method used for denoising.

    Parameters
    [out]methodMethod used to denoise.
    [in]objSpecifies 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()

    DW_API_PUBLIC dwStatus dwSoftISP_getTonemapType ( dwTonemapMethod type,
    dwSoftISPHandle_t  obj 
    )

    Gets the tonemap type.

    Parameters
    [out]typeThe tonemap type currently used. DW_TONEMAP_UNKNOWN if no tonemap is in use
    [in]objThe 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()

    DW_API_PUBLIC dwStatus dwSoftISP_getWhiteBalanceMode ( dwSoftISPWhiteBalanceMode mode,
    dwSoftISPHandle_t  obj 
    )

    Gets the whitebalance mode.

    Parameters
    [out]modethe whitebalance mode currently used.
    [in]objThe 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()

    DW_API_PUBLIC dwStatus dwSoftISP_initialize ( dwSoftISPHandle_t obj,
    const dwSoftISPParams params,
    const dwContextHandle_t  ctx 
    )

    Creates and initializes the software ISP pipeline.

    Parameters
    [out]objA pointer to the created softISP pipeline handle.
    [in]paramsThe parameters of the softISP.
    [in]ctxDriveworks 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()

    DW_API_PUBLIC dwStatus dwSoftISP_initParamsFromCamera ( dwSoftISPParams params,
    const dwCameraProperties cameraProps 
    )

    Initializes the parameters for the softISP using dwCameraProperties.

    Parameters
    [out]paramsA pointer to the initialized parameters.
    [in]cameraPropsProperties 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()

    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.

    The command will process as explained in the table at the beginning of the page (DW_SOFTISP_ is omitted).

    Parameters
    [in]objA 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()

    DW_API_PUBLIC dwStatus dwSoftISP_release ( dwSoftISPHandle_t  obj)

    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]objThe 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()

    DW_API_PUBLIC dwStatus dwSoftISP_reset ( dwSoftISPHandle_t  obj)

    Resets the softISP pipeline.

    (Reserved for future use.)

    Parameters
    [in]objSpecifies 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()

    DW_API_PUBLIC dwStatus dwSoftISP_setCUDAStream ( cudaStream_t  stream,
    dwSoftISPHandle_t  obj 
    )

    Sets the CUDA stream for the softISP pipeline.

    Parameters
    [in]streamSpecifies the CUDA stream.
    [in]objSpecifies 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()

    DW_API_PUBLIC dwStatus dwSoftISP_setDemosaicMethod ( dwSoftISPDemosaicMethod  method,
    dwSoftISPHandle_t  obj 
    )

    Sets the method used to demosaic.

    Depending on the camera, not all methods may be implemented.

    Parameters
    [in]methodSpecifies the demosaic method.
    [in]objSpecifies 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()

    DW_API_PUBLIC dwStatus dwSoftISP_setDemosaicROI ( dwRect  cropRegion,
    dwSoftISPHandle_t  obj 
    )

    Sets the cropping region in the Bayer image used for demosaicing.

    Parameters
    [in]cropRegionSpecifies the crop region in the Bayer image.
    [in]objSpecifies 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()

    DW_API_PUBLIC dwStatus dwSoftISP_setDenoiseMethod ( dwSoftISPDenoiseMethod  method,
    dwSoftISPHandle_t  obj 
    )

    Sets the method used to denoise.

    Depending on the camera, not all methods may be implemented.

    Parameters
    [in]methodSpecifies the denoise method.
    [in]objSpecifies 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()

    DW_API_PUBLIC dwStatus dwSoftISP_setProcessType ( const int32_t  processType,
    dwSoftISPHandle_t  obj 
    )

    Sets the proceesed output type that will be computed.

    Output resources need to be bounded with the corresponding bind calls.

    Parameters
    [in]processTypeA bitwise mask of the process output chosen (must match or be a subset of the bound images)
    [in]objThe Software ISP handle.
    Returns
    DW_SUCCESS
    DW_INVALID_HANDLE - If the given handle is invalid,i.e. null or of wrong type

    ◆ dwSoftISP_setTonemapType()

    DW_API_PUBLIC dwStatus dwSoftISP_setTonemapType ( dwTonemapMethod  type,
    dwSoftISPHandle_t  obj 
    )

    Sets the tonemap type.

    All resources are allocated by the softISP at initialization, this call only chooses the current one in use

    Parameters
    [in]typeThe tonemap type currently used. DW_TONEMAP_UNKNOWN if no tonemap is in use
    [in]objThe 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()

    DW_API_PUBLIC dwStatus dwSoftISP_setWhiteBalanceMode ( dwSoftISPWhiteBalanceMode  mode,
    dwSoftISPHandle_t  obj 
    )

    Sets the whitebalance mode.

    Parameters
    [in]modethe whitebalance mode to set.
    [in]objThe 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
    人人超碰97caoporen国产