数据类型和数据结构¶
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_TYPE_U8C1 |
每个像素用1个8bit无符号数据表示的单通道图像。请参见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_S8C1 |
每个像素用1个8bit有符号数据表示的单通道图像。请参见 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_YUV420SP |
YUV420 Semiplanar格式的图像。 请参见OT_SVP_IMG_TYPE_YUV420SP类型的ot_svp_img图像图。 |
OT_SVP_IMG_TYPE_YUV422SP |
YUV422 Semiplanar格式的图像。 请参见OT_SVP_IMG_TYPE_YUV422SP类型的ot_svp_img图像图。 |
OT_SVP_IMG_TYPE_YUV420P |
YUV420 Planar格式的图像。请参见OT_SVP_IMG_TYPE_YUV420P类型的ot_svp_img图像图。 |
OT_SVP_IMG_TYPE_YUV422P |
YUV422 Planar格式的图像。请参见OT_SVP_IMG_TYPE_YUV422P类型的ot_svp_img图像图。 |
OT_SVP_IMG_TYPE_S8C2_PACKAGE |
每个像素用2个8bit有符号数据表示,且以package格式存储2通道图像。 请参见OT_SVP_IMG_TYPE_S8C2_PACKAGE类型的ot_svp_img图像图。 |
OT_SVP_IMG_TYPE_S8C2_PLANAR |
每个像素用2个8bit有符号数据表示,且以planar格式存储2通道图像。 请参见OT_SVP_IMG_TYPE_S8C2_PLANAR类型的ot_svp_img图像图。 |
OT_SVP_IMG_TYPE_S16C1 |
每个像素用1个16bit有符号数据表示单通道图像。请参见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_U16C1 |
每个像素用1个16bit无符号数据表示单通道图像。请参见 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_PACKAGE |
每个像素用3个8bit无符号数据表示且以Package格式存储3通道图像。 请参见OT_SVP_IMG_TYPE_U8C3_PACKAGE类型的ot_svp_img图像图。 |
OT_SVP_IMG_TYPE_U8C3_PLANAR |
每个像素用3个8bit无符号数据表示1个像素的3通道图像,且以planar格式存储。 请参见 OT_SVP_IMG_TYPE_U8C3_PLANAR类型的ot_svp_img图像图。 |
OT_SVP_IMG_TYPE_S32C1 |
每个像素用1个32bit有符号数据表示单通道图像。请参见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_U32C1 |
每个像素用1个32bit无符号数据表示单通道图像。请参见 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_S64C1 |
每个像素用1个64bit有符号数据表示单通道图像。请参见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_U64C1 |
每个像素用1个64bit无符号数据表示单通道图像。请参见 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¶
【说明】
定义二维广义图像信息。
【定义】
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] |
广义图像的跨度。 |
width |
广义图像的宽度。 |
height |
广义图像的高度。 |
type |
广义图像的类型。 |
【注意事项】
每种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_u0q8 |
用0bit表示整数部分,8bit表示小数部分。文档中用UQ0.8来表示。 |
td_u1q7 |
用高1bit无符号数据表示整数部分,低7bit表示小数部分。文档中用UQ1.7来表示。 |
td_u5q3 |
用高5bit无符号数据表示整数部分,低3bit表示小数部分。文档中用UQ5.3来表示。 |
td_u3q5 |
用高3bit无符号数据表示整数部分,低5bit表示小数部分。文档中用UQ3.5来表示。 |
td_u0q16 |
用0bit表示整数部分,16bit表示小数部分。文档中用UQ0.16来表示。 |
td_u4q12 |
用高4bit无符号数据表示整数部分,低12bit表示小数部分。文档中用UQ4.12来表示。 |
td_u6q10 |
用高6bit无符号数据表示整数部分,低10bit表示小数部分。文档中用UQ6.10来表示。 |
td_u8q8 |
用高8bit无符号数据表示整数部分,低8bit表示小数部分。文档中用UQ8.8来表示。 |
td_u9q7 |
用高9bit无符号数据表示整数部分,低7bit表示小数部分。文档中用UQ9.7来表示。 |
td_u12q4 |
用高12bit无符号数据表示整数部分,低4bit表示小数部分。文档中用UQ12.4来表示。 |
td_u14q2 |
用高14bit无符号数据表示整数部分,低2bit表示小数部分。文档中用UQ14.2来表示。 |
td_u5q11 |
用高5bit无符号数据表示整数部分,低11bit表示小数部分。文档中用UQ5.11来表示。 |
td_u1q15 |
用高1bit无符号数据表示整数部分,低15bit表示小数部分。文档中用UQ1.15来表示。 |
td_u2q14 |
用高2bit无符号数据表示整数部分,低14bit表示小数部分。文档中用UQ2.14来表示。 |
td_ufp16 |
用高6bit无符号数据表示整数部分,低10bit表示小数部分。文档中用UQ6.10来表示。 |
td_s9q7 |
用高9bit有符号数据表示整数部分,低7bit表示小数部分。文档中用SQ9.7来表示。 |
td_s14q2 |
用高14bit有符号数据表示整数部分,低2bit表示小数部分。文档中用SQ14.2来表示。 |
td_s1q15 |
用高1bit有符号数据表示整数部分,低15bit表示小数部分。文档中用SQ1.15来表示。 |
td_u22q10 |
用高22bit无符号数据表示整数部分,低10bit表示小数部分。文档中用UQ22.10来表示。 |
td_u25q7 |
用高25bit无符号数据表示整数部分,低7bit表示小数部分。文档中用UQ25.7来表示。 |
td_u21q11 |
用高21bit无符号数据表示整数部分,低11bit表示小数部分。文档中用UQ21.11来表示。 |
td_u14q18 |
用高14bit无符号数据表示整数部分,低18bit表示小数部分。文档中用UQ14.18来表示。 |
td_u8q24 |
用高8bit无符号数据表示整数部分,低24bit表示小数部分。文档中用UQ8.24来表示。 |
td_u4q28 |
用高4bit无符号数据表示整数部分,低28bit表示小数部分。文档中用UQ4.28来表示。 |
td_s25q7 |
用高25bit有符号数据表示整数部分,低7bit表示小数部分。文档中用SQ25.7来表示。 |
td_s16q16 |
用高16bit有符号数据表示整数部分,低16bit表示小数部分。文档中用SQ16.16来表示。 |
td_s14q18 |
用高14bit有符号数据表示整数部分,低18bit表示小数部分。文档中用SQ14.18来表示。 |
td_s20q12 |
用高20bit有符号数据表示整数部分,低12bit表示小数部分。文档中用SQ20.12来表示。 |
td_s24q8 |
用高24bit有符号数据表示整数部分,低8bit表示小数部分。文档中用SQ24.8来表示。 |
td_u8q4f4 |
用高8bit无符号数据表示整数部分,中间4bit表示小数部分,低4bit表示标志位。文档中用UQF8.4.4来表示。 |
【注意事项】
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;
【成员】
成员名称 |
描述 |
|---|---|
phys_addr |
图像物理地址。 |
virt_addr |
图像虚拟地址。 |
stride |
图像跨度。 |
height |
图像高度。 |
width |
图像宽度。 |
reserved |
保留位。 |
【注意事项】
表示以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;
【成员】
成员名称 |
描述 |
|---|---|
s8_val |
有符号8bit值。 |
u8_val |
无符号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;
【成员】
成员名称 |
描述 |
|---|---|
x |
点的x坐标。 |
y |
点的y坐标。 |
【注意事项】
无
【相关数据类型及接口】
无
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;
【成员】
成员名称 |
描述 |
|---|---|
x |
点的x坐标。 |
y |
点的y坐标。 |
【注意事项】
无
【相关数据类型及接口】
无
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;
【成员】
成员名称 |
描述 |
|---|---|
x |
点的x坐标,以SQ25.7表示。 |
y |
点的y坐标,以SQ25.7表示。 |
【注意事项】
无
【相关数据类型及接口】
无
ot_svp_point_u14q2¶
【说明】
定义u14q2表示的点信息结构体。
【定义】
typedef struct {
td_u14q2 x;
td_u14q2 y;
} ot_svp_point_u14q2;
【成员】
成员名称 |
描述 |
|---|---|
x |
点的x坐标。 |
y |
点的y坐标。 |
【注意事项】
无
【相关数据类型及接口】
无
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;
【成员】
成员名称 |
描述 |
|---|---|
x |
矩形相对于坐标原点最近点的x坐标。 |
y |
矩形相对于坐标原点最近点的y坐标。 |
width |
矩形的宽。 |
height |
矩形的高。 |
【注意事项】
无
【相关数据类型及结构】
无
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;
【成员】
成员名称 |
描述 |
|---|---|
x |
矩形相对于坐标原点最近点的x坐标。 |
y |
矩形相对于坐标原点最近点的y坐标。 |
width |
矩形的宽。 |
height |
矩形的高。 |
【注意事项】
无
【相关数据类型及结构】
无
ot_svp_rect_s24q8¶
【说明】
定义s24q8表示的矩形信息结构体。
【定义】
typedef struct {
td_s24q8 x;
td_s24q8 y;
td_u32 width;
td_u32 height;
} ot_svp_rect_s24q8;
【成员】
成员名称 |
描述 |
|---|---|
x |
矩形相对于坐标原点最近点的x坐标。 |
y |
矩形相对于坐标原点最近点的y坐标。 |
width |
矩形的宽。 |
height |
矩形的高。 |
【注意事项】
无
【相关数据类型及结构】
无
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 |
查找表建立后的数据内存块信息。 |
elem_num |
查找表元素个数。 |
table_in_precision |
建立查找表的数值范围的下限。 |
table_out_norm |
建立查找表的数值范围的上限。 |
table_in_lower |
建立查找表的精度,(table_in_upper - table_in_lower)/(1<< table_in_precision)表示建立查找表的间隔 |
table_in_upper |
表示建立查找表时为将原始数据归一化进行移位的位数或者进行除法的除数。 |
【注意事项】
无
【相关数据类型及结构】
无
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;
【成员】
成员名称 |
描述 |
|---|---|
mod_node_num |
IVE节点个数,取值范围[20, 512]。 |
power_save_en |
低功耗标志,取值范围[0, 1]。 |
【注意事项】
无。
【相关数据类型及接口】
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_ERR_SYS_TIMEOUT |
系统超时。 |
OT_IVE_ERR_QUERY_TIMEOUT |
Query查询超时。 |
OT_IVE_ERR_BUS_ERR |
总线错误。 |
OT_IVE_ERR_OPEN_FILE |
打开文件失败。 |
OT_IVE_ERR_READ_FILE |
读文件失败。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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_MODE_DIRECT_COPY |
直接快速拷贝模式。 |
OT_IVE_DMA_MODE_INTERVAL_COPY |
间隔拷贝模式,请参见ss_mpi_ive_dma【注意】说明。 |
OT_IVE_DMA_MODE_SET_3BYTE |
3byte赋值模式,请参见ss_mpi_ive_dma【注意】说明。 |
OT_IVE_DMA_MODE_SET_8BYTE |
8byte赋值模式,请参见ss_mpi_ive_dma【注意】说明。 |
【注意事项】
无。
【相关数据类型及接口】
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
【成员】
成员名称 |
描述 |
|---|---|
mode |
dma操作模式。 |
val |
仅赋值模式使用,用于对内存赋值,3byte赋值模式用低3byte保存。 |
hor_seg_size |
仅间隔拷贝模式使用,水平方向将源图像一行分割的段大小。 取值范围:{2, 3, 4, 8, 16}。 |
elem_size |
仅间隔拷贝模式使用,分割的每一段中前elem_sizebyte为有效的拷贝字段。 取值范围:[1, hor_seg_size-1]。 |
ver_seg_rows |
仅间隔拷贝模式使用,将每ver_seg_rows行中第一行数据分割为hor_seg_size大小的段,拷贝每段中的前elem_size大小的字节 取值范围:[1, min{65535/src_stride, src_height}]。 |
【注意事项】
无。
【相关数据类型及接口】
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] |
5x5模板系数,外围系数设为0可实现3x3模板滤波。 |
norm |
归一化参数。 取值范围:[0, 13]。 |
【注意事项】
通过配置不同的模板系数可以达到不同的滤波效果。
【相关数据类型及接口】
无。
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 |
BT601的YUV_TO_RGB视频变换。 |
OT_IVE_CSC_MODE_VIDEO_BT709_YUV_TO_RGB |
BT709的YUV_TO_RGB视频变换。 |
OT_IVE_CSC_MODE_PIC_BT601_YUV_TO_RGB |
BT601的YUV_TO_RGB图像变换。 |
OT_IVE_CSC_MODE_PIC_BT709_YUV_TO_RGB |
BT709的YUV_TO_RGB图像变换。 |
OT_IVE_CSC_MODE_PIC_BT601_YUV_TO_HSV |
BT601的YUV_TO_HSV图像变换。 |
OT_IVE_CSC_MODE_PIC_BT709_YUV_TO_HSV |
BT709的YUV_TO_HSV图像变换。 |
OT_IVE_CSC_MODE_PIC_BT601_YUV_TO_LAB |
BT601的YUV_TO_LAB图像变换。 |
OT_IVE_CSC_MODE_PIC_BT709_YUV_TO_LAB |
BT709的YUV_TO_LAB图像变换。 |
OT_IVE_CSC_MODE_VIDEO_BT601_RGB_TO_YUV |
BT601的RGB_TO_YUV视频变换。 |
OT_IVE_CSC_MODE_VIDEO_BT709_RGB_TO_YUV |
BT709的RGB_TO_YUV视频变换。 |
OT_IVE_CSC_MODE_PIC_BT601_RGB_TO_YUV |
BT601的RGB_TO_YUV图像变换。 |
OT_IVE_CSC_MODE_PIC_BT709_RGB_TO_YUV |
BT709的RGB_TO_YUV图像变换。 |
【注意事项】
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
【成员】
成员名称 |
描述 |
|---|---|
mode |
工作模式。 |
【注意事项】
无。
【相关数据类型及接口】
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 ;
【成员】
成员名称 |
描述 |
|---|---|
mode |
工作模式。 |
mask[OT_IVE_MASK_NUM] |
5x5模板系数。 |
norm |
归一化参数。 取值范围:[0, 13]。 |
【注意事项】
仅支持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_OUT_CTRL_BOTH |
同时输出用模板和转置模板滤波的结果。 |
OT_IVE_SOBEL_OUT_CTRL_HOR |
仅输出用模板直接滤波的结果。 |
OT_IVE_SOBEL_OUT_CTRL_VER |
仅输出用转置模板滤波的结果。 |
【注意事项】
无。
【相关数据类型及接口】
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;
【成员】
成员名称 |
描述 |
|---|---|
out_ctrl |
输出控制枚举参数。 |
mask[OT_IVE_MASK_NUM] |
5x5模板系数。 |
【注意事项】
无。
【相关数据类型及接口】
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_OUT_CTRL_MAG |
仅输出幅值。 |
OT_IVE_MAG_AND_ANG_OUT_CTRL_MAG_AND_ANG |
同时输出幅值和角度值。 |
【注意事项】
无。
【相关数据类型及接口】
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;
【成员】
成员名称 |
描述 |
|---|---|
out_ctrl |
输出格式。 |
threshold |
用于对幅值进行阈值化的阈值。 |
mask[OT_IVE_MASK_NUM] |
5x5模板系数。 |
【注意事项】
无。
【相关数据类型及接口】
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] |
5x5模板系数。 取值范围:0或255。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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] |
5x5模板系数。 取值:0或255。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
OT_IVE_THRESHOLD_MODE_BINARY |
src_val ≤ low_threshold, dst_val = min_val; src_val > low_threshold, dst_val = max_val。 |
OT_IVE_THRESHOLD_MODE_TRUNC |
src_val ≤ low_threshold, dst_val = src_val; src_val > low_threshold, dst_val = max_val。 |
OT_IVE_THRESHOLD_MODE_TO_MIN_VAL |
src_val ≤low_threshold, dst_val = min_val; src_val > low_threshold, dst_val = src_val。 |
OT_IVE_THRESHOLD_MODE_MIN_MID_MAX |
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 |
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 |
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 |
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 |
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。 |
【注意事项】
计算公式请参见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;
【成员】
成员名称 |
描述 |
|---|---|
mode |
阈值化运算模式。 |
low_threshold |
低阈值。 取值范围:[0,255] |
high_threshold |
高阈值。 0≤low_thresholdesh≤high_thresholdesh≤255。 |
min_val |
最小值。 取值范围:[0,255] |
mid_val |
中间值。 取值范围:[0,255] |
max_val |
最大值。 取值范围:[0,255] |
【注意事项】
无。
【相关数据类型及接口】
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_MODE_ABS |
取差的绝对值。 |
OT_IVE_SUB_MODE_SHIFT |
将结果右移一位输出,保留符号位。 |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_sub_ctrl¶
【说明】
定义两图像相减控制参数。
【定义】
typedef struct {
ot_ive_sub_mode mode;
} ot_ive_sub_ctrl;
【成员】
成员名称 |
描述 |
|---|---|
mode |
两图像相减模式。 |
【注意事项】
无。
【相关数据类型及接口】
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_OUT_CTRL_COMBINE |
和、平方和积分图组合输出,如积分图(OT_SVP_IMG_TYPE_U64C1)组合输出示意图。 |
OT_IVE_INTEG_OUT_CTRL_SUM |
仅和积分图输出。 |
OT_IVE_INTEG_OUT_CTRL_SQRT_SUM |
仅平方和积分图输出。 |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_integ_ctrl¶
【说明】
定义积分图计算控制参数。
【定义】
typedef struct {
ot_ive_integ_out_ctrl out_ctrl;
} ot_ive_integ_ctrl;
【成员】
成员名称 |
描述 |
|---|---|
out_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;
【成员】
成员名称 |
描述 |
|---|---|
OT_IVE_THRESHOLD_S16_MODE_S16_TO_S8_MIN_MID_MAX |
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_S16_MODE_S16_TO_S8_MIN_ORIG_MAX |
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_S16_MODE_S16_TO_U8_MIN_MID_MAX |
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_S16_MODE_S16_TO_U8_MIN_ORIG_MAX |
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; |
【注意事项】
计算公式请参见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;
【成员】
成员名称 |
描述 |
|---|---|
mode |
阈值化运算模式。 |
low_threshold |
低阈值。 |
high_threshold |
高阈值。 |
min_val |
最小值。 |
mid_val |
中间值。 |
max_val |
最大值。 |
【注意事项】
计算公式请参见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;
【成员】
成员名称 |
描述 |
|---|---|
OT_IVE_THRESHOLD_U16_MODE_U16_TO_U8_MIN_MID_MAX |
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_U16_MODE_U16_TO_U8_MIN_ORIG_MAX |
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; |
【注意事项】
计算公式请参见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;
【成员】
成员名称 |
描述 |
|---|---|
mode |
阈值化运算模式。 |
low_threshold |
低阈值。 |
high_threshold |
高阈值。 |
min_val |
最小值。 取值范围:[0,255] |
mid_val |
中间值。 取值范围:[0,255] |
max_val |
最大值。 取值范围:[0,255] |
【注意事项】
计算公式请参见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;
【成员】
成员名称 |
描述 |
|---|---|
OT_IVE_16BIT_TO_8BIT_MODE_S16_TO_S8 |
S16数据到S8数据的线性变换。 |
OT_IVE_16BIT_TO_8BIT_MODE_S16_TO_U8_ABS |
S16数据线性变换到S8数据后取绝对值得到S8数据。 |
OT_IVE_16BIT_TO_8BIT_MODE_S16_TO_U8_BIAS |
S16数据线性变换到S8数据且平移后截断到U8数据。 |
OT_IVE_16BIT_TO_8BIT_MODE_U16_TO_U8 |
U16数据线性变换到U8数据。 |
【注意事项】
计算公式请参见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;
【成员】
成员名称 |
描述 |
|---|---|
mode |
16bit数据到8bit数据的转换模式。 |
denominator |
线性变换中的分母。 取值范围:[max{1,num}, 65535] |
num |
线性变换中的分子。 取值范围:[0,255]。 |
bias |
线性变换中的平移项。 取值范围:[-128,127]。 |
【注意事项】
计算公式请参见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_MODE_MEDIAN |
中值滤波。 |
OT_IVE_ORDER_STATS_FILTER_MODE_MAX |
最大值滤波,等价于灰度图的膨胀。 |
OT_IVE_ORDER_STATS_FILTER_MODE_MIN |
最小值滤波,等价于灰度图的腐蚀。 |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_order_stats_filter_ctrl¶
【说明】
定义顺序统计量滤波控制参数。
【定义】
typedef struct {
ot_ive_order_stats_filter_mode mode;
} ot_ive_order_stats_filter_ctrl;
【成员】
成员名称 |
描述 |
|---|---|
mode |
顺序统计量滤波模式。 |
【注意事项】
无。
【相关数据类型及接口】
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] |
map查找表数组。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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] |
map查找表数组。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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] |
map查找表数组。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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_MODE_U8 |
U8C1→U8C1 Map模式。 |
OT_IVE_MAP_MODE_S16 |
U8C1→S16C1 Map模式。 |
OT_IVE_MAP_MODE_U16 |
U8C1→U16C1 Map 模式 |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_map_ctrl¶
【说明】
定义map控制参数。
【定义】
typedef struct {
ot_ive_map_mode mode;
} ot_ive_map_ctrl;
【成员】
成员名称 |
描述 |
|---|---|
mode |
Map模式。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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] |
根据统计直方图计算得到的map查找表。 |
【注意事项】
无。
【相关数据类型及接口】
ot_ive_equalize_hist_ctrl¶
【说明】
定义直方图均衡化控制参数。
【定义】
typedef struct {
ot_svp_mem_info mem;
} ot_ive_equalize_hist_ctrl;
【成员】
成员名称 |
描述 |
|---|---|
mem |
需开辟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;
【成员】
成员名称 |
描述 |
|---|---|
x |
加权加“xA+yB”中的权重“x”。 |
y |
加权加“xA+yB”中的权重“y”。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
num |
NCC计算公式的分子-- |
quad_sum1 |
NCC计算公式的分母--根号内部分: NCC计算公式的分子-- |
quad_sum2 |
NCC计算公式的分母--根号内部分: NCC计算公式的分子-- |
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;
【成员】
成员名称 |
描述 |
|---|---|
area |
连通区域面积,以连通区域像素数目表示。 |
left |
连通区域外接矩形的最左边坐标。 |
right |
连通区域外接矩形的最右边坐标。 |
top |
连通区域外接矩形的最上面坐标。 |
bottom |
连通区域外接矩形的最下面坐标。 |
【注意事项】
无。
【相关数据类型及接口】
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 |
有效连通区域的面积阈值(23bit表示),rgn中面积小于这个阈值的都被置为0 |
label_status |
连通区域标记是否成功(1bit表示)。 -1:标记失败; 0:标记成功。 |
rgn_num |
有效连通区域个数(8bit表示)。 |
【注意事项】
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;
【成员】
成员名称 |
描述 |
|---|---|
info |
描述连通区域的相关信息。 |
rgn[OT_IVE_MAX_RGN_NUM] |
连通区域信息:有效的连通区域其面积大于0,对应标记为数组下标加1。 |
【注意事项】
无。
【相关数据类型及接口】
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_MODE_4C |
4-连通。 |
OT_IVE_CCL_MODE_8C |
8-连通。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
mode |
连通区域模式。 |
init_area_threshold |
初始面积阈值。 取值范围:[0, 65535] 参考取值:4。 |
step |
面积阈值增长步长。 取值范围:[1,65535] 参考取值:2。 |
【注意事项】
无。
【相关数据类型及接口】
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;
【成员】
成员名称 |
描述 |
|---|---|
noise_ver |
初始噪声方差。 取值范围:[0x1, 0xFFFFFF]。 对灰度的GMM,对应OpenCV MOG中灰度模型中的noiseSigma * noiseSigma。 参考取值:15*15*(1<<10)。 对RGB的GMM,对应OpenCV MOG中RGB模型中的 3 * noiseSigma * noiseSigma。 参考取值:3*15*15*(1<<10)。 |
max_var |
模型方差的最大值。 取值范围;[0x1, 0xFFFFFF]。 对应OpenCV MOG2中fVarMax。 参考取值:3*4000<<10 (RGB),2000<<10(灰度)。 |
min_var |
模型方差的最小值。 取值范围:[0x1, max_var]。 对应OpenCV MOG2中fVarMin。 参考取值:600<<10 (RGB),200<<10 (灰度)。 |
learn_rate |
学习速率。 取值范围:[1, 65535]。 对应OpenCV MOG2中learningRate。 参考取值: if (frameNum<500) (1/frameNum)*((1<<16)-1);else ((1/500)*((1<<16)-1)。 |
bg_ratio |
背景比例阈值。 取值范围:[1, 65535]。 对应OpenCV MOG中backgroundRatio。 参考取值:0.8*((1<<16)-1)。 |
var_threshold |
方差阈值。 取值范围:[1, 65535]。 对应OpenCV MOG中varThreshold,用于决定一个像素是否命中当前模型。 参考取值:6.25*(1<<8)。 |
init_wgt |
初始权重。 取值范围:[1, 65535]。 对应OpenCV MOG中的defaultInitialWeight。 参考取值:0.05*((1<<16)-1)。 |
model_num |
模型个数。 取值范围:{3,5}。 对应OpenCV MOG中nmixtures。 |
【注意事项】
无。
【相关数据类型及接口】
无
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_SNS_FACTOR_MODE_GLOBAL |
全局灵敏度系数模式,每个像素在模型匹配过程中,方差灵敏度使用ot_ive_gmm2_ctrl的global_sns_factor。 |
OT_IVE_GMM2_SNS_FACTOR_MODE_PIXEL |
像素级灵敏度系数模式,每个像素在模型匹配过程中,方差灵敏度使用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_LIFE_UPDATE_FACTOR_MODE_GLOBAL |
模型时长参数全局更新模式,每个像素模型时长参数在更新时使用ot_ive_gmm2_ctrl的global_life_update_factor。 |
OT_IVE_GMM2_LIFE_UPDATE_FACTOR_MODE_PIXEL |
模型时长参数像素级更新模式,每个像素模型时长在更新时使用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;
【成员】
成员名称 |
描述 |
|---|---|
sns_factor_mode |
灵敏度模式,默认全局模式。全局模式使用global_sns_factor作为灵敏度系数;像素模式使用ss_mpi_ive_gmm2中factor的低8bit值作为灵敏度系数。 |
life_update_factor_mode |
模型时长更新模式,默认全局模式。全局模式使用glb_life_update_factor作为前进模型更新参数;像素模式使用ss_mpi_ive_gmm2中factor的高8bit值作为前进模型时长更新参数。 |
global_life_update_factor |
全局模型更新参数,范围:[0, 65535],默认:4。 |
life_threshold |
背景模型生成时间,表示一个模型从前景模型转成背景模型需要的时间,范围:[0, 65535],默认:5000。 |
freq_init_val |
初始频率,范围:[0, 65535],默认:20000。 |
freq_redu_factor |
频率衰减系数,范围:[0, 65535],默认:0xFF00。 |
freq_add_factor |
模型匹配频率增加系数,范围:[0, 65535],默认:0xEF。 |
freq_threshold |
模型失效频率阈值,范围:[0, 65535],默认:12000。 |
var_rate |
方差更新率,范围:[0, 65535],默认:1。 |
max_var |
方差最大值,范围:[0, 65535],默认:(16x16)<<7。 |
min_var |
方差最小值,范围:0-方差最大值,默认:(8x8)<<7,必须小于max_var。 |
global_sns_factor |
全局灵敏度参数,范围:[0, 255],默认:8。 |
model_num |
模型数量,范围:[1, 5],默认:3。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
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;
【成员】
成员名称 |
描述 |
|---|---|
mem |
辅助内存。内存配置大小说明见ss_mpi_ive_canny_hys_edge的【注意】。 详细定义请见《SVPx.0 API参考》1.4小节。 |
low_threshold |
低阈值。 取值范围:[0,255] |
high_threshold |
高阈值。 取值范围:[low_threshold,255] |
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;
【成员】
成员名称 |
描述 |
|---|---|
OT_IVE_LBP_COMPARE_MODE_NORMAL |
LBP简单比较模式。 |
OT_IVE_LBP_COMPARE_MODE_ABS |
LBP绝对值比较模式。 |
【注意事项】
计算公式参考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;
【成员】
成员名称 |
描述 |
|---|---|
mode |
LBP比较模式。 |
bit_threshold |
LBP比较阈值。 OT_IVE_LBP_COMPARE_MODE_NORMAL下的取值范围:[-128,127]。 OT_IVE_LBP_COMPARE_MODE_ABS下的取值范围:[0,255]。 |
【注意事项】
计算公式参考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;
【成员】
成员名称 |
描述 |
|---|---|
OT_IVE_NORM_GRAD_OUT_CTRL_HOR_AND_VER |
同时输出梯度信息的H、V分量图(H、V定义见ss_mpi_ive_norm_grad的【参数】)。 |
OT_IVE_NORM_GRAD_OUT_CTRL_HOR |
仅输出梯度信息的H分量图。 |
OT_IVE_NORM_GRAD_OUT_CTRL_VER |
仅输出梯度信息的V分量图。 |
OT_IVE_NORM_GRAD_OUT_CTRL_COMBINE |
输出梯度信息以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;
【成员】
成员名称 |
描述 |
|---|---|
out_ctrl |
梯度信息输出控制模式。 |
mask[OT_IVE_MASK_NUM] |
计算梯度需要的模板。 |
norm |
归一化参数。 取值范围:[0, 13] |
【注意事项】
无。
【相关数据类型及接口】
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_OUT_MODE_NONE |
status以及err均不输出。 |
OT_IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_STATUS |
仅输出status。 |
OT_IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_BOTH |
同时输出status和err。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
out_mode |
status以及err的输出模式控制。 |
use_init_flow |
是否使用初始光流计算(next_pts是否需要初始化):TD_TRUE表示使用初始光流,TD_FALSE表示不适用初始光流。 |
points_num |
prev_pts、next_pts中特征点个数,同时也是status和err的数组大小。 取值范围:[1, 500]。 |
max_level |
max_level+1为金字塔层数相关。 取值范围:[0, 3],对应金字塔层数[1, 4]。 参考取值:2。 |
min_eig_val_threshold |
最小特征值阈值。 取值范围:[1, 255]。 |
iter_cnt |
最大迭代次数。 取值范围:[1, 20]。 |
eps |
迭代收敛条件:dx^2 + dy^2 < eps。 取值范围:[1, 255]。 参考取值:2。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
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;
【成员】
成员名称 |
描述 |
|---|---|
mem |
辅助内存。内存配置大小见ss_mpi_ive_st_cand_corner的【注意】。 详细定义请见《SVPx.0 API参考》 |
quality_level |
ShiTomasi角点质量控制参数,角点响应值小于 “quality_level *最大角点响应值”的点将直接被确认为非角点。 取值范围:[1, 255]。 参考取值:25。 |
【注意事项】
无。
【相关数据类型及接口】
无
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_num |
有效角点数目。 |
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;
【成员】
成员名称 |
描述 |
|---|---|
max_corner_num |
最大角点数目。 取值范围:[1, 500]。 |
min_dist |
相邻角点最小距离。 取值范围:[1, 255]。 参考取值:10。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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_MODE_MB_4X4 |
按4x4像素块计算SAD。 |
OT_IVE_SAD_MODE_MB_8X8 |
按8x8像素块计算SAD。 |
OT_IVE_SAD_MODE_MB_16X16 |
按16x16像素块计算SAD。 |
【注意事项】
无。
【相关数据类型及接口】
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_OUT_CTRL_16BIT_BOTH |
16 bit SAD图和阈值化图输出模式。 |
OT_IVE_SAD_OUT_CTRL_8BIT_BOTH |
8 bit SAD图和阈值化图输出模式。 |
OT_IVE_SAD_OUT_CTRL_16BIT_SAD |
16 bit SAD图输出模式。 |
OT_IVE_SAD_OUT_CTRL_8BIT_SAD |
8 bit SAD图输出模式。 |
OT_IVE_SAD_OUT_CTRL_THRESHOLD |
阈值化图输出模式。 |
【注意事项】
无。
【相关数据类型及接口】
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;
【成员】
成员名称 |
描述 |
|---|---|
mode |
SAD计算模式。 |
out_ctrl |
SAD输出控制模式。 |
threshold |
对计算的SAD图进行阈值化的阈值。 取值范围依赖out_ctrl:
|
min_val |
阈值化不超过thr时的取值。 |
max_val |
阈值化超过thr时的取值。 |
【注意事项】
无
【相关数据类型及接口】
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_MODE_LINEAR |
双向性插值缩放模式。 |
OT_IVE_RESIZE_MODE_AREA |
区域插值缩放模式。 |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_resize_ctrl¶
【说明】
定义resize控制参数。
【定义】
typedef struct {
ot_ive_resize_mode mode;
ot_svp_mem_info mem;
td_u16 num;
} ot_ive_resize_ctrl;
【成员】
成员名称 |
描述 |
|---|---|
mode |
缩放模式。 |
mem |
辅助内存。开辟参照ss_mpi_ive_resize中【注意】。 详细定义请见《SVPx.0 API参考》 |
num |
图像数目,取值范围:[1, 64]。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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_MODE_USE_CUR_GRAD |
当前位置梯度计算模式。 |
OT_IVE_GRAD_FG_MODE_FIND_MIN_GRAD |
周边最小梯度计算模式。 |
【注意事项】
无。
【相关数据类型及接口】
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;
【成员】
成员名称 |
描述 |
|---|---|
mode |
梯度前景计算模式。参考ot_ive_grad_fg_mode。 |
edw_factor |
边缘宽度调节因子。 取值范围:[500, 2000] 参考取值:1000 |
crl_coef_threshold |
梯度向量相关系数阈值。 取值范围:[50, 100] 参考取值:80 |
mag_crl_threshold |
梯度幅值阈值。 取值范围:[0, 20] 参考取值:4 |
min_mag_diff |
梯度幅值差值阈值。 取值范围:[2, 8] 参考取值:2 |
noise_val |
梯度幅值噪声阈值。 取值范围:[1, 8] 参考取值:1 |
edw_dark |
黑像素使能标志,0表示不开启,1表示开启。 参考取值:1 |
【注意事项】
无。
【相关数据类型及接口】
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;
【成员】
成员名称 |
描述 |
|---|---|
mean |
候选背景灰度均值,高12位为候选背景像素值,低4位为状态标识。 |
start_time |
候选背景起始时间。 |
sum_access_time |
候选背景累计访问时间。 |
short_keep_time |
候选背景短时保持时间。 |
chg_cond |
候选背景进入变换状态时间条件。 |
poten_bg_life |
潜在背景生命值。 |
【注意事项】
无
【相关数据类型及接口】
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;
【成员】
成员名称 |
描述 |
|---|---|
mean |
0号工作背景灰度值,高12位为0号工作背景像素值,低4位为工作背景状态标识。 |
access_time |
用于工作背景有效性检查的背景累计访问时间。 |
prev_gray |
前一帧像素灰度值。 |
diff_threshold |
差分阈值。 |
access_flag |
工作背景访问标识。 |
bg_gray [OT_IVE_ARR_NUM_THREE] |
1~3号背景灰度值。 |
【注意事项】
无。
【相关数据类型及接口】
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] |
1~3号工作背景生命力。 |
cand_bg_life |
候选背景生命力。 |
【注意事项】
无。
【相关数据类型及接口】
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;
【成员】
成员名称 |
描述 |
|---|---|
work_bg_pixel |
工作背景数据。 |
cand_pixel |
候选背景数据。 |
bg_life |
背景生命力。 |
【注意事项】
无
【相关数据类型及接口】
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;
【成员】
成员名称 |
描述 |
|---|---|
pixel_num |
前景像素数目。 |
sum_luma |
输入图像的所有像素亮度累加和。 |
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;
【成员】
成员名称 |
描述 |
|---|---|
pixel_num |
背景像素数目。 |
sum_luma |
背景图像的所有像素亮度累加和。 |
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;
【成员】
成员名称 |
描述 |
|---|---|
cur_frame_num |
当前帧时间。 |
prev_frame_num |
前一帧时间。 要求prev_frame_num< cur_frame_num。 |
time_threshold |
潜在背景替换时间阈值。 取值范围:[2,100]。 参考取值:20 |
diff_threshold_crl_coef |
差分阈值与灰度值相关系数。 取值范围:[0,5]。 参考取值:0 |
diff_max_threshold |
背景差分阈值调整上限。 取值范围:[3,15]。 参考取值:6 |
diff_min_threshold |
背景差分阈值调整下限。 取值范围:[3, diff_max_threshold]。 参考取值:4 |
diff_threshold_inc |
动态背景下差分阈值增量。 取值范围:[0,6]。 参考取值:0 |
fast_learn_rate |
快速背景学习速率。 取值范围:[0,4]。 参考取值:2 |
detected_chg_rgn |
是否检测变化区域。 取值范围:{0,1},0表示不检测,1表示检测。 参考取值:0 |
【注意事项】
无
【相关数据类型及接口】
无
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;
【成员】
成员名称 |
描述 |
|---|---|
cur_frame_num |
当前帧时间。 |
prev_check_time |
上次进行背景状态检查的时间点。 |
frame_check_period |
背景状态检查时间周期。 取值范围:[0, 2000]。 参考取值:50 |
init_min_time |
背景初始化最短时间。 取值范围:[20, 6000]。 参考取值:100 |
steady_bg_min_blend_time |
稳态背景融入最短时间。 取值范围:[init_min_time, 6000]。 参考取值:200 |
steady_bg_max_blend_time |
稳态背景融入最长时间。 取值范围:[steady_bg_max_blend_time, 40000]。 参考取值:1500 |
dynamic_bg_min_blend_time |
动态背景融入最短时间。 取值范围:[0, 6000]。 参考取值:0 |
static_detection_min_time |
静物检测最短时间。 取值范围:[20, 6000]。 参考取值:80 |
fg_max_fade_time |
前景持续消失最长时间。 取值范围:[1, 255]。 参考取值:15 |
bg_max_fade_time |
背景持续消失最长时间。 取值范围:[1, 255]。 参考取值:60 |
steady_bg_access_time_rate_threshold |
稳态背景访问时间比率阈值。 取值范围:[10, 100]。 参考取值:80 |
chg_bg_access_time_rate_threshold |
变化背景访问时间比率阈值。 取值范围:[10, 100]。 参考取值:60 |
dynamic_bg_access_time_threshold |
动态背景访问时间比率阈值。 取值范围:[0, 50]。 参考取值:0 |
dynamic_bg_depth |
动态背景深度。 取值范围:[0, 3]。 参考取值:3 |
bg_eff_state_rate_threshold |
景初始化阶段背景状态时间比率阈值。 取值范围:[90, 100]。 参考取值:90 |
acc_bg_learn |
是否加速背景学习。 取值范围:{0, 1},0表示不加速,1表示加速。 参考取值:0 |
detected_chg_rgn |
是否检测变化区域。 取值范围:{0, 1},0表示不检测,1表示检测。 参考取值:0 |
【注意事项】
要求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_ACCURATE_SRC16_WGT16 |
输入特征向量类型为SQ16.16。 |
OT_IVE_ann_mlp_ACCURATE_SRC14_WGT20 |
输入特征向量类型为SQ18.14。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
OT_IVE_ANN_MLP_ACTV_FUNC_IDENTITY |
Identity激活函数。 |
OT_IVE_ANN_MLP_ACTV_FUNC_SIGMOID_SYM |
Sigmoid对称激活函数。 |
OT_IVE_ANN_MLP_ACTV_FUNC_GAUSSIAN |
Gaussian激活函数。 |
【注意事项】
对应函数定义参见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;
【成员】
成员名称 |
描述 |
|---|---|
actv_func |
激活函数类型。 |
accurate |
输入特征向量类型。 |
wgt |
模型数据权重。 详细定义请见《SVPx.0 API参考》 |
total_wgt_size |
总的权重的大小 |
layer_cnt[OT_IVE_ARR_NUM_EIGHT] |
输入层1层->隐含层若干层(至少1层,最多6层)->输出层1层,分别存储输入、输出层的特征维度(取值范围:[1, 256]),各隐藏层的神经元数目(取值范围:[2,256])。 |
max_cnt |
所有层中神经元数目或者特征维度的最大值: |
layer_num |
ann_mlp系统中的层数。 取值范围:[3, 8]。 |
reserved |
保留字段 |
【注意事项】
无。
【相关数据类型及接口】
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_TYPE_C_SVC |
分类模式。 |
OT_IVE_SVM_TYPE_NU_SVC |
回归模式。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
OT_IVE_SVM_KERNEL_TYPE_LINEAR |
线性核函数。 |
OT_IVE_SVM_KERNEL_TYPE_POLY |
多项式核函数。 |
OT_IVE_SVM_KERNEL_TYPE_RBF |
径向基核函数。 |
OT_IVE_SVM_KERNEL_TYPE_SIGMOID |
Sigmoid核函数。 |
【注意事项】
对应核函数定义参见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;
【成员】
成员名称 |
描述 |
|---|---|
type |
svm类型,当前仅支持分类IVE_SVM_TYPE_C_SVC模式。 |
kernel_type |
svm核函数类型,参考ot_ive_svm_kernel_type。 |
sv |
模型数据中的支持向量,其内存排布参看ss_mpi_ive_svm_predict的【注意】。 |
df |
模型数据中的判决函数参数部分。 |
total_df_size |
所有判决函数参数总字节数。 |
feature_dim |
输入特征维数。 取值范围:[1, 256]或[1, 1024],跟ss_mpi_ive_cnn_predict 中的输入特征向量维度一致。 |
sv_total |
总支持向量个数。 取值范围:[1, 3000]。 |
class_cnt |
类别数目。 取值范围:[2, 80]。 |
【注意事项】
无。
【相关数据类型及接口】
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_ACTV_FUNC_NONE |
不使用激活函数。 |
OT_IVE_CNN_ACTV_FUNC_RELU |
使用ReLU激活函数。 |
OT_IVE_CNN_ACTV_FUNC_SIGMOID |
使用Sigmoid激活函数,暂不支持。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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_POOLING_NONE |
不执行图像汇聚。 |
OT_IVE_CNN_POOLING_MAX |
对汇聚范围的特征点求最大值。 |
OT_IVE_CNN_POOLING_AVG |
对汇聚范围的特征点求平均值。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
actv_func |
激活函数类型。 |
pooling |
汇聚操作类型。 |
feature_map_num |
卷积运算包中输出特征图的数目。支持范围:1~50。 |
kernel_size |
卷积运算包中卷积核的尺寸。仅支持3x3。 |
conv_step |
卷积运算包中卷积核移动的步长。仅支持1。 |
pool_size |
汇聚操作的窗口大小。仅支持2x2。 |
pool_step |
汇聚操作窗口移动的步长。仅支持2。 |
reserved |
保留 |
【注意事项】
无。
【相关数据类型及接口】
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]。 |
max_cnt |
全连接各层节点数目的最大值。 |
layer_num |
全连接层数。支持范围:[3, 8]。 |
reserved |
保留 |
【注意事项】
无。
【相关数据类型及接口】
无。
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] |
各层卷积运算包参数配置。 |
full_connect |
全连接运算包参数配置。 |
conv_kernel_bias |
所有卷积运算包中卷积核系数和偏置系数。 |
conv_kernel_bias_size |
所有卷积运算包中卷积核系数和偏置系数的字节数。 |
fc_wgt_bias |
全连接运算包中权重系数和偏置系数。 详细定义请见《SVPx.0 API参考》1.4小节。 |
fc_wgt_bias_size |
全连接运算包中权重系数和偏置系数的字节数。 |
total_mem_size |
CNN网络计算中所需要的包括卷积核、权重、偏置系数等的内存字节数。 |
type |
输入CNN模型的图像类型。仅支持U8C1灰度图或者RGB_PLANAR彩色图。 |
width |
输入CNN模型的图像宽度。w支持范围:16~80。 |
height |
输入CNN模型的图像高度。h支持范围:16~(1280/w)。 |
class_cnt |
CNN模型分类任务的类别数目(与全连接最后一层输出一致)。支持范围:1~256。 |
conv_pool_layer_num |
CNN模型卷积运算包的数目。支持范围:1~8。 |
reserved |
保留 |
【注意事项】
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;
【成员】
成员名称 |
描述 |
|---|---|
mem |
CNN预测计算过程的辅助内存,所需内存大小参考ss_mpi_ive_cnn_predict中的【注意】。 详细定义请见《SVPx.0 API参考》 |
num |
输入CNN模型的图像数目。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
class_idx |
CNN模型的预测类别索引。 |
conf |
CNN模型所预测类别的置信度。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
src_point |
源图坐标。 |
dst_point |
目的坐标。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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_ALG_MODE_NR_SIM |
非反射相似变换。 |
OT_IVE_PERSP_TRANS_ALG_MODE_SIM |
相似变换。 |
OT_IVE_PERSP_TRANS_ALG_MODE_AFFINE |
仿射变换。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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_NONE |
不做色彩空间转换。 |
OT_IVE_PERSP_TRANS_CSC_MODE_VIDEO_BT601_YUV_TO_RGB |
BT601的YUV2RGB视频变换。 |
OT_IVE_PERSP_TRANS_CSC_MODE_VIDEO_BT709_YUV_TO_RGB |
BT709的YUV2RGB视频变换。 |
OT_IVE_PERSP_TRANS_CSC_MODE_PIC_BT601_YUV_TO_RGB |
BT601的YUV2RGB图像变换。 |
OT_IVE_PERSP_TRANS_CSC_MODE_PIC_BT709_YUV_TO_RGB |
BT709的YUV2RGB图像变换。 |
【注意事项】
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;
【成员】
成员名称 |
描述 |
|---|---|
alg_mode |
透视变换算法模式。 |
csc_mode |
透视变换色彩空间转换模式。 |
roi_num |
区域数目。取值范围:[1, 64]。 |
point_pair_num |
点对数目。
|
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
OT_IVE_KCF_CORE0 |
KCF的核零 |
OT_IVE_KCF_CORE1 |
KCF的核一 |
【注意事项】
不同解决方案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;
【成员】
成员名称 |
描述 |
|---|---|
roi |
区域信息。 |
roi_id |
区域索引。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
csc_mode |
色度空间转换模式。取值范围:[0, 3] |
tmp_buf |
辅助内存。 |
interp_factor |
The blend coefficient。取值范围:[0, 32768] |
lamda |
The regularization coefficient. 取值范围:[0, 65535] |
norm_trunc_alfa |
归一化阈值。取值范围:[0, 4095] |
sigma |
高斯核带宽。取值范围:[0, 255] |
resp_threshold |
响应阈值。取值范围:[0, 255] |
core_id |
指定KCF的核ID |
【解决方案差异】
解决方案名称 |
差异 |
|---|---|
SS928V100 |
KCF在IVE中只有一个核,默认用核0,配置其他参数无效 |
SS927V100 |
KCF在IVE中只有一个核,默认用核0,配置其他参数无效 |
【注意事项】
无。
【相关数据类型及接口】
无。
ot_ive_list_head¶
【说明】
定义链表头结构体参数。
【定义】
typedef struct tag_ot_ive_list_head {
struct tag_ot_ive_list_head *next, *prev;
} ot_ive_list_head;
【成员】
成员名称 |
描述 |
|---|---|
next |
指向下一个节点指针。 |
prev |
指向前一个节点指针。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
roi_info |
目标区域信息。 |
cos_win_x |
水平方向汉宁窗。 |
cos_win_y |
垂直方向汉宁窗。 |
gauss_peak |
高斯峰值表。 |
hog_feature |
HOG特征。 |
alpha |
Alpha值。 |
dst |
跟踪结果。 |
padding |
目标区域放大倍数。 |
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;
【成员】
成员名称 |
描述 |
|---|---|
list |
节点链表头信息。 |
kcf_obj |
目标信息。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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_LIST_STATE_CREATE |
创建链表。 |
OT_IVE_KCF_LIST_STATE_DESTORY |
删除链表。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
obj_node_buf |
目标节点地址。 |
free_obj_list |
空闲节点链表。 |
train_obj_list |
训练节点链表。 |
track_obj_list |
跟踪节点链表。 |
free_obj_num |
空闲节点链表节点数。 |
train_obj_num |
训练节点链表节点数。 |
track_obj_num |
跟踪节点链表节点数。 |
max_obj_num |
目标节点链表最大节点数。 |
list_state |
目标节点链表状态。 |
tmp_buf |
链表辅助内存。 |
width |
跟踪图像的宽。 |
height |
跟踪图像的高。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
node |
节点信息指针。 |
response |
目标响应值。 |
roi_info |
目标区域信息。 |
is_track_ok |
跟踪状态标志。 |
is_roi_refresh |
目标区域刷新标志。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
max_bbox_num |
目标区域信息数组最大成员数。 |
resp_threshold |
目标响应阈值。 |
【注意事项】
无。
【相关数据类型及接口】
无。
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;
【成员】
成员名称 |
描述 |
|---|---|
OT_IVE_HOG_MODE_VER_TANGENT_PLANE |
垂直切面模式。 |
OT_IVE_HOG_MODE_HOR_TANGENT_PLANE |
水平切面模式。 |
【注意事项】
无
【相关数据类型及接口】
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;
【成员】
成员名称 |
描述 |
|---|---|
csc_mode |
色度空间转换模式。取值范围:[0, 3] |
hog_mode |
HOG特征模式。 |
roi_num |
区域数目。取值范围:[1, 64] |
norm_trunc_alfa |
归一化截断阈值。取值范围:[0, 4095] |
core_id |
指定KCF的核ID。 |
【解决方案差异】
解决方案名称 |
差异 |
|---|---|
SS928V100 |
KCF在IVE中只有一个核,默认用核0,配置其他参数无效 |
SS927V100 |
KCF在IVE中只有一个核,默认用核0,配置其他参数无效 |
【注意事项】
无。
【相关数据类型及接口】
无。
错误码¶
IVE错误码¶
_识别_加速引擎API错误码如下所示。
表 1 _识别_加速引擎API错误码
错误代码 |
宏定义 |
描述 |
|---|---|---|
0xa01d8001 |
OT_ERR_IVE_INVALID_DEV_ID |
设备ID超出合法范围 |
0xa01d8003 |
OT_ERR_IVE_INVALID_CHN_ID |
通道组号错误或无效区域句柄 |
0xa01d8007 |
OT_ERR_IVE_ILLEGAL_PARAM |
参数超出合法范围 |
0xa01d8008 |
OT_ERR_IVE_EXIST |
重复创建已存在的设备、通道或资源 |
0xa01d8009 |
OT_ERR_IVE_UNEXIST |
试图使用或者销毁不存在的设备、通道或者资源 |
0xa01d800a |
OT_ERR_IVE_NULL_PTR |
函数参数中有空指针 |
0xa01d800b |
OT_ERR_IVE_NOT_CFG |
模块没有配置 |
0xa01d800c |
OT_ERR_IVE_NOT_SUPPORT |
不支持的参数或者功能 |
0xa01d800d |
OT_ERR_IVE_NOT_PERM |
该操作不允许,如试图修改静态配置参数 |
0xa01d8014 |
OT_ERR_IVE_NO_MEM |
分配内存失败,如系统内存不足 |
0xa01d8015 |
OT_ERR_IVE_NO_BUF |
分配缓存失败,如申请的图像缓冲区太大 |
0xa01d8016 |
OT_ERR_IVE_BUF_EMPTY |
缓冲区中无图像 |
0xa01d8017 |
OT_ERR_IVE_BUF_FULL |
缓冲区中图像满 |
0xa01d8018 |
OT_ERR_IVE_NOT_READY |
系统没有初始化或没有加载相应模块 |
0xa01d8021 |
OT_ERR_IVE_BAD_ADDR |
地址非法 |
0xa01d8022 |
OT_ERR_IVE_BUSY |
系统忙 |
0xa01d8040 |
OT_ERR_IVE_SYS_TIMEOUT |
系统超时 |
0xa01d8041 |
OT_ERR_IVE_QUERY_TIMEOUT |
Query查询超时 |
0xa01d8042 |
OT_ERR_IVE_BUS_ERR |
总线错误 |
0xa01d8043 |
OT_ERR_IVE_OPEN_FILE |
打开文件失败 |
0xa01d8044 |
OT_ERR_IVE_READ_FILE |
读文件失败 |
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工作状态资源信息和算子调用信息。
【参数说明】
参数 |
描述 |
|
|---|---|---|
module param 模块参数 |
save_power |
低功耗标志。 0:关闭低功耗; 1:打开低功耗。 |
max_node_num |
队列最大节点数。 取值范围[20, 512]。 |
|
ive queue info IVE队列信息 |
wait |
等待队列编号(0或1)。 |
busy |
正在调度队列编号(0,1或-1), -1表示IVE硬件空闲。 |
|
wait_cur_id |
等待队列的首个有效任务ID。 |
|
wait_end_id |
等待队列的末尾有效任务ID + 1。 |
|
busy_cur_id |
调度队列的首个有效任务ID。 |
|
busy_end_id |
调度队列的末尾有效任务ID + 1。 |
|
ive task info IVE TASK相关信息 |
handle |
当前可分配的任务handle号。 |
task_finish |
当前已完成任务的个数。 |
|
last_id |
上一次中断完成的任务ID。 |
|
task_id |
本次中断完成的任务ID。 |
|
handle_wrap |
用户handle号分配发生回写的次数。 |
|
finish_wrap |
完成任务数发生回写的次数。 |
|
ive runtime info IVE运行时相关信息 |
last_inst |
用户最后一次提交任务时传入的is_instant值。 |
cnt_per_sec |
最近一次的1秒内中断执行次数。 |
|
max_cnt_per_sec |
历史上的1秒内最大的中断执行次数。 |
|
total_int_cnt_last_sec |
上一秒上报中断总次数。 |
|
total_int_cnt |
IVE产生中断的总次数。 |
|
qt_cnt |
查询IVE链表超时次数。 |
|
st_cnt |
IVE系统超时次数。 |
|
cost_tm |
最近一次执行中断的执行耗时。 单位:us |
|
m_cost_tm |
执行一次中断的最大耗时。 单位:us |
|
cost_tm_per_sec |
最近一秒执行中断的执行耗时。 单位:us |
|
m_cost_tm_per_sec |
历史上一秒执行中断的最大执行耗时。 单位:us |
|
total_int_cost_tm |
中断处理总时间。 单位:us |
|
last_task_hw_tm |
最近IVE算子硬件运行时间 单位:us |
|
run_tm |
IVE运行总时间。 单位:s |
|
ive invoke info IVE调用信息 |
dma |
dma的调用次数。其它不再一一列出。 |
kcf module param kcf模块参数 |
save_power |
低功耗标志。 0:关闭低功耗; 1:打开低功耗。 |
max_node_num |
队列最大节点数。 取值范围[20, 128]。 |
|
kcf queue info KCF队列信息 |
core_id |
核编号(0或1)。其他同ive queue info,不再一一列出。 |
kcf task info KCF TASK相关信息 |
core_id |
核编号(0或1)。其他同ive task info,不再一一列出。 |
kcf runtime info KCF运行时相关信息 |
core_id |
核编号(0或1)。其他同ive runtime info,不再一一列出。 |
kcf invoke info KCF调用信息 |
core_id |
核编号(0或1)。 |
kcf |
kcf的调用次数。 |
|
hog |
hog的调用次数。 |
|
ive utili info IVE硬件利用率信息 |
utili |
IVE硬件利用率。 单位:% |
【注意】
建议代码调试阶段关闭低功耗,调试完成再打开低功耗。
在非低功耗场景时,才会统计IVE硬件利用率。
FAQ¶
使用PC端IVE Clib与板端IVESDK开发算法的差异¶
表 1 使用PC端IVE Clib与板端IVE SDK开发算法的差异
序号 |
关键词 |
PC端IVE Clib |
板端SDK |
|---|---|---|---|
1 |
handle |
无效 |
当有需要时与ss_mpi_ive_query配合查询算子是否完成。详细参考“重要概念”的“句柄(handle)” |
2 |
is_instant |
无效 |
根据算法设置可减少中断,提升性能。详细参考“重要概念”的“及时返回结果标志” |
3 |
query |
不需要查询,查询永远返回成功 |
当用户需要使用IVE硬算子的结果时,必须查询任务是否完成。详细参考“重要概念”的“查询(query)”以及ss_mpi_ive_query接口说明。 |
4 |
内存开辟、物理地址、虚拟地址 |
内存使用malloc开辟。由于malloc出来均为虚拟地址,所以赋值给虚拟地址。为模拟IVE硬件使用物理地址的特性,Clib也使用物理地址,所以物理地址必须赋值,且必须赋值为虚拟地址的td_u32强制类转化。 |
IVE硬件使用物理地址。内存使用ss_mpi_sys_mmz_malloc/ss_mpi_sys_mmz_alloc_cached接口详细信息请参见《MPP 媒体处理软件Vx.y 开发参考》)开辟,物理地址和虚拟地址由此生成;或者使用其他模块的VB内存。 |
5 |
地址对齐 |
Clib不要求地址对齐 |
硬件地址按要求对齐。 |
6 |
解决方案差异 |
Clib是功能全集,接口会更新到最新版。 |
解决方案根据需求,支持的功能是Clib中的子集。某些接口由于升级可能与最新版Clib不一致。 |
7 |
异步、同步、并行、串行 |
Clib的执行与算法软件均在CPU中串行执行,不存在异步问题。 |
IVE硬件与CPU异步执行,可以此特性让IVE与CPU并行工作,提高性能。但是在CPU需要使用IVE的结果数据时,需要同步。 |
使用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),即可打开低功耗,反之为关闭低功耗。默认情况下是打开低功耗。



