hi_filter_2d_config

Description

Defines the 2D convolutional filtering parameters.

Prototype

typedef struct {
    hi_double filter[5][5];
    hi_size kernel_size;
    hi_point anchor; 
    hi_double delta; 
    hi_vpc_bord_type border_type;
    hi_vpc_scalar scalar_value;
    hi_u32 reserved[2];
} hi_filter_2d_config;

Members

Member

Description

filter

User-defined convolution kernel.

Since the filter is a 5 x 5 array, when the width and height within the kernel_size are not both 5, the intermediate data within the two-dimensional array is valid, for example:

  • When the width is 1 and the height is 3, the data in the yellow zone in the following figure is valid.

  • When the width is 3 and the height is 3, the data in the yellow zone in the following figure is valid.

kernel_size

Size of the convolution kernel. The width and height of kernel_size can only be set to 1, 3, or 5.

anchor

Convolution kernel anchor, which needs to be set to (-1, -1). This field is reserved.

delta

Incremental value, which is added to each pixel value after convolution.

border_type

Border making type. Only the HI_BORDER_CONSTANT and HI_BORDER_REPLICATE modes are supported.

scalar_value

Border making value.

reserved[2]

Reserved. To ensure compatibility in later versions, use the memset structure for resetting and initialization. Do not explicitly access the reserved field in the code.