#ifndef OBJECT_DETECT_H
#define OBJECT_DETECT_H
#include <stdbool.h>
/*************************************************
功能: 对象检测(检测视频中的台标、人物等)
参数说明:
src :输入图像数据(YUV420P)
srcStride :输入数据的长度
image_width :输入图像宽度
image_height :输入图像高度
model_path :对象检测模型的路径(.pb)
pbtxt_path :模型对应的描述文件(.pbtxt 需通过opencv-4.2.0/sample/dnn/tf_text_graph_ssd.py进行生成)
object_name_path:对象id到名称的映射
min_match_rate :最小匹配率
show :是否显示检测到的结果
**************************************************/
#ifdef __cplusplus
extern "C"{
#endif
bool object_detect(unsigned char* src[8], int srcStride[8],int image_width,int image_height,char* model_path,char* pbtxt_path,char *object_name_path,float min_match_rate,bool show);
#ifdef __cplusplus
}
#endif
#endif
以上是库文件对应的头文件,头文件必须有extern c 才能被C调用
[root@node0 lib_object_detect]# nm object_detect.so |grep object_detect
000000000001249e t _GLOBAL__sub_I_object_detect.cpp
0000000000010203 T object_detect
000000000021de30 b _ZGVZ13object_detectE8kWinName
0000000000017e08 r _ZZ13object_detectE8__func__
000000000021de48 b _ZZ13object_detectE8kWinName
[root@node0 lib_object_detect]# ls
Makefile object_detect.cpp object_detect.h object_detect.so test.cpp
nm的符号中必须有object_detect才行,切object_detect前不能有其他字符
原文链接: https://www.cnblogs.com/lvyunxiang/p/12800208.html
欢迎关注
微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍
原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/196713
非原创文章文中已经注明原地址,如有侵权,联系删除
关注公众号【高性能架构探索】,第一时间获取最新文章
转载文章受原作者版权保护。转载请注明原作者出处!