1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#pragma once
#ifndef _DETFEA_LIB_H_
#define _DETFEA_LIB_H_
#include <vector>
#include "opencv2/opencv.hpp"
#define DETFEA_CLS_TOP_N 10
#define DETFEA_FEAT_DIM 160
#define DETFEA_ALL_OK 0x00000000 //
#define DETFEA_HANDLE_NULL 0x10050001 // 输入句柄为空
#define DETFEA_INPUT_IMAGE_EMPTY 0x10050002 // 输入图像为空
#define DETFEA_OUTPUT_NULL 0x10050003 // 输入的输出结构体为空
typedef struct _DETFEA_INPUT_
{
cv::Mat img;
}DETFEA_INPUT;
typedef struct _DETFEA_SINGLE_OUTPUT_
{
float x1;
float y1;
float x2;
float y2;
float prob;
int id;
int label;
float feat[DETFEA_FEAT_DIM];
}DETFEA_SINGLE_OUTPUT;
typedef struct _DETFEA_OUTPUT_
{
std::vector < DETFEA_SINGLE_OUTPUT> output_list;
}DETFEA_OUTPUT;
// 定义算法的识别设备
typedef enum _DETFEA_DEVICE_
{
DETFEA_CPU = 0x0000, // CPU
DETFEA_GPU = 0x0001, // GPU
}DETFEA_DEVICE;
/***************************************************************************************************
* 功 能: 初始化
* 参 数:
* const char* model_path - I 模型路径(这个可以设为NULL,表示用内置的模型)
* DETFEA_DEVICE device_name - I 设备类型
* void** detfea_handle - O 句柄
* 返回值: 错误码
***************************************************************************************************/
int DETFEA_Init(const char* model_path1,
const char* model_path2,
DETFEA_DEVICE device_type,
void** handle);
/***************************************************************************************************
* 功 能: 识别
* 参 数:
* DETFEA_INPUT in_img - I 输入图片
* DETFEA_OUTPUT* detfea_output - O 返回识别结果
* void* handle - I 句柄
* 返回值: 错误码
***************************************************************************************************/
int DETFEA_Process(DETFEA_INPUT in_img, DETFEA_OUTPUT* detfea_output, void* handle);
/***************************************************************************************************
* 功 能: 释放句柄
* 参 数:
* void** handle - I 句柄
* 返回值: 错误码
***************************************************************************************************/
int DETFEA_Release(void** handle);
#endif