数据类型和数据结构¶
SVP相关数据类型、数据结构定义如下:
ot_svp_img_type:定义二维广义图像支持的图像类型。
ot_svp_img:定义二维广义图像信息。
ot_svp_src_img:定义源图像。
ot_svp_dst_img:定义输出图像。
OT_SVP_IMG_ADDR_NUM:定义地址通道数目。
定点数据类型:
ot_svp_data:定义以byte为单位的二维图像信息。
ot_svp_src_data:定义以byte为单位的二维源数据信息。
ot_svp_dst_data:定义byte为单位的二维输出数据信息。
ot_svp_8bit:定义8bit数据联合体。
ot_svp_point_u16:定义u16bit的点信息结构体。
ot_svp_point_s16:定义s16bit的点信息结构体。
ot_svp_point_s25q7:定义s25q7表示的点信息结构体。
ot_svp_point_u14q2:定义u14q2表示的点信息结构体。
ot_svp_rect_u32:定义u16表示的矩形信息结构体。
ot_svp_rect_u16:定义u32表示的矩形信息结构体。
ot_svp_rect_s24q8:定义s24q8表示的矩形信息结构体。
ot_svp_lut:定义查找表结构体。
IVE相关数据类型、数据结构定义如下:
ot_ive_handle:定义IVE句柄。
OT_IVE_HIST_NUM:定义直方图统计bin数目。
OT_IVE_MAP_NUM:定义映射查找表项数目。
OT_IVE_MAX_RGN_NUM:定义最大连通区域数目。
OT_IVE_ST_MAX_CORNER_NUM:定义Shi-Tomasi-like角点最大数目。
OT_IVE_MASK_NUM:掩码mask数组长度
OT_IVE_ARR_RESERVED_NUM_TWO:保留字段数组长度2
OT_IVE_ARR_RESERVED_NUM_THREE:保留字段数组长度3
OT_IVE_ARR_RESERVED_NUM_EIGHT:保留字段数组长度8
OT_IVE_ARR_RESERVED_NUM_TWELVE:保留字段数组长度12
OT_IVE_ARR_RESERVED_NUM_FOURTEEN:保留字段数组长度14
OT_IVE_ARR_NUM_THREE:数组长度3
OT_IVE_ARR_NUM_EIGHT:数组长度8
OT_IVE_DEV_NAME_LENGTH:IVE设备名字的长度。
OT_IVE_DEV_DEFAULT_NODE_NUM:默认的IVE节点个数。
ot_ive_mod_param:IVE模块相关参数定义。
ot_ive_err_code:定义错误码。
ot_ive_dma_mode:定义DMA运算模式。
ot_ive_dma_ctrl:定义DMA控制信息。
ot_ive_filter_ctrl:定义模板滤波控制信息。
ot_ive_csc_mode:定义色彩空间转换模式。
ot_ive_csc_ctrl:定义色彩空间转换控制信息。
ot_ive_filter_and_csc_ctrl:定义模板滤波加色彩空间转换复合功能控制信息。
ot_ive_sobel_out_ctrl:定义sobel输出控制信息。
ot_ive_sobel_ctrl:定义sobel边缘提取控制信息。
ot_ive_mag_and_ang_out_ctrl:定义canny边缘幅值与角度计算的输出格式。
ot_ive_mag_and_ang_ctrl:定义canny边缘幅值和幅角计算的控制信息。
ot_ive_dilate_ctrl:定义膨胀控制信息。
ot_ive_erode_ctrl:定义腐蚀控制信息。
ot_ive_threshold_mode:定义图像二值化输出格式。
ot_ive_threshold_ctrl:定义图像二值化控制信息。
ot_ive_sub_mode:定义两图像相减输出格式。
ot_ive_sub_ctrl:定义两图像相减控制参数。
ot_ive_integ_out_ctrl:定义积分图输出控制参数。
ot_ive_integ_ctrl:定义积分图计算控制参数。
ot_ive_threshold_s16_mode:定义16bit有符号图像的阈值化模式。
ot_ive_threshold_s16_ctrl:定义16bit有符号图像的阈值化控制参数。
ot_ive_threshold_u16_mode:定义16bti无符号图像的阈值化模式。
ot_ive_threshold_u16_ctrl:定义16bit无符号图像的阈值化控制参数。
ot_ive_16bit_to_8bit_mode:定义16bit图像到8bit图像的转化模式。
ot_ive_16bit_to_8bit_ctrl:定义16bit图像到8bit图像的转化控制参数。
ot_ive_order_stats_filter_mode:定义顺序统计量滤波模式。
ot_ive_order_stats_filter_ctrl:定义顺序统计量滤波控制参数。
ot_ive_map_u8bit_lut_mem:定义Map U8C1→U8C1的查找表内存。
ot_ive_map_u16bit_lut_mem:定义Map U8C1→U16C1的查找表内存。
ot_ive_map_s16bit_lut_mem:定义Map U8C1→S16C1的查找表内存。
ot_ive_map_mode:定义Map的模式。
ot_ive_map_ctrl:定义Map控制参数。
ot_ive_equalize_hist_ctrl_mem:定义直方图均衡化辅助内存。
ot_ive_equalize_hist_ctrl:定义直方图均衡化控制参数。
ot_ive_add_ctrl:定义两图像的加权加控制参数。
ot_ive_ncc_dst_mem:定义NCC的输出内存信息。
ot_ive_rgn:定义连通区域信息。
ot_ive_ccblob:定义连通区域标记的输出信息。
ot_ive_ccl_mode:定义连通区域模式。
ot_ive_ccl_ctrl:定义连通区域标记控制参数。
ot_ive_gmm_ctrl:定义GMM背景建模的控制参数。
ot_ive_gmm2_sns_factor_mode:定义灵敏度系数模式。
ot_ive_gmm2_life_update_factor_mode:定义模型时长参数更新模式。
ot_ive_gmm2_ctrl:定义GMM2背景建模的控制参数。
ot_ive_canny_stack_size:定义Canny边缘前半部分计算时强边缘点栈大小结构体。
ot_ive_canny_hys_edge_ctrl:定义Canny边缘前半部分计算任务的控制参数。
ot_ive_lbp_compare_mode:定义LBP纹理计算控制参数。
ot_ive_lbp_ctrl:定义LBP纹理计算控制参数。
ot_ive_norm_grad_out_ctrl:定义归一化梯度信息计算任务输出控制枚举类型。
ot_ive_norm_grad_ctrl:定义归一化梯度信息计算控制参数。
ot_ive_lk_optical_flow_pyr_out_mode:定义金字塔LK光流计算输出模式。
ot_ive_lk_optical_flow_pyr_ctrl:定义金字塔LK光流计算控制参数。
ot_ive_st_max_eig_val:定义Shi-Tomas-like角点计算时最大角点响应值结构体。
ot_ive_st_cand_corner_ctrl:定义Shi-Tomas-like候选角点计算控制参数。
ot_ive_st_corner_info:定义Shi-Tomas-like角点计算输出的角点信息结构体。
ot_ive_st_corner_ctrl:定义Shi-Tomas-like角点筛选控制参数。
ot_ive_sad_mode:定义SAD计算模式。
ot_ive_sad_out_ctrl:定义SAD输出控制模式。
ot_ive_sad_ctrl:定义SAD控制参数。
ot_ive_resize_mode:定义Resize的模式。
ot_ive_resize_ctrl:定义Resize控制参数。
ot_ive_grad_fg_mode:定义梯度前景计算模式。
ot_ive_grad_fg_ctrl:定义计算梯度前景控制参数。
ot_ive_cand_bg_pixel:定义候选背景模型数据。
ot_ive_wrok_bg_pixel:定义工作背景模型数据。
ot_ive_bg_life:定义背景生命力数据。
ot_ive_bg_model_pixel:定义背景模型数据。
ot_ive_fg_status_data:定义前景状态数据。
ot_ive_bg_status_data:定义背景状态数据。
ot_ive_match_bg_model_ctrl:定义背景匹配控制参数。
ot_ive_update_bg_model_ctrl:定义背景更新控制参数。
ot_ive_ann_mlp_accurate:定义ann_mlp输入特征向量类型。
ot_ive_ann_mlp_actv_func:定义ann_mlp激活函数枚举类型。
ot_ive_ann_mlp_model:定义ann_mlp模型数据结构体。
ot_ive_svm_type:定义SVM类型。
ot_ive_svm_kernel_type:定义SVM核函数类型。
ot_ive_svm_model:定义SVM模型数据结构体。
ot_ive_cnn_actv_func:定义CNN激活函数枚举类型。
ot_ive_cnn_pooling:定义CNN汇聚操作枚举类型。
ot_ive_cnn_conv_pooling:定义CNN单层Conv-ReLU-Pooling运算包参数结构体。
ot_ive_cnn_fc_info:定义CNN全链接网络参数结构体。
ot_ive_cnn_model:定义CNN模型参数结构体。
ot_ive_cnn_ctrl:定义CNN预测任务的控制参数。
ot_ive_cnn_result:定义CNN单个样本预测结果结构体。
ot_ive_persp_trans_point_pair:定义透视变换点对结构体。
ot_ive_persp_trans_alg_mode:定义透视变换算法模式枚举。
ot_ive_persp_trans_csc_mode:定义透视变换色彩空间转换模式。
ot_ive_kcf_core_id:定义KCF的核ID。
ot_ive_persp_trans_ctrl:定义透视变换控制参数。
ot_ive_roi_info:定义目前区域信息参数。
ot_ive_kcf_proc_ctrl:定义跟踪处理控制参数。
ot_ive_list_head:定义链表头结构体参数。
ot_ive_kcf_obj:定义目标信息结构体参数。
ot_ive_kcf_obj_node:定义目标链表节点参数。
ot_ive_kcf_list_state:定义目标链表状态枚举类型。
ot_ive_kcf_obj_list:定义目标链表结构参数。
ot_ive_kcf_bbox:定义目标区域信息参数。
ot_ive_kcf_bbox_ctrl:定义目标区域信息控制参数。
ot_ive_hog_mode:定义HOG(Histogram of Oriented Gradient)特征存储模式枚举类型。
ot_ive_hog_ctrl:定义计算HOG(Histogram of Oriented Gradient)特征控制参数。
SVP相关数据类型、数据结构¶
ot_svp_img_type¶
【说明】
定义二维广义图像支持的图像类型。
【定义】
/* Img type */
typedef enum {
OT_SVP_IMG_TYPE_U8C1 = 0x0,
OT_SVP_IMG_TYPE_S8C1 = 0x1,
OT_SVP_IMG_TYPE_YUV420SP = 0x2, /* YUV420 SemiPlanar */
OT_SVP_IMG_TYPE_YUV422SP = 0x3, /* YUV422 SemiPlanar */
OT_SVP_IMG_TYPE_YUV420P = 0x4, /* YUV420 Planar */
OT_SVP_IMG_TYPE_YUV422P = 0x5, /* YUV422 planar */
OT_SVP_IMG_TYPE_S8C2_PACKAGE = 0x6,
OT_SVP_IMG_TYPE_S8C2_PLANAR = 0x7,
OT_SVP_IMG_TYPE_S16C1 = 0x8,
OT_SVP_IMG_TYPE_U16C1 = 0x9,
OT_SVP_IMG_TYPE_U8C3_PACKAGE = 0xa,
OT_SVP_IMG_TYPE_U8C3_PLANAR = 0xb,
OT_SVP_IMG_TYPE_S32C1 = 0xc,
OT_SVP_IMG_TYPE_U32C1 = 0xd,
OT_SVP_IMG_TYPE_S64C1 = 0xe,
OT_SVP_IMG_TYPE_U64C1 = 0xf,
OT_SVP_IMG_TYPE_BUTT
} ot_svp_img_type;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_svp_img¶
【说明】
定义二维广义图像信息。
【定义】
typedef struct {
td_u64 phys_addr[OT_SVP_IMG_ADDR_NUM]; /* RW;The physical address of the image */
td_u64 virt_addr[OT_SVP_IMG_ADDR_NUM]; /* RW;The virtual address of the image */
td_u32 stride[OT_SVP_IMG_STRIDE_NUM]; /* RW;The stride of the image */
td_u32 width; /* RW;The width of the image */
td_u32 height; /* RW;The height of the image */
ot_svp_img_type type; /* RW;The type of the image */
} ot_svp_img;
【成员】
phys_addr[OT_SVP_IMG_ADDR_NUM] |
|
virt_addr[OT_SVP_IMG_ADDR_NUM] |
|
stride[OT_SVP_IMG_STRIDE_NUM] |
|
【注意事项】
每种type下面的图像示意图请参考OT_SVP_IMG_TYPE_U8C1 \ OT_SVP_IMG_TYPE_S8C1 \ OT_SVP_IMG_TYPE_S16C1 \ OT_SVP_IMG_TYPE_U16C1 \ OT_SVP_IMG_TYPE_S32C1 \ OT_SVP_IMG_TYPE_U32C1 \ OT_SVP_IMG_TYPE_S64C1 \ OT_SVP_IMG_TYPE_U64C1 类型的ot_svp_img图像图~ OT_SVP_IMG_TYPE_U8C3_PLANAR类型的ot_svp_img图像图。
【相关数据及接口】
ot_svp_src_img¶
【说明】
定义源图像。
【定义】
typedef ot_svp_img ot_svp_src_img;
【成员】
无
【注意事项】
无
【相关数据及接口】
ot_svp_dst_img¶
【说明】
定义输出图像。
【定义】
typedef ot_svp_img ot_svp_dst_img;
【成员】
无
【注意事项】
无
【相关数据及接口】
OT_SVP_IMG_ADDR_NUM¶
【说明】
定义地址通道数目。
【定义】
#define OT_SVP_IMAE_ADDR_NUM 3
【成员】
无。
【注意事项】
无。
【相关数据类型及接口】
无。
OT_SVP_IMG_STRIDE_NUM¶
【说明】
定义跨度数组长度。
【定义】
#define OT_SVP_IMG_STRIDE_NUM 3
【成员】
无。
【注意事项】
无。
【相关数据类型及接口】
无。
定点数据类型¶
【说明】
定义定点化的数据类型。
【定义】
typedef unsigned char td_u0q8;
typedef unsigned char td_u1q7;
typedef unsigned char td_u5q3;
typedef unsigned char td_u3q5;
typedef unsigned short td_u0q16;
typedef unsigned short td_u4q12;
typedef unsigned short td_u6q10;
typedef unsigned short td_u8q8;
typedef unsigned short td_u9q7;
typedef unsigned short td_u12q4;
typedef unsigned short td_u14q2;
typedef unsigned short td_u5q11;
typedef unsigned short td_u1q15;
typedef unsigned short td_u2q14;
typedef td_u6q10 td_ufp16;
typedef short td_s9q7;
typedef short td_s14q2;
typedef short td_s1q15;
typedef unsigned int td_u22q10;
typedef unsigned int td_u25q7;
typedef unsigned int td_u21q11;
typedef unsigned int td_u14q18;
typedef unsigned int td_u8q24;
typedef unsigned int td_u4q28;
typedef int td_s25q7;
typedef int td_s16q16;
typedef int td_s14q18;
typedef int td_s20q12;
typedef int td_s24q8;
typedef unsigned short td_u8q4f4;
【成员】
【注意事项】
td_uxqyfz\td_sxqy:
u后面的数字x表示是用x bit无符号数据表示整数部分;
s后面的数字x表示用x bit有符号数据表示整数部分;
q后面的数字y表示用y bit 数据表示小数部分;
f后面的数字z表示用z bit 来表示标志位;
从左到右依次表示高bit位到低bit位。
【相关数据类型及接口】
无。
ot_svp_data¶
【说明】
定义以byte为单位的二维数据信息。
【定义】
typedef struct {
td_u64 phys_addr; /* RW;The physical address of the data */
td_u64 virt_addr; /* RW;The virtaul address of the data */
td_u32 stride; /* RW;The stride of 2D data by byte */
td_u32 width; /* RW;The width of 2D data by byte */
td_u32 height; /* RW;The height of 2D data by byte */
td_u32 reserved;
} ot_svp_data;
【成员】
【注意事项】
表示以byte为单位的二维数据;可以与ot_svp_img图像进行转换。
【相关数据类型及接口】
无。
ot_svp_src_data¶
【说明】
定义以byte为单位的二维源数据信息。
【定义】
typedef ot_svp_data ot_svp_src_data;
【成员】
无。
【注意事项】
无。
【相关数据类型及接口】
ot_svp_dst_data¶
【说明】
定义byte为单位的二维输出数据信息。
【定义】
typedef ot_svp_data ot_svp_dst_data;
【成员】
无。
【注意事项】
无。
【相关数据类型及接口】
ot_svp_8bit¶
【说明】
定义8bit数据联合体。
【定义】
typedef union {
td_s8 s8_val;
td_u8 u8_val;
} ot_svp_8bit;
【成员】
【注意事项】
无
【相关数据类型及接口】
无
ot_svp_point_u16¶
【说明】
定义u16表示的点信息结构体。
【定义】
typedef struct {
td_u16 x; /* RW;The X coordinate of the point */
td_u16 y; /* RW;The Y coordinate of the point */
} ot_svp_point_u16;
【成员】
【注意事项】
无
【相关数据类型及接口】
无
ot_svp_point_s16¶
【说明】
定义s16表示的点信息结构体。
【定义】
typedef struct {
td_s16 x; /* RW;The X coordinate of the point */
td_s16 y; /* RW;The Y coordinate of the point */
} ot_svp_point_s16;
【成员】
【注意事项】
无
【相关数据类型及接口】
无
ot_svp_point_s25q7¶
【说明】
定义s25q7表示的点信息结构体。
【定义】
typedef struct {
td_s25q7 x; /* RW;The X coordinate of the point */
td_s25q7 y; /* RW;The Y coordinate of the point */
} ot_svp_point_s25q7;
【成员】
【注意事项】
无
【相关数据类型及接口】
无
ot_svp_point_u14q2¶
【说明】
定义u14q2表示的点信息结构体。
【定义】
typedef struct {
td_u14q2 x;
td_u14q2 y;
} ot_svp_point_u14q2;
【成员】
【注意事项】
无
【相关数据类型及接口】
无
ot_svp_rect_u32¶
【说明】
定义u32表示的矩形信息结构体。
【定义】
typedef struct {
td_u32 x; /* RW;The location of X axis of the rectangle */
td_u32 y; /* RW;The location of Y axis of the rectangle */
td_u32 width; /* RW;The width of the rectangle */
td_u32 height; /* RW;The height of the rectangle */
} ot_svp_rect_u32;
【成员】
【注意事项】
无
【相关数据类型及结构】
无
ot_svp_rect_u16¶
【说明】
定义u16表示的矩形信息结构体。
【定义】
typedef struct {
td_u16 x; /* RW;The location of X axis of the rectangle */
td_u16 y; /* RW;The location of Y axis of the rectangle */
td_u16 width; /* RW;The width of the rectangle */
td_u16 height; /* RW;The height of the rectangle */
} ot_svp_rect_u16;
【成员】
【注意事项】
无
【相关数据类型及结构】
无
ot_svp_rect_s24q8¶
【说明】
定义s24q8表示的矩形信息结构体。
【定义】
typedef struct {
td_s24q8 x;
td_s24q8 y;
td_u32 width;
td_u32 height;
} ot_svp_rect_s24q8;
【成员】
【注意事项】
无
【相关数据类型及结构】
无
ot_svp_lut¶
【说明】
定义查找表结构体。
【定义】
typedef struct {
ot_svp_mem_info table;
td_u16 elem_num; /* RW;LUT's elements number */
td_u8 table_in_precision;
td_u8 table_out_norm;
td_s32 table_in_lower; /* RW;LUT's original input lower limit */
td_s32 table_in_upper; /* RW;LUT's original input upper limit */
} ot_svp_lut;
【成员】
建立查找表的精度,(table_in_upper - table_in_lower)/(1<< table_in_precision)表示建立查找表的间隔 |
|
【注意事项】
无
【相关数据类型及结构】
无
IVE相关数据类型、数据结构¶
ot_ive_handle¶
【说明】
定义IVE句柄。
【定义】
typedef td_s32 ot_ive_handle;
【成员】
无。
【注意事项】
无。
【相关数据类型及接口】
无。
OT_IVE_HIST_NUM¶
【说明】
定义直方图统计bin数目。
【定义】
#define OT_IVE_HIST_NUM 256
【成员】
无。
【注意事项】
无。
【相关数据类型及接口】
无。
OT_IVE_MAP_NUM¶
【说明】
定义映射查找表项数目。
【定义】
#define OT_IVE_MAP_NUM 256
【成员】
无。
【注意事项】
无。
【相关数据类型及接口】
无。
OT_IVE_MAX_RGN_NUM¶
【说明】
定义最大连通区域数目。
【定义】
#define OT_IVE_MAX_RGN_NUM 254
【成员】
无。
【注意事项】
无。
【相关数据类型及接口】
无。
OT_IVE_ST_MAX_CORNER_NUM¶
【说明】
定义Shi-Tomasi-like角点最大数目。
【定义】
#define OT_IVE_ST_MAX_CORNER_NUM 500
【成员】
无。
【注意事项】
无。
【相关数据类型及接口】
无。
OT_IVE_MASK_NUM¶
【说明】
掩码mask对应的数组长度。
【定义】
#define OT_IVE_MASK_NUM 25
【成员】
无
【相关数据类型及接口】
无
OT_IVE_ARR_RESERVED_NUM_TWO¶
【说明】
保留字段数组长度2。
【定义】
#define OT_IVE_ARR_RESERVED_NUM_TWO 2
【成员】
无
【相关数据类型及接口】
无
OT_IVE_ARR_RESERVED_NUM_THREE¶
【说明】
保留字段数组长度3。
【定义】
#define OT_IVE_ARR_RESERVED_NUM_THREE 3
【成员】
无
【相关数据类型及接口】
无
OT_IVE_ARR_RESERVED_NUM_EIGHT¶
【说明】
保留字段数组长度8。
【定义】
#define OT_IVE_ARR_RESERVED_NUM_EIGHT 8
【成员】
无
【相关数据类型及接口】
无
OT_IVE_ARR_RESERVED_NUM_TWELVE¶
【说明】
保留字段数组长度12。
【定义】
#define OT_IVE_ARR_RESERVED_NUM_TWELVE 12
【成员】
无
【相关数据类型及接口】
无
OT_IVE_ARR_RESERVED_NUM_FOURTEEN¶
【说明】
保留字段数组长度14。
【定义】
#define OT_IVE_ARR_RESERVED_NUM_FOURTEEN 14
【成员】
无
【相关数据类型及接口】
无
OT_IVE_ARR_NUM_THREE¶
【说明】
数组长度3。
【定义】
#define OT_IVE_ARR_NUM_THREE 3
【成员】
无
【相关数据类型及接口】
无
OT_IVE_ARR_NUM_EIGHT¶
【说明】
数组长度8。
【定义】
#define OT_IVE_ARR_NUM_EIGHT 8
【成员】
无
【相关数据类型及接口】
无
OT_IVE_DEV_NAME_LENGTH¶
【说明】
IVE设备名字的长度。
【定义】
#define OT_IVE_DEV_NAME_LENGTH 10
【成员】
无
【相关数据类型及接口】
无
OT_IVE_DEV_DEFAULT_NODE_NUM¶
【说明】
默认的IVE节点个数。
【定义】
#define OT_IVE_DEFAULT_NODE_NUM 512
【成员】
无
【相关数据类型及接口】
无
ot_ive_mod_param¶
【说明】
IVE模块相关参数定义。
【定义】
typedef struct {
td_u16 mod_node_num;
td_u8 power_save_en;
} ot_ive_mod_param;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ive_std_mod_init
ot_ive_err_code¶
【说明】
定义错误码。
【定义】
typedef enum {
OT_IVE_ERR_SYS_TIMEOUT = 0x40, /* IVE process timeout */
OT_IVE_ERR_QUERY_TIMEOUT = 0x41, /* IVE query timeout */
OT_IVE_ERR_BUS_ERR = 0x42, /* IVE BUS error */
OT_IVE_ERR_OPEN_FILE = 0x43, /* IVE open file error */
OT_IVE_ERR_READ_FILE = 0x44, /* IVE read file error */
OT_IVE_ERR_BUTT
} ot_ive_err_code;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_dma_mode¶
【说明】
定义dma操作模式。
【定义】
typedef enum {
OT_IVE_DMA_MODE_DIRECT_COPY = 0x0,
OT_IVE_DMA_MODE_INTERVAL_COPY = 0x1,
OT_IVE_DMA_MODE_SET_3BYTE = 0x2,
OT_IVE_DMA_MODE_SET_8BYTE = 0x3,
OT_IVE_DMA_MODE_BUTT
} ot_ive_dma_mode;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_dma_ctrl¶
【说明】
定义dma控制信息。
【定义】
typedef struct {
ot_ive_dma_mode mode;
td_u64 val;
td_u8 hor_seg_size;
td_u8 elem_size;
td_u8 ver_seg_rows;
} ot_ive_dma_ctrl
【成员】
仅间隔拷贝模式使用,将每ver_seg_rows行中第一行数据分割为hor_seg_size大小的段,拷贝每段中的前elem_size大小的字节 |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_filter_ctrl¶
【说明】
定义模板滤波控制信息。
【定义】
typedef struct {
td_s8 mask[OT_IVE_MASK_NUM]; /* Template parameter filter coefficient */
td_u8 norm; /* Normalization parameter, by right shift */
} ot_ive_filter_ctrl
【成员】
mask[OT_IVE_MASK_NUM] |
|
【注意事项】
通过配置不同的模板系数可以达到不同的滤波效果。
【相关数据类型及接口】
无。
ot_ive_csc_mode¶
【说明】
定义色彩空间转换模式。
【定义】
typedef enum {
OT_IVE_CSC_MODE_VIDEO_BT601_YUV_TO_RGB = 0x0, /* CSC: YUV_TO_RGB, video transfer mode, RGB value range [16, 235] */
OT_IVE_CSC_MODE_VIDEO_BT709_YUV_TO_RGB = 0x1, /* CSC: YUV_To_RGB, video transfer mode, RGB value range [16, 235] */
OT_IVE_CSC_MODE_PIC_BT601_YUV_TO_RGB = 0x2, /* CSC: YUV_TO_RGB, picture transfer mode, RGB value range [0, 255] */
OT_IVE_CSC_MODE_PIC_BT709_YUV_TO_RGB = 0x3, /* CSC: YUV_TO_RGB, picture transfer mode, RGB value range [0, 255] */
OT_IVE_CSC_MODE_PIC_BT601_YUV_TO_HSV = 0x4, /* CSC: YUV_TO_HSV, picture transfer mode, HSV value range [0, 255] */
OT_IVE_CSC_MODE_PIC_BT709_YUV_TO_HSV = 0x5, /* CSC: YUV_TO_HSV, picture transfer mode, HSV value range [0, 255] */
OT_IVE_CSC_MODE_PIC_BT601_YUV_TO_LAB = 0x6, /* CSC: YUV_TO_LAB, picture transfer mode, Lab value range [0, 255] */
OT_IVE_CSC_MODE_PIC_BT709_YUV_TO_LAB = 0x7, /* CSC: YUV_TO_LAB, picture transfer mode, Lab value range [0, 255] */
OT_IVE_CSC_MODE_VIDEO_BT601_RGB_TO_YUV = 0x8, /* CSC: RGB_TO_YUV, video transfer mode, YUV value range [0, 255] */
OT_IVE_CSC_MODE_VIDEO_BT709_RGB_TO_2YUV = 0x9, /* CSC: RGB_TO_YUV, video transfer mode, YUV value range [0, 255] */
OT_IVE_CSC_MODE_PIC_BT601_RGB_TO_YUV = 0xa, /* CSC: RGB_TO_YUV, picture transfer mode, Y:[16, 235],U\V:[16, 240] */
OT_IVE_CSC_MODE_PIC_BT709_RGB_TO_YUV = 0xb, /* CSC: RGB_TO_YUV, picture transfer mode, Y:[16, 235],U\V:[16, 240] */
OT_IVE_CSC_MODE_BUTT
} ot_ive_csc_mode
【成员】
【注意事项】
OT_IVE_CSC_MODE_VIDEO_BT601_YUV_TO_RGB和OT_IVE_CSC_MODE_VIDEO_BT709_YUV_TO_RGB模式,输出满足16≤R、G、B≤235。
OT_IVE_CSC_MODE_PIC_BT601_YUV_TO_RGB和OT_IVE_CSC_MODE_PIC_BT709_YUV_TO_RGB模式,输出满足0≤R、G、B≤255。
OT_IVE_CSC_MODE_PIC_BT601_YUV_TO_HSV和OT_IVE_CSC_MODE_PIC_BT709_YUV_TO_HSV模式,输出满足0≤H、S、V≤255。
OT_IVE_CSC_MODE_PIC_BT601_YUV_TO_LAB和OT_IVE_CSC_MODE_PIC_BT709_YUV_TO_LAB模式,输出满足0≤L、A、B≤255。
OT_IVE_CSC_MODE_VIDEO_BT601_RGB_TO_YUV和OT_IVE_CSC_MODE_VIDEO_BT709_RGB_TO_YUV模式,输出满足0≤Y、U、V≤255。
OT_IVE_CSC_MODE_PIC_BT601_RGB_TO_YUV和OT_IVE_CSC_MODE_PIC_BT709_RGB_TO_YUV模式,输出满足0≤Y≤235,0≤U、V≤240。
【相关数据类型及接口】
ot_ive_csc_ctrl¶
【说明】
定义色彩空间转换控制信息。
【定义】
typedef struct {
ot_ive_csc_mode mode; /* Working mode */
} ot_ive_csc_ctrl
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_filter_and_csc_ctrl¶
【说明】
定义模板滤波加色彩空间转换复合功能控制信息。
【定义】
typedef struct {
ot_ive_csc_mode mode; /* CSC working mode */
td_s8 mask[OT_IVE_MASK_NUM]; /* Template parameter filter coefficient */
td_u8 norm; /* Normalization parameter, by right shift */
} ot_ive_filter_and_csc_ctrl ;
【成员】
mask[OT_IVE_MASK_NUM] |
|
【注意事项】
仅支持YUV2RGB的4种模式。
【相关数据类型及接口】
ot_ive_sobel_out_ctrl¶
【说明】
定义sobel输出控制信息。
【定义】
typedef enum {
OT_IVE_SOBEL_OUT_CTRL_BOTH = 0x0, /* Output horizontal and vertical */
OT_IVE_SOBEL_OUT_CTRL_HOR = 0x1, /* Output horizontal */
OT_IVE_SOBEL_OUT_CTRL_VER = 0x2, /* Output vertical */
OT_IVE_SOBEL_OUT_CTRL_BUTT
} ot_ive_sobel_out_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_sobel_ctrl¶
【说明】
定义sobel-like梯度计算控制信息。
【定义】
typedef struct {
ot_ive_sobel_out_ctrl out_ctrl; /* Output format */
td_s8 mask[OT_IVE_MASK_NUM]; /* Template parameter */
} ot_ive_sobel_ctrl;
【成员】
mask[OT_IVE_MASK_NUM] |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_mag_and_ang_out_ctrl¶
【说明】
定义梯度幅值与角度计算的输出格式。
【定义】
typedef enum {
OT_IVE_MAG_AND_ANG_OUT_CTRL_MAG = 0x0,/* Only the magnitude is output.*/
OT_IVE_MAG_AND_ANG_OUT_CTRL_MAG_AND_ANG = 0x1, /* The magnitude and angle are output.*/
OT_IVE_MAG_AND_ANG_OUT_CTRL_BUTT
} ot_ive_mag_and_ang_out_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_mag_and_ang_ctrl¶
【说明】
定义梯度幅值和幅角计算的控制信息。
【定义】
typedef struct {
ot_ive_mag_and_ang_out_ctrl out_ctrl;
td_u16 threshld;
td_s8 mask[OT_IVE_MASK_NUM]; /* Template parameter. */
} ot_ive_mag_and_ang_ctrl;
【成员】
mask[OT_IVE_MASK_NUM] |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_dilate_ctrl¶
【说明】
定义膨胀控制信息。
【定义】
typedef struct {
td_u8 mask[OT_IVE_MASK_NUM]; /* The template parameter value must be 0 or 255. */
} ot_ive_dilate_ctrl;
【成员】
mask[OT_IVE_MASK_NUM] |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_erode_ctrl¶
【说明】
定义腐蚀控制信息。
【定义】
typedef struct {
td_u8 mask[OT_IVE_MASK_NUM]; /* The template parameter value must be 0 or 255. */
} ot_ive_erode_ctrl;
【成员】
mask[OT_IVE_MASK_NUM] |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_threshold_mode¶
【说明】
定义图像二值化输出格式。
【定义】
typedef enum {
OT_IVE_THRESHOLD_MODE_BINARY = 0x0, /* src_val <= low_thr, dst_val = min_val; src_val > low_threshold, dst_val = max_val. */
OT_IVE_THRESHOLD_MODE_TRUNC = 0x1, /* src_val <= low_threshold, dst_val = src_val; src_val > low_threshold, dst_val = max_val. */
OT_IVE_THRESHOLD_MODE_TO_MIN_VAL = 0x2, /* src_val <= low_threshold, dst_val = min_val; src_val > low_threshold, dst_val = src_val. */
OT_IVE_THRESHOLD_MODE_MIN_MID_MAX = 0x3, /* src_val <= low_threshold, dst_val = min_val; low_threshold < src_val <= high_threshold, dst_val = mid_val; src_val > high_threshold, dst_val = max_val. */
OT_IVE_THRESHOLD_MODE_ORIG_MID_MAX = 0x4, /* src_val <= low_threshold, dst_val = src_val; low_threshold < src_val <= high_threshold, dst_val = mid_val; src_val > high_threshold, dst_val = max_val. */
OT_IVE_THRESHOLD_MODE_MIN_MID_ORI = 0x5, /* src_val <= low_threshold, dst_val = min_val; low_threshold < src_val <= high_threshold, dst_val = mid_val; src_val > high_threshold, dst_val = src_val. */
OT_IVE_THRESHOLD_MODE_MIN_ORIG_MAX = 0x6, /* src_val <= low_threshold, dst_val = min_val; low_threshold < src_val <= high_threshold, dst_val = src_val; src_val > high_threshold, dst_val = max_val. */
OT_IVE_THRESHOLD_MODE_ORI_MID_ORIG = 0x7, /* src_val <= low_threshold, dst_val = src_val; low_threshold < src_val <= high_threshold, dst_val = mid_val; src_val > high_threshold, dst_val = src_val. */
OT_IVE_THRESHOLD_MODE_BUTT
} ot_ive_threshold_mode;
【成员】
【注意事项】
计算公式请参见ss_mpi_ive_threshold中的【注意】,示意图请参见threshold 8种阈值化模式示意图。
【相关数据类型及接口】
ot_ive_threshold_ctrl¶
【说明】
定义图像二值化控制信息。
【定义】
typedef struct {
ot_ive_threshold_mode mode;
td_u8 low_threshold; /* user-defined threshold, 0<=u8LowThr<=255 */
td_u8 high_threshold; /* user-defined threshold, if mode<OT_IVE_THRESHOLD_MODE_MIN_MID_MAX, high_threshold is not used,
else 0<=low_threshold<= high_threshold <=255; */
td_u8 min_val; /* Minimum value when tri-level thresholding */
td_u8 mid_val; /* Middle value when tri-level thresholding, if enMode<2, u32MidVal is not used; */
td_u8 max_val; /* Maxmum value when tri-level thresholding */
} ot_ive_thresh_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_sub_mode¶
【说明】
定义两图像相减输出格式。
【定义】
typedef enum {
OT_IVE_SUB_MODE_ABS = 0x0, /* Absolute value of the difference */
OT_IVE_SUB_MODE_SHIFT = 0x1, /* The output result is obtained by shifting the result one digit right to reserve the signed bit. */
OT_IVE_SUB_MODE_BUTT
} ot_ive_sub_mode;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_sub_ctrl¶
【说明】
定义两图像相减控制参数。
【定义】
typedef struct {
ot_ive_sub_mode mode;
} ot_ive_sub_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_integ_out_ctrl¶
【说明】
定义积分图输出控制参数。
【定义】
typedef enum ot_ive_integ_out_ctrl {
OT_IVE_INTEG_OUT_CTRL_COMBINE = 0x0,
OT_IVE_INTEG_OUT_CTRL_SUM = 0x1,
OT_IVE_INTEG_OUT_CTRL_SQRT_SUM = 0x2,
OT_IVE_INTEG_OUT_CTRL_BUTT
}ot_ive_integ_out_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_integ_ctrl¶
【说明】
定义积分图计算控制参数。
【定义】
typedef struct {
ot_ive_integ_out_ctrl out_ctrl;
} ot_ive_integ_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_threshold_s16_mode¶
【说明】
定义16bit有符号图像的阈值化模式。
【定义】
typedef enum {
OT_IVE_THRESHOLD_S16_MODE_S16_TO_S8_MIN_MID_MAX = 0x0,
OT_IVE_THRESHOLD_S16_MODE_S16_TO_S8_MIN_ORIG_MAX = 0x1,
OT_IVE_THRESHOLD_S16_MODE_S16_TO_U8_MIN_MID_MAX = 0x2,
OT_IVE_THRESHOLD_S16_MODE_S16_TO_U8_MIN_ORIG_MAX = 0x3,
OT_IVE_THRESHOLD_S16_MODE_BUTT
} ot_ive_threshold_s16_mode;
【成员】
【注意事项】
计算公式请参见ss_mpi_ive_threshold_s16中的【注意】,示意图请参见 threshold_s16 4种阈值化模式示意图。
【相关数据类型及接口】
ot_ive_threshold_s16_ctrl¶
【说明】
定义16bit有符号图像的阈值化控制参数。
【定义】
typedef struct {
ot_ive_threshold_s16_mode mode;
td_s16 low_threshold; /* User-defined threshold */
td_s16 high_threshold; /* User-defined threshold */
ot_svp_8bit min_val; /* Minimum value when tri-level thresholding */
ot_svp_8bit mid_val; /* Middle value when tri-level thresholding */
ot_svp_8bit max_val; /* Maxmum value when tri-level thresholding */
} ot_ive_threshold_s16_ctrl;
【成员】
【注意事项】
计算公式请参见ss_mpi_ive_threshold_s16中的【注意】,示意图请参见threshold_s16 4种阈值化模式示意图。
【相关数据类型及接口】
ot_ive_threshold_u16_mode¶
【说明】
定义16bti无符号图像的阈值化模式。
【定义】
typedef enum {
OT_IVE_THRESHOLD_U16_MODE_U16_TO_U8_MIN_MID_MAX = 0x0,
OT_IVE_THRESHOLD_U16_MODE_U16_TO_U8_MIN_ORIG_MAX = 0x1,
OT_IVE_THRESHOLD_U16_MODE_BUTT
} ot_ive_threshold_u16_mode;
【成员】
【注意事项】
计算公式请参见ss_mpi_ive_threshold_u16中的【注意】,示意图请参见threshold_u16 2种阈值化模式示意图。
【相关数据类型及接口】
ot_ive_threshold_u16_ctrl¶
【说明】
定义16bit无符号图像的阈值化控制参数。
【定义】
typedef struct {
ot_ive_threshold_u16_mode mode;
td_u16 low_threshold;
td_u16 high_threshold;
td_u8 min_val;
td_u8 mid_val;
td_u8 max_val;
} ot_ive_threshold_u16_ctrl;
【成员】
【注意事项】
计算公式请参见ss_mpi_ive_threshold_u16中的【注意】,示意图请参见threshold_u16 2种阈值化模式示意图。
【相关数据类型及接口】
ot_ive_16bit_to_8bit_mode¶
【说明】
定义16bit图像数据到8bit图像数据的的转化模式。
【定义】
typedef enum {
OT_IVE_16BIT_TO_8BIT_MODE_S16_TO_S8 = 0x0,
OT_IVE_16BIT_TO_8BIT_MODE_S16_TO_U8_ABS = 0x1,
OT_IVE_16BIT_TO_8BIT_MODE_S16_TO_U8_BIAS = 0x2,
OT_IVE_16BIT_TO_8BIT_MODE_U16_TO_U8 = 0x3,
OT_IVE_16BIT_TO_8BIT_MODE_BUTT
} ot_ive_16bit_to_8bit_mode;
【成员】
【注意事项】
计算公式请参见ss_mpi_ive_16bit_to_8bit中的【注意】,示意图请参见16bit_to_8bit 4种转换模式示意图。
【相关数据类型及接口】
ot_ive_16bit_to_8bit_ctrl¶
【说明】
定义16bit图像数据到8bit图像数据的转化控制参数。
【定义】
typedef struct {
ot_ive_16bit_to_8bit_mode mode;
td_u16 denominator;
td_u8 num;
td_s8 bias;
} ot_ive_16bit_to_8bit_ctrl;
【成员】
【注意事项】
计算公式请参见ss_mpi_ive_16bit_to_8bit中的【注意】,示意图请参见16bit_to_8bit 4种转换模式示意图。
num≤denominator,且den≠0;
【相关数据类型及接口】
ot_ive_order_stats_filter_mode¶
【说明】
定义顺序统计量滤波模式。
【定义】
typedef enum {
OT_IVE_ORDER_STATS_FILTER_MODE_MEDIAN = 0x0,
OT_IVE_ORDER_STATS_FILTER_MODE_MAX = 0x1,
OT_IVE_ORDER_STATS_FILTER_MODE_MIN = 0x2,
OT_IVE_ORD_STAT_FILTER_MODE_BUTT
} ot_ive_order_stats_filter_mode;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_order_stats_filter_ctrl¶
【说明】
定义顺序统计量滤波控制参数。
【定义】
typedef struct {
ot_ive_order_stats_filter_mode mode;
} ot_ive_order_stats_filter_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_map_u8bit_lut_mem¶
【说明】
定义map U8C1→U8C1的查找表内存。
【定义】
typedef struct {
td_u8 map[OT_IVE_MAP_NUM];
} ot_ive_map_u8bit_lut_mem;
【成员】
map[OT_IVE_MAP_NUM] |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_map_u16bit_lut_mem¶
【说明】
定义map U8C1→U16C1的查找表内存。
【定义】
typedef struct {
td_u16 map[OT_IVE_MAP_NUM];
} ot_ive_map_u16bit_lut_mem;
【成员】
map[OT_IVE_MAP_NUM] |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_map_s16bit_lut_mem¶
【说明】
定义map U8C1→U16C1的查找表内存。
【定义】
typedef struct {
td_s16 map[OT_IVE_MAP_NUM];
} ot_ive_map_s16bit_lut_mem;
【成员】
map[OT_IVE_MAP_NUM] |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_map_mode¶
【说明】
定义map的模式。
【定义】
typedef enum {
OT_IVE_MAP_MODE_U8 = 0x0,
OT_IVE_MAP_MODE_S16 = 0x1,
OT_IVE_MAP_MODE_U16 = 0x2,
OT_IVE_MAP_MODE_BUTT
} ot_ive_map_mode;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_map_ctrl¶
【说明】
定义map控制参数。
【定义】
typedef struct {
ot_ive_map_mode mode;
} ot_ive_map_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_equalize_hist_ctrl_mem¶
【说明】
定义直方图均衡化辅助内存。
【定义】
typedef struct {
td_u32 hist[OT_IVE_HIST_NUM];
td_u8 map[OT_IVE_MAP_NUM];
} ot_ive_equalize_hist_ctrl_mem;
【成员】
hist[OT_IVE_HIST_NUM] |
|
map[OT_IVE_MAP_NUM] |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_equalize_hist_ctrl¶
【说明】
定义直方图均衡化控制参数。
【定义】
typedef struct {
ot_svp_mem_info mem;
} ot_ive_equalize_hist_ctrl;
【成员】
需开辟sizeof(ot_ive_equalize_hist_ctrl_mem)字节大小的内存。 |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_add_ctrl¶
【说明】
定义两图像的加权加控制参数。
【定义】
typedef struct {
td_u0q16 x; /* x of "xA+yB" */
td_u0q16 y; /* y of "xA+yB" */
} ot_ive_add_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_ncc_dst_mem¶
【说明】
定义ncc的输出内存信息。
【定义】
typedef struct {
td_u64 num;
td_u64 quad_sum1;
td_u64 quad_sum2;
td_u8 reserved[OT_IVE_ARR_RESERVED_NUM_EIGHT];
} ot_ive_ncc_dst_mem;
【成员】
reserved[OT_IVE_ARR_RESERVED_NUM_EIGHT] |
【注意事项】
计算公式请参见ss_mpi_ive_ncc中的【注意】。
【相关数据类型及接口】
无。
ot_ive_rgn¶
【说明】
定义连通区域信息。
【定义】
typedef struct {
td_u32 area; /* Represented by the pixel number */
td_u16 left; /* Circumscribed rectangle left border */
td_u16 right; /* Circumscribed rectangle right border */
td_u16 top; /* Circumscribed rectangle top border */
td_u16 bottom; /* Circumscribed rectangle bottom border */
} ot_ive_rgn;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_ccblob_info¶
【说明】
定义连通区域统计信息在Memory中的存储信息。
【定义】
typedef union {
struct {
td_u32 cur_area_threshold: 23;/*Threshold of the result rgns' area*/
td_u32 label_status: 1; /*1: Labeled failed ; 0: Labeled successfully*/
td_u32 rgn_num: 8; /*Number of valid rgn, non-continuous stored*/
}bits;
td_u32 u32;
} ot_ive_ccblob_info;
【成员】
【注意事项】
cur_area_threshold:32bit中的前23bit表示有效区域的面积阈值。
label_status:32bit中的第24bit表示的是连通区域是否标记成功。
rgn_num:32bit中后8bit表示是有效连通区域的个数。
【相关数据类型及接口】
ss_mpi_ive_ccl
ot_ive_ccblob¶
【说明】
定义连通区域标记的输出信息。
【定义】
typedef struct {
ot_ive_ccblob_info info;
ot_ive_rgn rgn[OT_IVE_MAX_RGN_NUM]; /* Valid rgns with 'cur_area_thr>0' and 'label = array_index+1' */
} ot_ive_ccblob;
【成员】
rgn[OT_IVE_MAX_RGN_NUM] |
【注意事项】
无。
【相关数据类型及接口】
ss_mpi_ive_ccl
ot_ive_ccl_mode¶
【说明】
定义连通区域模式。
【定义】
typedef enum {
OT_IVE_CCL_MODE_4C = 0x0, /* 4-connected */
OT_IVE_CCL_MODE_8C = 0x1, /* 8-connected */
OT_IVE_CCL_MODE_BUTT
} ot_ive_ccl_mode;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_ccl_ctrl¶
【说明】
定义连通区域标记控制参数。
【定义】
typedef struct {
ot_ive_ccl_mode mode; /* Mode */
td_u16 init_area_threshold; /* Init threshold of rgn area */
td_u16 step; /* Increase area step for once */
} ot_ive_ccl_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_gmm_ctrl¶
【说明】
定义GMM背景建模的控制参数。
【定义】
typedef struct {
td_u22q10 noise_var; /* Initial noise Variance */
td_u22q10 max_var; /* Max Variance */
td_u22q10 min_var; /* Min Variance */
td_u0q16 learn_rate; /* Learning rate */
td_u0q16 bg_ratio; /* Background ratio */
td_u8q8 var_threshold; /* Variance Threshold */
td_u0q16 init_wgt; /* Initial Weight */
td_u8 model_num; /* Model number: 3 or 5 */
} ot_ive_gmm_ctrl;
【成员】
|
对灰度的GMM,对应OpenCV MOG中灰度模型中的noiseSigma * noiseSigma。 |
|
|
参考取值: if (frameNum<500) (1/frameNum)*((1<<16)-1);else ((1/500)*((1<<16)-1)。 |
|
【注意事项】
无。
【相关数据类型及接口】
无
ot_ive_gmm2_sns_factor_mode¶
【说明】
定义灵敏度系数模式。
【定义】
typedef enum {
OT_IVE_GMM2_SNS_FACTOR_MODE_GLOBAL = 0x0, /* Global sensitivity factor mode */
OT_IVE_GMM2_SNS_FACTOR_MODE_PIXEL = 0x1, /* Pixel sensitivity factor mode */
OT_IVE_GMM2_SNS_FACTOR_MODE_BUTT
} ot_ive_gmm2_sns_factor_mode;
【成员】
全局灵敏度系数模式,每个像素在模型匹配过程中,方差灵敏度使用ot_ive_gmm2_ctrl的global_sns_factor。 |
|
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_gmm2_life_update_factor_mode¶
【说明】
定义模型时长参数更新模式。
【定义】
typedef enum {
OT_IVE_GMM2_LIFE_UPDATE_FACTOR_MODE_GLOBAL = 0x0, /* Global life update factor mode */
OT_IVE_GMM2_LIFE_UPDATE_FACTOR_MODE_PIXEL = 0x1, /* Pixel life update factor mode */
OT_IVE_GMM2_LIFE_UPDATE_FACTOR_MODE_BUTT
} ot_ive_gmm2_life_update_factor_mode;
【成员】
模型时长参数全局更新模式,每个像素模型时长参数在更新时使用ot_ive_gmm2_ctrl的global_life_update_factor。 |
|
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_gmm2_ctrl¶
【说明】
定义GMM2背景建模的控制参数。
【定义】
typedef struct {
ot_ive_gmm2_sns_factor_mode sns_factor_mode; /* Sensitivity factor mode */
ot_ive_gmm2_life_update_factor_mode life_update_factor_mode; /* Life update factor mode */
td_u16 global_life_update_factor; /* Global life update factor (default: 4) */
td_u16 life_threshold; /* Life threshold (default: 5000) */
td_u16 freq_init_val; /* Initial frequency (default: 20000) */
td_u16 freq_reduce_factor; /* Frequency reduction factor (default: 0xFF00) */
td_u16 freq_add_factor; /* Frequency adding factor (default: 0xEF) */
td_u16 freq_threshold; /* Frequency threshold (default: 12000) */
td_u16 var_rate; /* Variation update rate (default: 1) */
td_u9q7 max_var; /* Max variation (default: (16 * 16)<<7) */
td_u9q7 min_var; /* Min variation (default: ( 8 * 8)<<7) */
td_u8 global_sns_factor; /* Global sensitivity factor (default: 8) */
td_u8 model_num; /* Model number (range: 1~5, default: 3) */
} ot_ive_gmm2_ctrl;
【成员】
灵敏度模式,默认全局模式。全局模式使用global_sns_factor作为灵敏度系数;像素模式使用ss_mpi_ive_gmm2中factor的低8bit值作为灵敏度系数。 |
|
模型时长更新模式,默认全局模式。全局模式使用glb_life_update_factor作为前进模型更新参数;像素模式使用ss_mpi_ive_gmm2中factor的高8bit值作为前进模型时长更新参数。 |
|
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_canny_stack_size¶
【说明】
定义Canny边缘前半部分计算时强边缘点栈大小结构体。
【定义】
typedef struct {
td_u32 stack_size; /* Stack size for output */
td_u8 reserved[OT_IVE_ARR_RESERVED_NUM_TWELVE]; /* For 16 byte align */
} ot_ive_canny_stack_size;
【成员】
reserved [OT_IVE_ARR_RESERVED_NUM_TWELVE] |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_canny_hys_edge_ctrl¶
【说明】
定义Canny边缘前半部分计算任务的控制参数。
【定义】
typedef struct {
ot_svp_mem_info mem;
td_u16 low_threshold;
td_u16 high_threshold;
td_s8 mask[OT_IVE_MASK_NUM];
} ot_ive_canny_hys_edge_ctrl;
【成员】
mask[OT_IVE_MASK_NUM] |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_lbp_compare_mode¶
【说明】
定义lbp计算的比较模式。
【定义】
typedef enum {
OT_IVE_LBP_COMPARE_MODE_NORMAL= 0x0, /* P(x)-P(center)>= bit_thr.s8Val, s(x)=1; else s(x)=0; */
OT_IVE_LBP_COMPARE_MODE_ABS= 0x1, /* Abs(P(x)-P(center))>=bit_thr.u8Val, s(x)=1; else s(x)=0; */
OT_IVE_LBP_COMPARE_MODE_BUTT
} ot_ive_lbp_compare_mode;
【成员】
【注意事项】
计算公式参考ss_mpi_ive_lbp中的【注意】,示意图请参考lbp计算公式示意图。
【相关数据类型及接口】
ot_ive_lbp_ctrl¶
【说明】
定义lbp纹理计算控制参数。
【定义】
typedef struct {
ot_ive_lbp_compare_mode mode;
ot_svp_8bit bit_threshold;
} ot_ive_lbp_ctrl;
【成员】
【注意事项】
计算公式参考ss_mpi_ive_lbp中的【注意】,示意图请参考lbp计算公式示意图。
【相关数据类型及接口】
ot_ive_norm_grad_out_ctrl¶
【说明】
定义归一化梯度信息计算任务输出控制枚举类型。
【定义】
typedef enum {
OT_IVE_NORM_GRAD_OUT_CTRL_HOR_AND_VER = 0x0,
OT_IVE_NORM_GRAD_OUT_CTRL_HOR = 0x1,
OT_IVE_NORM_GRAD_OUT_CTRL_VER = 0x2,
OT_IVE_NORM_GRAD_OUT_CTRL_COMBINE = 0x3,
OT_IVE_NORM_GRAD_OUT_CTRL_BUTT
} ot_ive_norm_grad_out_ctrl;
【成员】
输出梯度信息以package 存储(如OT_SVP_IMG_TYPE_S8C2_PACKAGE类型的ot_svp_img图像图)的HV图。 |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_norm_grad_ctrl¶
【说明】
定义归一化梯度信息计算控制参数。
【定义】
typedef struct {
ot_ive_norm_grad_out_ctrl out_ctrl;
td_s8 mask[OT_IVE_MASK_NUM];
td_u8 norm;
} ot_ive_norm_grad_ctrl;
【成员】
mask[OT_IVE_MASK_NUM] |
|
【注意事项】
无。
【相关数据类型及接口】
ot_ive_lk_optical_flow_pyr_out_mode¶
【说明】
定义金字塔LK光流计算输出模式。
【定义】
typedef enum {
OT_IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_NONE = 0, /* Output none */
OT_IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_STATUS = 1, /* Output status */
OT_IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_BOTH = 2, /* Output status and err */
OT_IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_BUTT
} ot_ive_lk_optical_flow_pyr_out_mode;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_lk_optical_flow_pyr_ctrl¶
【说明】
定义金字塔LK光流计算控制参数。
【定义】
typedef struct {
ot_ive_lk_optical_flow_pyr_out_mode out_mode;
td_bool use_init_flow; /* where to use initial flow */
td_u16 points_num; /* Number of the feature points,<=500 */
td_u8 max_level; /* 0<=max_level<=3 */
td_u0q8 min_eig_val_threshold; /* Minimum eigenvalue threshold */
td_u8 iter_cnt; /* Maximum iteration times, <=20 */
td_u0q8 eps; /* Used for exit criteria: dx^2 + dy^2 < eps */
} ot_ive_lk_optical_flow_pyr_ctrl;
【成员】
是否使用初始光流计算(next_pts是否需要初始化):TD_TRUE表示使用初始光流,TD_FALSE表示不适用初始光流。 |
|
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_st_max_eig_val¶
【说明】
定义Shi-Tomas-like角点计算时最大角点响应值结构体。
【定义】
typedef struct {
td_u16 max_eig_val; /* Shi-Tomasi second step output MaxEig */
td_u8 reserved[OT_IVE_ARR_RESERVED_NUM_FOURTEEN]; /* For 16 byte align */
} ot_ive_st_max_eig_val;
【成员】
reserved [OT_IVE_ARR_RESERVED_NUM_FOURTEEN] |
【注意事项】
无
【相关数据类型及接口】
无
ot_ive_st_cand_corner_ctrl¶
【说明】
定义Shi-Tomas-like候选角点计算控制参数。
【定义】
typedef struct {
ot_svp_mem_info mem;
td_u0q8 quality_level;
} ot_ive_st_cand_corner_ctrl;
【成员】
ShiTomasi角点质量控制参数,角点响应值小于 “quality_level *最大角点响应值”的点将直接被确认为非角点。 |
【注意事项】
无。
【相关数据类型及接口】
无
ot_ive_st_corner_info¶
【说明】
定义Shi-Tomas-like角点计算输出的角点信息结构体。
【定义】
typedef struct {
td_u16 corner_num;
ot_svp_point_u16 corner[OT_IVE_ST_MAX_CORNER_NUM];
} ot_ive_st_corner_info;
【成员】
corner [OT_IVE_ST_MAX_CORNER_NUM] |
【注意事项】
无
【相关数据类型及接口】
无
ot_ive_st_corner_ctrl¶
【说明】
定义Shi-Tomas-like角点筛选控制参数。
【定义】
typedef struct {
td_u16 max_corner_num;
td_u16 min_dist;
} ot_ive_st_corner_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_sad_mode¶
【说明】
定义SAD计算模式。
【定义】
typedef enum {
OT_IVE_SAD_MODE_MB_4X4 = 0x0, /* 4x4 */
OT_IVE_SAD_MODE_MB_8X8 = 0x1, /* 8x8 */
OT_IVE_SAD_MODE_MB_16X16 = 0x2, /* 16x16 */
OT_IVE_SAD_MODE_BUTT
} ot_ive_sad_mode;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_sad_out_ctrl¶
【说明】
定义SAD输出控制模式。
【定义】
typedef enum {
OT_IVE_SAD_OUT_CTRL_16BIT_BOTH = 0x0, /* Output 16 bit sad and thresh */
OT_IVE_SAD_OUT_CTRL_8BIT_BOTH = 0x1, /* Output 8 bit sad and thresh */
OT_IVE_SAD_OUT_CTRL_16BIT_SAD = 0x2, /* Output 16 bit sad */
OT_IVE_SAD_OUT_CTRL_8BIT_SAD = 0x3, /* Output 8 bit sad */
OT_IVE_SAD_OUT_CTRL_THRESHOLD = 0x4, /* Output thresh,16 bits sad */
OT_IVE_SAD_OUT_CTRL_BUTT
} ot_ive_sad_out_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_sad_ctrl¶
【说明】
定义SAD控制参数。
【定义】
typedef struct {
ot_ive_sad_mode mode;
ot_ive_sad_out_ctrl out_ctrl;
td_u16 threshold; /* src_val <= thr, dst_val = min_val; src_val > thr, dst_val = max_val. */
td_u8 min_val; /* Min value */
td_u8 max_val; /* Max value */
} ot_ive_sad_ctrl;
【成员】
|
|
【注意事项】
无
【相关数据类型及接口】
ot_ive_resize_mode¶
【说明】
定义resize的模式。
【定义】
typedef enum {
OT_IVE_RESIZE_MODE_LINEAR = 0x0, /* Bilinear interpolation */
OT_IVE_RESIZE_MODE_AREA = 0x1,
OT_IVE_RESIZE_MODE_BUTT
} ot_ive_resize_mode;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_resize_ctrl¶
【说明】
定义resize控制参数。
【定义】
typedef struct {
ot_ive_resize_mode mode;
ot_svp_mem_info mem;
td_u16 num;
} ot_ive_resize_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_grad_fg_mode¶
【说明】
定义梯度前景计算模式。
【定义】
typedef enum {
OT_IVE_GRAD_FG_MODE_USE_CUR_GRAD = 0x0,
OT_IVE_GRAD_FG_MODE_FIND_MIN_GRAD = 0x1,
OT_IVE_GRAD_FG_MODE_BUTT
} ot_ive_grad_fg_mode;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_grad_fg_ctrl¶
【说明】
定义计算梯度前景控制参数。
【定义】
typedef struct {
ot_ive_grad_fg_mode mode; /* Calculation mode */
td_u16 edw_factor; /* Edge width adjustment factor (range: 500 to 2000; default: 1000) */
td_u8 crl_coef_threshold; /* Gradient vector correlation coefficient threshold
(ranges: 50 to 100; default: 80) */
td_u8 mag_crl_threshold; /* Gradient amplitude threshold (range: 0 to 20; default: 4) */
td_u8 min_mag_diff; /* Gradient magnitude difference threshold (range: 2 to 8; default: 2) */
td_u8 noise_val; /* Gradient amplitude noise threshold (range: 1 to 8; default: 1) */
td_u8 edw_dark; /* Black pixels enable flag (range: 0 (no), 1 (yes); default: 1) */
} ot_ive_grad_fg_ctrl;
【成员】
梯度前景计算模式。参考ot_ive_grad_fg_mode。 |
|
【注意事项】
无。
【相关数据类型及接口】
ot_ive_cand_bg_pixel¶
【说明】
定义候选背景模型数据。
【定义】
typedef struct {
td_u8q4f4 mean; /* Candidate background grays value */
td_u16 start_time; /* Candidate Background start time */
td_u16 sum_access_time; /* Candidate Background cumulative access time */
td_u16 short_keep_time; /* Candidate background short hold time */
td_u8 chg_condition; /* Time condition for candidate background into the changing state */
td_u8 poten_bg_life; /* Potential background cumulative access time */
} ot_ive_cand_bg_pixel;
【成员】
【注意事项】
无
【相关数据类型及接口】
ot_ive_wrok_bg_pixel¶
【说明】
定义工作背景模型数据。
【定义】
typedef struct {
td_u8q4f4 mean; /* 0# background grays value */
td_u16 access_time; /* Background cumulative access time */
td_u8 prev_gray; /* Gray value of last pixel */
td_u5q3 diff_threshold; /* Differential threshold */
td_u8 access_flag; /* Background access flag */
td_u8 bg_gray[OT_IVE_ARR_NUM_THREE]; /* 1# ~ 3# background grays value */
} ot_ive_wrok_bg_pixel;
【成员】
bg_gray [OT_IVE_ARR_NUM_THREE] |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_bg_life¶
【说明】
定义背景生命力数据。
【定义】
typedef struct {
td_u8 work_bg_life[OT_IVE_ARR_NUM_THREE]; /* 1# ~ 3# background vitality */
td_u8 cand_bg_life; /* Candidate background vitality */
} ot_ive_bg_life;
【成员】
work_bg_life [OT_IVE_ARR_NUM_THREE] |
|
【注意事项】
无。
【相关数据类型及接口】
ot_ive_bg_model_pixel¶
【说明】
定义背景模型数据。
【定义】
typedef struct {
ot_ive_wrok_bg_pixel work_bg_pixel; /* Working background */
ot_ive_cand_bg_pixel cand_pixel; /* Candidate background */
ot_ive_bg_life bg_life; /* Background vitality */
} ot_ive_bg_model_pixel;
【成员】
【注意事项】
无
【相关数据类型及接口】
ot_ive_fg_status_data¶
【说明】
定义前景状态数据。
【定义】
typedef struct {
td_u32 pixel_num;
td_u32 sum_luma;
td_u8 reserved[OT_IVE_ARR_NUM_EIGHT];
} ot_ive_fg_status_data;
【成员】
reserved[OT_IVE_ARR_NUM_EIGHT] |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_bg_status_data¶
【说明】
定义背景状态数据。
【定义】
typedef struct {
td_u32 pixel_num;
td_u32 sum_luma;
td_u8 reserved[OT_IVE_ARR_NUM_EIGHT];
} ot_ive_bg_status_data;
【成员】
reserved[OT_IVE_ARR_NUM_EIGHT] |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_match_bg_model_ctrl¶
【说明】
定义背景匹配控制参数。
【定义】
typedef struct {
td_u32 cur_frame_num; /* Current frame timestamp, in frame units */
td_u32 prev_frame_num; /* Previous frame timestamp, in frame units */
td_u16 time_threshold; /* Potential background replacement time threshold range: 2 to 100 frames; default: 20) */
td_u8 diff_threshold_crl_coef; /* Correlation coefficients between differential threshold and gray value (range: 0 to 5; default: 0) */
td_u8 diff_max_threshold; /* Maximum of background differential threshold (range: 3 to 15; default: 6) */
td_u8 diff_min_threshold; /* Minimum of background differential threshold (range: 3 to 15; default: 4) */
td_u8 diff_threshold_inc; /* Dynamic Background differential threshold increment (range: 0 to 6; default: 0) */
td_u8 fast_learn_rate; /* Quick background learning rate (range: 0 to 4; default: 2) */
td_u8 detected_chg_rgn; /* Whether to detect change rgn (range: 0 (no), 1 (yes); default: 0) */
} ot_ive_match_bg_model_ctrl;
【成员】
【注意事项】
无
【相关数据类型及接口】
无
ot_ive_update_bg_model_ctrl¶
【说明】
定义背景更新控制参数。
【定义】
typedef struct {
td_u32 cur_frame_num; /* Current frame timestamp, in frame units */
td_u32 prev_check_time; /* The last time when background status is checked */
td_u32 frame_check_period; /* Background status checking period (range: 0 to 2000 frames; default: 50) */
td_u32 init_min_time; /* Background initialization shortest time
(range: 20 to 6000 frames; default: 100) */
td_u32 steady_bg_min_blend_time; /* Steady background integration shortest time (range: 20 to 6000 frames; default: 200) */
td_u32 steady_bg_max_blend_time; /* Steady background integration longest time (range: 20 to 40000 frames; default: 1500) */
td_u32 dynamic_bg_min_blend_time; /* Dynamic background integration shortest time (range: 0 to 6000 frames; default: 0) */
td_u32 static_detection_min_time; /* Still detection shortest time (range: 20 to 6000 frames; default: 80) */
td_u16 fg_max_fade_time; /* Foreground disappearing longest time
(range: 1 to 255 seconds; default: 15) */
td_u16 bg_max_fade_time; /* Background disappearing longest time
(range: 1 to 255 seconds ; default: 60) */
td_u8 steady_bg_access_time_rate_thr; /* Steady background access time ratio threshold
(range: 10 to 100; default: 80) */
td_u8 chg_bg_access_time_rate_thr; /* Change background access time ratio threshold (range: 10 to 100; default: 60) */
td_u8 dynamic_bg_access_time_threshold; /* Dynamic background access time ratio threshold (range: 0 to 50; default: 0) */
td_u8 dynamic_bg_depth; /* Dynamic background depth (range: 0 to 3; default: 3) */
td_u8 bg_eff_state_rate_threshold; /* Background state time ratio threshold when initializing (range: 90 to 100; default: 90) */
td_u8 acc_bg_learn; /* Whether to accelerate background learning (range: 0 (no), 1 (yes); default: 0) */
td_u8 detected_chg_rgn; /* Whether to detect change rgn (range: 0 (no), 1 (yes); default: 0) */
} ot_ive_update_bg_model_ctrl;
【成员】
【注意事项】
要求init_min_time≤ steady_bg_min_blend_time≤ steady_bg_max_blend_time。
【相关数据类型及接口】
无。
ot_ive_ann_mlp_accurate¶
【说明】
定义ann_mlp输入特征向量类型。
【定义】
typedef enum {
OT_IVE_ann_mlp_ACCURATE_SRC16_WGT16 = 0x0, /* input decimals' accurate 16 bit, weight 16bit */
OT_IVE_ann_mlp_ACCURATE_SRC14_WGT20 = 0x1, /* input decimals' accurate 14 bit, weight 20bit */
OT_IVE_ann_mlp_ACCURATE_BUTT
} ot_ive_ann_mlp_accurate;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_ann_mlp_actv_func¶
【说明】
定义ann_mlp激活函数枚举类型。
【定义】
typedef enum {
OT_IVE_ANN_MLP_ACTV_FUNC_IDENTITY = 0x0,
OT_IVE_ANN_MLP_ACTV_FUNC_SIGMOID_SYM = 0x1,
OT_IVE_ANN_MLP_ACTV_FUNC_GAUSSIAN = 0x2,
OT_IVE_ANN_MLP_ACTV_FUNC_BUTT
} ot_ive_ann_mlp_actv_func;
【成员】
【注意事项】
对应函数定义参见ss_mpi_ive_ann_mlp_predict中【注意】。
【相关数据类型及接口】
无。
ot_ive_ann_mlp_model¶
【说明】
定义ann_mlp模型数据结构体。
【定义】
typedef struct {
ot_ive_ann_mlp_actv_func actv_func;
ot_ive_ann_mlp_accurate accurate;
ot_svp_mem_info wgt;
td_u32 total_wgt_size;
td_u16 layer_cnt[OT_IVE_ARR_NUM_EIGHT]; /* 8 layers, including input and output layer */
td_u16 max_cnt; /* MaxCount<=1024 */
td_u8 layer_num; /* 2<layerNum<=8 */
td_u8 reserved;
} ot_ive_ann_mlp_model;
【成员】
layer_cnt[OT_IVE_ARR_NUM_EIGHT] |
输入层1层->隐含层若干层(至少1层,最多6层)->输出层1层,分别存储输入、输出层的特征维度(取值范围:[1, 256]),各隐藏层的神经元数目(取值范围:[2,256])。 |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_svm_type¶
【说明】
定义svm类型。
【定义】
typedef enum {
OT_IVE_SVM_TYPE_C_SVC = 0x0,
OT_IVE_SVM_TYPE_NU_SVC = 0x1,
OT_IVE_SVM_TYPE_BUTT
} ot_ive_svm_type;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_svm_kernel_type¶
【说明】
定义svm核函数类型。
【定义】
typedef enum {
OT_IVE_SVM_KERNEL_TYPE_LINEAR = 0x0,
OT_IVE_SVM_KERNEL_TYPE_POLY = 0x1,
OT_IVE_SVM_KERNEL_TYPE_RBF = 0x2,
OT_IVE_SVM_KERNEL_TYPE_SIGMOID = 0x3,
OT_IVE_SVM_KERNEL_TYPE_BUTT
} ot_ive_svm_kernel_type;
【成员】
【注意事项】
对应核函数定义参见ss_mpi_ive_svm_predict中【注意】。
【相关数据类型及接口】
无。
ot_ive_svm_model¶
【说明】
定义svm模型数据结构体。
【定义】
typedef struct {
ot_ive_svm_type type;
ot_ive_svm_kernel_type kernel_type;
ot_svp_mem_info sv; /* SV memory */
ot_svp_mem_info df; /* Decision functions memory */
td_u32 total_df_size; /* All decision functions coef size in byte */
td_u16 feature_dim;
td_u16 sv_total;
td_u8 class_cnt;
} ot_ive_svm_model;
【成员】
|
取值范围:[1, 256]或[1, 1024],跟ss_mpi_ive_cnn_predict 中的输入特征向量维度一致。 |
|
【注意事项】
无。
【相关数据类型及接口】
ot_ive_cnn_actv_func¶
【说明】
定义CNN 激活函数枚举类型。
【定义】
typedef enum {
OT_IVE_CNN_ACTV_FUNC_NONE = 0x0, /* Do not taking a activation, equivalent f(x)=x */
OT_IVE_CNN_ACTV_FUNC_RELU = 0x1, /* f(x)=max(0, x) */
OT_IVE_CNN_ACTV_FUNC_SIGMOID = 0x2, /* f(x)=1/(1+exp(-x)), not support */
OT_IVE_CNN_ACTV_FUNC_BUTT
} ot_ive_cnn_actv_func;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_cnn_pooling¶
【说明】
定义CNN汇聚操作枚举类型。
【定义】
typedef enum {
OT_IVE_CNN_POOLING_NONE = 0x0, /* Do not taking a pooling action */
OT_IVE_CNN_POOLING_MAX = 0x1, /* Using max value of every pooling area */
OT_IVE_CNN_POOLING_AVG = 0x2, /* Using average value of every pooling area */
OT_IVE_CNN_POOLING_BUTT
} ot_ive_cnn_pooling;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_cnn_conv_pooling¶
【说明】
定义CNN单层Conv-ReLU-Pooling运算包参数结构体。
【定义】
typedef struct {
ot_ive_cnn_actv_func actv_func; /* Type of activation function */
ot_ive_cnn_pooling pooling; /* Mode of pooling method */
td_u8 feature_map_num; /* Number of feature maps */
td_u8 kernel_size; /* Kernel size, only support 3 currently */
td_u8 conv_step; /* Convolution step, only support 1 currently */
td_u8 pool_size; /* Pooling size, only support 2 currently */
td_u8 pool_step; /* Pooling step, only support 2 currently */
td_u8 reserved[OT_IVE_ARR_RESERVED_NUM_THREE];
} ot_ive_cnn_conv_pooling;
【成员】
【注意事项】
无。
【相关数据类型及接口】
ot_ive_cnn_fc_info¶
【说明】
定义CNN全链接网络参数结构体。
【定义】
typedef struct {
td_u16 layer_cnt[OT_IVE_ARR_NUM_EIGHT]; /* Neuron number of every fully connected layers */
td_u16 max_cnt; /* Max neuron number in all fully connected layers */
td_u8 layer_num; /* Number of fully connected layer */
td_u8 reserved;
} ot_ive_cnn_fc_info;
【成员】
layer_cnt[OT_IVE_ARR_NUM_EIGHT] |
全连接各层神经元节点数目。输入层(即Conv-ReLU-Pooling的输出)支持范围:[1, 1024];中间隐藏层支持范围:[2, 256];输出层支持范围:[1, 256]。 |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_cnn_model¶
【说明】
定义CNN模型参数结构体。
【定义】
typedef struct {
ot_ive_cnn_conv_pooling conv_pool[OT_IVE_ARR_NUM_EIGHT]; /* Conv-ReLU-Pooling layers info */
ot_ive_cnn_fc_info fc_info; /* Fully connected layers info */
ot_svp_mem_info conv_kernel_bias; /* Conv-ReLU-Pooling layers' kernels and bias */
td_u32 conv_kernel_bias_size; /* Size of Conv-ReLU-Pooling layer' kernels and bias */
ot_svp_mem_info fc_wgt_bias; /* Fully Connection Layers' weights and bias */
td_u32 fc_wgt_bias_size; /* Size of fully connection layers weights and bias */
td_u32 total_mem_size; /* Total memory size of all kernels, weights, bias */
ot_svp_img_type type; /* Image type used for the CNN model */
td_u32 width; /* Image width used for the model */
td_u32 height; /* Image height used for the model */
td_u16 class_cnt; /* Number of classes */
td_u8 conv_pool_layer_num; /* Number of Conv-ReLU-Pooling layers */
td_u8 reserved;
} ot_ive_cnn_model;
【成员】
conv_pool[OT_IVE_ARR_NUM_EIGHT] |
|
【注意事项】
CNN网络模型结构参考ss_mpi_ive_cnn_predict中的【注意】。
【相关数据类型及接口】
ot_ive_cnn_ctrl¶
【说明】
定义CNN预测任务的控制参数。
【定义】
typedef struct {
ot_svp_mem_info mem; /* Assist memory */
td_u32 num; /* Input img number */
} ot_ive_cnn_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_cnn_result¶
【说明】
定义CNN单个样本预测结果结构体。
【定义】
typedef struct {
td_s32 class_idx; /* The most possible index of the classification */
td_s32 conf; /* The confidence of the classification */
} ot_ive_cnn_result;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_persp_trans_point_pair¶
【说明】
定义透视变换点对结构体。
【定义】
typedef struct {
ot_svp_point_u14q2 src_point; /* Source point */
ot_svp_point_u14q2 dst_point; /* Destination point */
} ot_ive_persp_trans_point_pair;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_persp_trans_alg_mode¶
【说明】
定义透视变换算法模式枚举。
【定义】
typedef enum {
OT_IVE_PERSP_TRANS_ALG_MODE_NR_SIM = 0x0, /* Non-reflective similarity transform mode */
OT_IVE_PERSP_TRANS_ALG_MODE_SIM = 0x1, /* Reflective similarity transform mode */
OT_IVE_PERSP_TRANS_ALG_MODE_AFFINE = 0x2, /* Affine transform mode */
OT_IVE_PERSP_TRANS_ALG_MODE_BUTT
} ot_ive_persp_trans_alg_mode;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_persp_trans_csc_mode¶
【说明】
定义透视变换色彩空间转换模式。
【定义】
typedef enum {
OT_IVE_PERSP_TRANS_CSC_MODE_NONE = 0x0, /* No do csc */
OT_IVE_PERSP_TRANS_CSC_MODE_VIDEO_BT601_YUV_TO_RGB = 0x1, /* CSC: YUV2RGB, video transfer mode, RGB value range [16, 235] */
OT_IVE_PERSP_TRANS_CSC_MODE_VIDEO_BT709_YUV_TO_RGB = 0x2, /* CSC: YUV2RGB, video transfer mode, RGB value range [16, 235] */
OT_IVE_PERSP_TRANS_CSC_MODE_PIC_BT601_YUV_TO_RGB = 0x3, /* CSC: YUV2RGB, picture transfer mode, RGB value range [0, 255] */
OT_IVE_PERSP_TRANS_CSC_MODE_PIC_BT709_YUV_TO_RGB = 0x4, /* CSC: YUV2RGB, picture transfer mode, RGB value range [0, 255] */
OT_IVE_PERSP_TRANS_CSC_MODE_BUTT
} ot_ive_persp_trans_csc_mode;
【成员】
【注意事项】
OT_IVE_PERSP_TRANS_CSC_MODE_VIDEO_BT601_YUV_TO_RGB和OT_IVE_PERSP_TRANS_CSC_MODE_VIDEO_BT709_YUV_TO_RGB模式,输出满足16≤R、G、B≤235。
OT_IVE_PERSP_TRANS_CSC_MODE_PIC_BT601_YUV_TO_RGB和OT_IVE_PERSP_TRANS_CSC_MODE_PIC_BT709_YUV_TO_RGB模式,输出满足0≤R、G、B≤255。
【相关数据类型及接口】
无。
ot_ive_persp_trans_ctrl¶
【说明】
定义透视变换控制参数。
【定义】
typedef struct {
ot_ive_persp_trans_alg_mode alg_mode; /* Alg mode */
ot_ive_persp_trans_csc_mode csc_mode; /* CSC mode */
td_u16 roi_num; /* Roi number */
td_u16 point_pair_num; /* Point pair number */
} ot_ive_persp_trans_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_kcf_core_id¶
【说明】
定义KCF的核ID。
【定义】
定义1:
typedef enum {
OT_IVE_KCF_CORE0 = 0x0,
OT_IVE_KCF_CORE_BUTT
} ot_ive_kcf_core_id;
定义2:
typedef enum {
OT_IVE_KCF_CORE0 = 0x0,
OT_IVE_KCF_CORE1 = 0x1,
OT_IVE_KCF_CORE_BUTT
} ot_ive_kcf_core_id;
【成员】
【注意事项】
不同解决方案Kcf核数不一样,请具体参考发布包中ot_common_ive.h头文件中ot_ive_kcf_core_id定义。
【相关数据类型及接口】
ss_mpi_ive_kcf_proc
ss_mpi_ive_hog
ot_ive_roi_info¶
【说明】
定义目前区域信息参数。
【定义】
typedef struct {
ot_svp_rect_s24q8 roi;
td_u32 roi_id;
} ot_ive_roi_info;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_kcf_proc_ctrl¶
【说明】
定义跟踪处理控制参数。
【定义】
typedef struct {
ot_ive_csc_mode csc_mode; /* Only support:
IVE_CSC_MODE_VIDEO_BT601_YUV_TO_RGB CSC: YUV2RGB, video transfer mode,RGB value range [16, 235]
IVE_CSC_MODE_VIDEO_BT709_YUV_TO_RGB CSC: YUV2RGB, video transfer mode,RGB value range [16, 235]
IVE_CSC_MODE_PIC_BT601_YUV_TO_RGB CSC: YUV2RGB, picture transfer mode,RGB value range [0, 255]
IVE_CSC_MODE_PIC_BT709_YUV_TO_RGB CSC: YUV2RGB, picture transfer mode,RGB value range [0, 255] */
ot_svp_mem_info tmp_buf;
td_u1q15 interp_factor; /* Blend coefficient. [0, 32768] */
td_u0q16 lamda; /* The regularization coefficient. [0, 65535] */
td_u4q12 norm_trunc_alfa; /* The normalization thresh. [0, 4095] */
td_u0q8 sigma; /* The gaussian kernel bandwidth. [0, 255] */
td_u8 resp_threshold;
ot_ive_kcf_core_id core_id;
} ot_ive_kcf_proc_ctrl;
【成员】
【解决方案差异】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_list_head¶
【说明】
定义链表头结构体参数。
【定义】
typedef struct tag_ot_ive_list_head {
struct tag_ot_ive_list_head *next, *prev;
} ot_ive_list_head;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_kcf_obj¶
【说明】
定义目标信息结构体参数。
【定义】
typedef struct {
ot_ive_roi_info roi_info;
ot_svp_mem_info cos_win_x;
ot_svp_mem_info cos_win_y;
ot_svp_mem_info gauss_peak;
ot_svp_mem_info hog_feature;
ot_svp_mem_info alpha;
ot_svp_mem_info dst;
td_u3q5 padding; /* [48, 160] */
td_u8 reserved[OT_IVE_ARR_RESERVED_NUM_THREE];
} ot_ive_kcf_obj;
【成员】
reserved [OT_IVE_ARR_RESERVED_NUM_THREE] |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_kcf_obj_node¶
【说明】
定义目标链表节点参数。
【定义】
typedef struct {
ot_ive_list_head list;
ot_ive_kcf_obj kcf_obj;
} ot_ive_kcf_obj_node;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_kcf_list_state¶
【说明】
定义目标链表状态枚举类型。
【定义】
typedef enum {
OT_IVE_KCF_LIST_STATE_CREATE = 0x1,
OT_IVE_KCF_LIST_STATE_DESTORY = 0x2,
OT_IVE_KCF_LIST_STATE_BUTT
} ot_ive_kcf_list_state;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_kcf_obj_list¶
【说明】
定义目标链表结构参数。
【定义】
typedef struct {
ot_ive_kcf_obj_node *obj_node_buf; /* The object list node address */
ot_ive_list_head free_obj_list; /* The free list of object list */
ot_ive_list_head train_obj_list; /* The training list of object list */
ot_ive_list_head track_obj_list; /* The tracking list of object list */
td_u32 free_obj_num; /* The numbers of free list */
td_u32 train_obj_num; /* The numbers of training list */
td_u32 track_obj_num; /* The numbers of tracking list */
td_u32 max_obj_num; /* The maximum numbers of object list */
ot_ive_kcf_list_state list_state; /* The object list state */
td_u8 *tmp_buf; /* Assist buffer */
td_u32 width; /* image width */
td_u32 height; /* image height */
} ot_ive_kcf_obj_list;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_kcf_bbox¶
【说明】
定义目标区域信息参数。
【定义】
typedef struct {
ot_ive_kcf_obj_node *node;
td_s32 response; /* Bbox Response value. */
ot_ive_roi_info roi_info;
td_bool is_track_ok;
td_bool is_roi_refresh;
} ot_ive_kcf_bbox;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_kcf_bbox_ctrl¶
【说明】
定义目标区域信息控制参数。
【定义】
typedef struct {
td_u32 max_bbox_num; /* The member numbers of Bbox Array. */
td_s32 response_threshold; /* Select Bbox when Bbox'Response value is greater than or equal to RespThr. */
} ot_ive_kcf_bbox_ctrl;
【成员】
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_hog_mode¶
【说明】
定义HOG(Histogram of Oriented Gradient)特征存储模式枚举类型。
【定义】
typedef enum {
OT_IVE_HOG_MODE_VER_TANGENT_PLANE = 0x1,
OT_IVE_HOG_MODE_HOR_TANGENT_PLANE = 0x2,
OT_IVE_HOG_MODE_BUTT
} ot_ive_hog_mode;
【成员】
【注意事项】
无
【相关数据类型及接口】
ss_mpi_ive_hog
ot_ive_hog_ctrl¶
【说明】
定义计算HOG(Histogram of Oriented Gradient)特征控制参数。
【定义】
typedef struct {
ot_ive_csc_mode csc_mode; /* Only support:
IVE_CSC_MODE_VIDEO_BT601_YUV_TO_RGB CSC: YUV2RGB, video transfer mode,
RGB value range [16, 235]
IVE_CSC_MODE_VIDEO_BT709_YUV_TO_RGB CSC: YUV2RGB, video transfer mode,
RGB value range [16, 235]
IVE_CSC_MODE_PIC_BT601_YUV_TORGB CSC: YUV2RGB, picture transfer mode,
RGB value range [0, 255]
IVE_CSC_MODE_PIC_BT709_YUV_TO_RGB CSC: YUV2RGB, picture transfer mode,
RGB value range [0, 255] */
ot_ive_hog_mode hog_mode; /* Hog mode */
td_u32 roi_num; /* Roi number. [1, 64] */
td_u4q12 norm_trunc_alfa; /* The normalization thresh. [0, 4095] */
ot_ive_kcf_core_id core_id;
} ot_ive_hog_ctrl;
【成员】
【解决方案差异】
【注意事项】
无。
【相关数据类型及接口】
无。
错误码¶
IVE错误码¶
识别加速引擎API错误码如下所示。
表 1 识别加速引擎API错误码
Proc调试信息¶
概述¶
调试信息采用了Linux下的proc文件系统,可实时反映当前系统的运行状态,所记录的信息可供问题定位及分析时使用。
【文件目录】
/proc/umap
【信息查看方法】
在控制台上可以使用cat命令查看信息,cat /proc/umap/ive;也可以使用其他常用的文件操作命令,例如 cp /proc/umap/ive ./,将文件拷贝到当前目录。
在应用程序中可以将上述文件当作普通只读文件进行读操作,例如fopen、fread等。
说明: 参数在描述时有以下2种情况需要注意:
取值为{0, 1}的参数,如未列出具体取值和含义的对应关系,则参数为1时表示肯定,为0时表示否定。
取值为{aaa, bbb, ccc}的参数,未列出具体取值和含义的对应关系,但可直接根据取值aaa、bbb或ccc判断参数含义
Proc信息说明¶
【调试信息】
~ # cat /proc/umap/ive
[IVE] Version: [Vx.x.x.x B0xx Release], Build Time[Aug 2 2019, 10:08:05]
-------------------------------moudle param------------------------------
save_power max_node_num
0 20
-------------------------------ive queue info----------------------------
wait busy wait_cur_id wait_end_id busy_cur_id busy_end_id
1 -1 0 0 0 0
--------------------------------ive task info----------------------------
handle task_finish last_id task_id handle_wrap finish_wrap
5 5 0 0 0 0
-----------------------------------ive runtime info---------------------
last_inst cnt_per_sec max_cnt_per_sec total_int_cnt_last_sec
0 1 2 4
total_int_cnt qt_cnt st_cnt
5 0 0
cost_tm m_cost_tm cost_tm_per_sec m_cost_tm_per_sec
7 17 17 17
total_int_cost_tm last_task_hw_tm run_tm
64 20 20
----------------------------------------ive invoke info-----------------------------------------------------------------
dma filter csc filter_csc sobel mag_ang dilate erode
0 0 0 0 0 0 0 0
threshold and sub or integ hist thresh_s16 thresh_u16
0 0 0 0 0 0 0 0
16to8 ord_stat_filter bernsen map equal_hist add xor ncc
0 0 0 0 0 0 0 0
ccl gmm canny lbp norm_grad lk shitomasi grad_fg
0 0 0 0 0 0 0 0
match_mod update_mod radon ann svm adp_thr line_filter_h noise_remove_h
0 0 0 0 0 0 0 0
plate_char sad gmm2 resize cnn persp_trans
0 0 0 0 0 0
----------------------------------------kcf module param----------------------------------------------------------------
save_power max_node_num
1 128
----------------------------------------kcf queue info------------------------------------------------------------------
core_id wait busy wait_cur_id wait_end_id busy_cur_id busy_end_id
0 0 -1 0 0 0 0
1 0 -1 0 0 0 0
----------------------------------------kcf task info-------------------------------------------------------------------
core_id handle task_finish last_id task_id handle_wrap finish_wrap
0 0 384 0 63 0 0
1 0 0 0 0 0 0
----------------------------------------kcf runtime info----------------------------------------------------------------
core_id last_inst cnt_per_sec max_cnt_per_sec total_int_cnt_last_sec total_int_cnt qt_cnt
0 1 1 1 6 6 0
1 0 0 0 0 0 0
st_cnt cost_tm m_cost_tm cost_tm_per_sec m_cost_tm_per_sec total_int_cost_tm last_task_hw_tm
0 12 13 12 13 65 47566
0 0 0 0 0 0 0
run_tm
61
61
----------------------------------------kcf invoke info-----------------------------------------------------------------
core_id kcf hog
0 6 0
1 0 0
----------------------------------------ive utili info---------------------------------------------------
utili
26
【调试信息分析】
记录当前IVE工作状态资源信息和算子调用信息。
【参数说明】
【注意】
建议代码调试阶段关闭低功耗,调试完成再打开低功耗。
在非低功耗场景时,才会统计IVE硬件利用率。
FAQ¶
使用PC端IVE Clib与板端IVESDK开发算法的差异¶
表 1 使用PC端IVE Clib与板端IVE SDK开发算法的差异
使用IVE与OpenCV开发算法的区别¶
IVE与CPU异步,CPU必须查询IVE任务是否完成;用OpenCV开发算法不需要;
IVE的参数一般是定点化的,内部计算也是定点的;OpenCV一般是浮点的参数和计算;故同样的功能,IVE相比OpenCV有范围和精度上的限制。
IVE使用物理地址,且对起始地址以及跨度有对齐要求;OpenCV不需要物理地址,也无对齐要求;
IVE有软硬件分工,有些算子硬件实现一部分,软件实现一部分,也就是会有硬件+软件多个接口实现一个OpenCV算子的情况。
IVE算子的控制参数尽可能与OpenCV算子对齐,方便客户从OpenCV算子适配到IVE。例如金字塔LK光流计算控制参数ot_ive_lk_optical_flow_pyr_ctrl结构体内的成员变量与对应的OpenCV算子输入参数变量的含义是一一对齐的;对应的浮点转定点方式可以通过IVE算子参数变量的类型(例如td_u0q8)和sample样例中参数变量的赋值(例如0.1 * 256)来分析其转换关系。
若从OpenCV算子适配到IVE算子的开发过程中报错导致无法运行或结果与预期不一致,建议参考sample代码先检查IVE算子的输入是否配置完备、规格和数值范围是否符合规格要求;根据检查代码的报错打印和错误码确认问题范围和原因等。
ANN/SVM查找表的建立¶
说明: 以函数f(u)建立查找表为例,建立查找表的步骤如下(下面提到的table_in_lower,table_in_upper,table_in_precision,elem_num,table_out_norm,table请参ot_svp_lut结构体说明).
明确自变量u的范围:若u在[a, b]之间,假设r=b-a; a、b分别对应table_in_lower,table_in_upper;(ANN建表时u即为自变量u;svm建表时u对应
或者
,具体公式可参考ss_mpi_ive_ann_mlp_predict和ss_mpi_ive_svm_predict的【注意】)明确自变量1个单位的采样数g,则g=1<< table_in_precision;整个查找表的元素个数elem_num =r*g=r<< table_in_precision; (ANN和SVM均对查找表有最大数目限制要求,具体参考ss_mpi_ive_ann_mlp_predict和ss_mpi_ive_svm_predict的【注意】)
明确值域f(u)的范围,由于一般需要将值域约束到[-1, 1],这时候,可以使用table_out_norm或者1<<table_out_norm做除数来对f(u)做归一化;(ANN仅支持1<<table_out_norm做除数;SVM支持2种,所以ive_xml2bin_ui.exe中对svm的模型转换时要求输入divisor,且divisor必须与建立查找表的归一化除数一致)
根据f(u)的具体公式以及u的采样值,生成对应的f(u)查找表,保存在table中。
Cache内存的使用¶
内存开辟是否带cache,与算法软件对这片内存的使用主体相关。由于IVE是直接读取DDR内存数据,若此时使用的内存带有cache,必须刷cache来保证数据的一致性。所以若使用主体为IVE,CPU不使用或者仅使用一次,那么建议这片内存不带cache;若CPU是使用主体,建议这片内存带cache。
打开/关闭低功耗方法¶
IVE低功耗开关是通过模块参数传递。在加载IVE ko时把模块参数save_power值设为1(save_power=1),即可打开低功耗,反之为关闭低功耗。默认情况下是打开低功耗。



