Defines the image filter structure.
◆ 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. |
◆ dwImageFilterHandle_t
◆ 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.
◆ dwImageFilter_applyFilter()
Applies the set filter to the input image.
- Parameters
-
[out] | outputImage | Output image of DW_IMAGE_CUDA type. Only single channel is currently supported |
[in] | inputImage | The input image, must match the output image |
[in] | filter | Pointer 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()
Gets the cuda stream used by the APIs of ImageFilter.
- Parameters
-
[out] | stream | CUDA stream |
[in] | filter | Handle to the ImageFilter handle |
- Returns
- DW_INVALID_ARGUMENT if image filter handle or stream are NULL.
DW_SUCCESS otherwise.
◆ dwImageFilter_initialize()
Allocates resources for an image filter of a certain type, expecting an image of a specific size.
- Parameters
-
[out] | filter | Pointer to an image filter handle |
[in] | config | Specifies the configuration parameters |
[in] | context | Specifies the handle to the active DW context |
- Returns
- DW_INVALID_ARGUMENT if filter or context are NULL.
DW_SUCCESS otherwise.
◆ dwImageFilter_release()
Releases the image filter.
- Parameters
-
[in] | filter | Pointer to an image filter handle |
- Returns
- DW_INVALID_ARGUMENT if filter is NULL.
DW_SUCCESS otherwise.
◆ dwImageFilter_setCUDAStream()
Sets the cuda stream.
- Parameters
-
[in] | stream | Specifies the CUDA stream to use during image filtering. |
[in] | filter | Pointer to an image filter handle |
- Returns
- DW_INVALID_ARGUMENT if filter is NULL.
DW_SUCCESS otherwise.