filter2D计算资源初始化。
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);
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
context |
cvhalFilter2D ** |
空结构体指针,完成资源初始化后,指向内部申请的资源结构体空间 |
输入/输出 |
kernel_data |
unsigned char* |
卷积核数据 |
输出 |
kernel_step |
size_t |
卷积核每行数据的字节数 |
输入 |
kernel_width |
int |
卷积核的宽度 |
输入 |
kernel_height |
int |
卷积核的高度 |
输入 |
max_width |
int |
完整图像宽度 |
输入 |
max_height |
int |
完整图像高度 |
输入 |
src_type |
int |
输入图像类型 |
输入 |
dst_type |
int |
输出图像类型 |
输入 |
borderType |
int |
边界填充类型 |
输入 |
delta |
double |
添加在输出图像的偏置值 |
输入 |
anchor_x |
int |
滤波起始点在卷积核中的宽度方向的相对坐标 |
输入 |
anchor_y |
int |
滤波起始点在卷积核中的高度方向的相对坐标 |
输入 |
allowSubMatrix |
bool |
是否支持输入图像是子矩阵, true表示支持,false表示不支持 |
输入 |
allowInplace |
bool |
是否支持inplace运算, true表示支持,false表示不支持 |
输入 |
函数接口入参由OpenCV filter2D上层对入参处理传入,kml_init_filter不支持用户显式调用。
场景 |
返回值 |
---|---|
输入图像深度、输出图像深度不为CV_16F或CV_32F |
1 |
卷积核通道数不等于1 |
1 |
传入OpenCV filter2D接口的边界填充类型不在以下列表中: BORDER_CONSTANT BORDER_REPLICATE BORDER_REFLECT BORDER_REFLECT_101 BORDER_REFLECT101 BORDER_DEFAULT BORDER_ISOLATED |
1 |
内部资源申请失败 |
-1 |
其余场景 |
0 |