DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

Image Filter Interface

Detailed Description

Defines the image filter structure.

Data Structures

struct  dwImageFilterConfig
 

Typedefs

typedef struct dwImageFilterObject * dwImageFilterHandle_t
 

Enumerations

enum  dwImageFilterType {
  DW_IMAGEFILTER_TYPE_UNKNOWN = 0,
  DW_IMAGEFILTER_TYPE_RECURSIVE_GAUSSIAN_FILTER = 1,
  DW_IMAGEFILTER_TYPE_BOX_FILTER = 2,
  DW_IMAGEFILTER_TYPE_CONVOLUTION_FILTER = 3
}
 

Functions

DW_API_PUBLIC dwStatus dwImageFilter_applyFilter (dwImageHandle_t outputImage, dwImageHandle_t inputImage, dwImageFilterHandle_t filter)
 Applies the set filter to the input image. More...
 
DW_API_PUBLIC dwStatus dwImageFilter_getCUDAStream (cudaStream_t *stream, dwImageFilterHandle_t filter)
 Gets the cuda stream used by the APIs of ImageFilter. More...
 
DW_API_PUBLIC dwStatus dwImageFilter_initialize (dwImageFilterHandle_t *filter, const dwImageFilterConfig *config, dwContextHandle_t context)
 Allocates resources for an image filter of a certain type, expecting an image of a specific size. More...
 
DW_API_PUBLIC dwStatus dwImageFilter_release (dwImageFilterHandle_t filter)
 Releases the image filter. More...
 
DW_API_PUBLIC dwStatus dwImageFilter_setCUDAStream (cudaStream_t stream, dwImageFilterHandle_t filter)
 Sets the cuda stream. More...
 

Data Structure Documentation

◆ dwImageFilterConfig

struct dwImageFilterConfig
Data Fields
dwImageFilterType filterType Filtering algorithm defined by dwImageFilterType
uint32_t imageHeight Height of the images that the ImageFilter runs on.
uint32_t imageWidth Width of the images that the ImageFilter runs on.
const float32_t * kernel Filter kernel data defined by user.

The kernel will be copied when intializing ImageFilter. If kernelLength = kernelWidth * kernelHeight, then 2D convolution filter will be applied. If kernelLength = kernelWidth + kernelHeight, then 1D separable convolution filter will be applied. It is assumed that in case of separable filter first kernelWidth values defines horizontal filter, and last kernelHeight entries the vertical filter.

uint32_t kernelHeight Height of filter kernel.
uint32_t kernelLength Indicates the kernel data lenght defined by user.
uint32_t kernelWidth Width of filter kernel.
uint32_t order The order of GAUSSIAN filter.
dwProcessorType processorType Processorr type set to DW_PROCESSOR_TYPE_PVA_0 or DW_PROCESSOR_TYPE_PVA_1 to run algorithm on PVA.

set to DW_PROCESSOR_TYPE_GPU to run algorithm on GPU.

dwTrivialDataType pxlType Pixel type of the images that the ImageFilter runs on.

To be set to corresponding data type of input&output image, they both must match.

float32_t sigma The sigma of kernel for GAUSSIAN filter.

Typedef Documentation

◆ dwImageFilterHandle_t

typedef struct dwImageFilterObject* dwImageFilterHandle_t

Definition at line 61 of file ImageFilter.h.

Enumeration Type Documentation

◆ dwImageFilterType

Enumerator
DW_IMAGEFILTER_TYPE_UNKNOWN 
DW_IMAGEFILTER_TYPE_RECURSIVE_GAUSSIAN_FILTER 

Zero order recursive gaussian filter.

Note
: Supporting only images with 1 or 4 channels of uint8 pixel type.
DW_IMAGEFILTER_TYPE_BOX_FILTER 

Box filter.

Note
: Supporting only single channel uint8, float16, float32 image pixel types
DW_IMAGEFILTER_TYPE_CONVOLUTION_FILTER 

Convolution Filter.

Note
: PVA based convolution filter supports only DW_TYPE_UINT(8/16) and DW_TYPE_INT(8/16). GPU based one supports in addition DW_TYPE_FLOAT(16/32) types.

Definition at line 63 of file ImageFilter.h.

Function Documentation

◆ dwImageFilter_applyFilter()

DW_API_PUBLIC dwStatus dwImageFilter_applyFilter ( dwImageHandle_t  outputImage,
dwImageHandle_t  inputImage,
dwImageFilterHandle_t  filter 
)

Applies the set filter to the input image.

Parameters
[out]outputImageOutput image of DW_IMAGE_CUDA type. Only single channel is currently supported
[in]inputImageThe input image, must match the output image
[in]filterPointer to an image filter handle
Returns
DW_INVALID_ARGUMENT if filter or in/out put image are NULL.
DW_CUDA_ERROR if the underlying cuda operation fails.
DW_NVMEDIA_ERROR if the underlying VPI operation fails.
DW_SUCCESS otherwise.

◆ dwImageFilter_getCUDAStream()

DW_API_PUBLIC dwStatus dwImageFilter_getCUDAStream ( cudaStream_t *  stream,
dwImageFilterHandle_t  filter 
)

Gets the cuda stream used by the APIs of ImageFilter.

Parameters
[out]streamCUDA stream
[in]filterHandle to the ImageFilter handle
Returns
DW_INVALID_ARGUMENT if image filter handle or stream are NULL.
DW_SUCCESS otherwise.

◆ dwImageFilter_initialize()

DW_API_PUBLIC dwStatus dwImageFilter_initialize ( dwImageFilterHandle_t filter,
const dwImageFilterConfig config,
dwContextHandle_t  context 
)

Allocates resources for an image filter of a certain type, expecting an image of a specific size.

Parameters
[out]filterPointer to an image filter handle
[in]configSpecifies the configuration parameters
[in]contextSpecifies the handle to the active DW context
Returns
DW_INVALID_ARGUMENT if filter or context are NULL.
DW_SUCCESS otherwise.

◆ dwImageFilter_release()

DW_API_PUBLIC dwStatus dwImageFilter_release ( dwImageFilterHandle_t  filter)

Releases the image filter.

Parameters
[in]filterPointer to an image filter handle
Returns
DW_INVALID_ARGUMENT if filter is NULL.
DW_SUCCESS otherwise.

◆ dwImageFilter_setCUDAStream()

DW_API_PUBLIC dwStatus dwImageFilter_setCUDAStream ( cudaStream_t  stream,
dwImageFilterHandle_t  filter 
)

Sets the cuda stream.

Parameters
[in]streamSpecifies the CUDA stream to use during image filtering.
[in]filterPointer to an image filter handle
Returns
DW_INVALID_ARGUMENT if filter is NULL.
DW_SUCCESS otherwise.