| | |
| | | link_directories(${LOG_DIR}/lib) |
| | | include_directories(${LOG_DIR}/include) |
| | | |
| | | add_executable(${PROJECT_NAME} dome.cpp ${sources} ${CURRENT_HEADERS}) |
| | | #add_library(${PROJECT_NAME} SHARED ${sources} ${CURRENT_HEADERS}) |
| | | #add_executable(${PROJECT_NAME} dome.cpp ${sources} ${CURRENT_HEADERS}) |
| | | add_library(${PROJECT_NAME} SHARED ${sources} ${CURRENT_HEADERS}) |
| | | target_link_libraries(${PROJECT_NAME} protobuf ${LIBS}) |
| | |
| | | int m_staticStruct::times = 10;
|
| | |
|
| | | // 创建
|
| | | YOLOTRACK_API void* create(const char *conf, int *max_chan)
|
| | | API void* create(const char *conf, int *max_chan)
|
| | | {
|
| | | CLog::Initialize("/opt/vasystem/bin/models/humanCount/log.properties");
|
| | | AriManager *handle = new AriManager();
|
| | |
| | | }
|
| | |
|
| | | // 原查找结果接口
|
| | | YOLOTRACK_API void* get_result(void *handle, const void *img, const int chan)
|
| | | API void* get_result(void *handle, const void *img, const int chan)
|
| | | {
|
| | | AriManager *h = (AriManager*)handle;
|
| | | TResult *t_result = (TResult*)malloc(sizeof(TResult));
|
| | | init_TResult(t_result);
|
| | | DEBUG( "------error ");
|
| | | // h->doInfer(*t_result);
|
| | | return t_result;
|
| | | }
|
| | |
|
| | | // 传递人脸结果并查找信息
|
| | | YOLOTRACK_API void* get_result_face(void *handle, const void *img, const char* arg_json, const int arg_len, void *face_info, const int face_info_size)
|
| | | API void* get_result_face(void *handle, const void *img, const char* arg_json, const int arg_len, void *face_info, const int face_info_size)
|
| | | {
|
| | | Json::Reader reader;
|
| | | Json::Value root;
|
| | |
| | | return t_result;
|
| | | }
|
| | |
|
| | | YOLOTRACK_API void release_result(void *res)
|
| | | API void release_result(void *res)
|
| | | {
|
| | | if (!res) return;
|
| | | TResult *cres = (TResult*)res;
|
| | |
| | | free(cres);
|
| | | }
|
| | |
|
| | | YOLOTRACK_API void release(void* handle)
|
| | | API void release(void* handle)
|
| | | {
|
| | | AriManager *h = (AriManager*)handle;
|
| | | delete h;
|
| | |
| | | t->count = 0;
|
| | | t->targets = nullptr;
|
| | | }
|
| | |
|
| | |
|
| | | API int set_data(void* handle, const char *data, const int len, const int type)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | |
|
| | | API int op_channel(void *handle, const char *chan_json, const int json_len, const int op)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | |
|
| | |
|
| | | //设置回调函数信息
|
| | | API int set_cb(void* handle, fn FUNC, void *args)
|
| | | {
|
| | | return 1;
|
| | | }
|
| | |
|
| | |
| | | extern "C"{
|
| | | #endif
|
| | |
|
| | | #define YOLOTRACK_API extern "C" __attribute__((visibility ("default")))
|
| | | #define API extern "C" __attribute__((visibility ("default")))
|
| | | typedef int (*fn)(void* args, const char* sender_chan, const int sender_len, const char *recver, const int recver_len, const char *data, const int len);
|
| | |
|
| | | YOLOTRACK_API void* create(const char *conf, int *max_chan);
|
| | | YOLOTRACK_API void release(void* handle);
|
| | | YOLOTRACK_API void* get_result(void *handle, const void *img, const int chan);
|
| | | YOLOTRACK_API void release_result(void *res);
|
| | | YOLOTRACK_API void* get_result_face(void *handle, const void *img, const char* arg_json, const int arg_len, void *face_info, const int face_info_size);
|
| | | API int set_data(void* handle, const char *data, const int len, const int type);
|
| | | API int op_channel(void *handle, const char *chan_json, const int json_len, const int op);
|
| | | API int set_cb(void* handle, fn FUNC, void *args);
|
| | |
|
| | | API void* create(const char *conf, int *max_chan);
|
| | | API void release(void* handle);
|
| | | API void* get_result(void *handle, const void *img, const int chan);
|
| | | API void release_result(void *res);
|
| | | API void* get_result_face(void *handle, const void *img, const char* arg_json, const int arg_len, void *face_info, const int face_info_size);
|
| | |
|
| | |
|
| | | void ReadJsonFromFile(const char* filename); // 读取json文件
|