kml_init_filter
Initialize resources for filter2D computation.
Interface Definition
C interface:
int kml_init_filter(cvhalFilter2D **context, unsigned char *kernel_data, size_t kernel_step, int kernel_type, int kernel_width, int kernel_height, int max_width, int max_height, int src_type, int dst_type, int borderType, double delta, int anchor_x, int anchor_y, bool allowSubmatrix, bool allowInplace);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
context |
cvhalFilter2D ** |
Pointer to an empty structure, which points to the internally allocated resource structure space after resource initialization is complete. |
Input/Output |
kernel_data |
unsigned char* |
Convolution kernel data. |
Output |
kernel_step |
size_t |
Number of bytes per row of the convolution kernel. |
Input |
kernel_width |
int |
Width of the convolution kernel. |
Input |
kernel_height |
int |
Height of the convolution kernel. |
Input |
max_width |
int |
Full image width. |
Input |
max_height |
int |
Full image height. |
Input |
src_type |
int |
Input image type. |
Input |
dst_type |
int |
Output image type. |
Input |
borderType |
int |
Border padding type. |
Input |
delta |
double |
Offset added to the output image. |
Input |
anchor_x |
int |
X-coordinate of the anchor point within the convolution kernel. |
Input |
anchor_y |
int |
Y-coordinate of the anchor point within the convolution kernel. |
Input |
allowSubMatrix |
bool |
Whether the input image can be a submatrix. true if supported, or false otherwise. |
Input |
allowInplace |
bool |
Whether in-place operations are supported. true if supported, or false otherwise. |
Input |
The input parameters for this function interface are processed and passed down by the upper-level OpenCV filter2D framework. Direct explicit calling of kml_init_filter by users is not supported.
Return Value
Scenario |
Return Value |
|---|---|
The input or output image depth is not CV_16F or CV_32F. |
1 |
The number of convolution kernel channels is not 1. |
1 |
The border padding type passed to the OpenCV filter2D interface is not in the following list: BORDER_CONSTANT BORDER_REPLICATE BORDER_REFLECT BORDER_REFLECT_101 BORDER_REFLECT101 BORDER_DEFAULT BORDER_ISOLATED |
1 |
Internal resource allocation failure |
-1 |
Other scenarios |
0 |