hi_filter_2d_config

Description

Defines the 2D convolutional filtering parameters.

Definition

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;

For details about basic data types hi_u32 and hi_double, see Basic Data Types.

Members

Member

Description

filter

User-defined convolution kernel.

Since the filter is a 5 × 5 array, when the width or height within the kernel_size is not 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. For details, see hi_size.

anchor

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

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. For details, see hi_vpc_bord_type.

scalar_value

Border making value. For details, see hi_vpc_scalar.

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.