2自定义模块插入OpenCV框架-2017-2018年度中国医院信息化状况调查
4.6.2自定义模块插入OpenCV框架要将自定义的模块插入到OpenCV的框架中就要使用blobtrack源程序,这个程序可以在OpenCV\samples\c的目录下找到,利用Visual C++.Net建立一个win32控制台程序的空白工程,然后在工程设置的连接器>输入>附加依赖项里面加上CV.1ib,cvaux.1ib,cvcam.1ib,cxcore.1ib,highgui.1ib等库文件,然后把刚才的myfgdetector.h和myfgdetector.cpp文件连同blobtrack.cpp文件都放在这个工程的目录下,再将这些文件加入到工程,然后在blobtrack.cpp文件的头部包含myfgdetector.h头文件: #include”myfgdetector.h”然后再定义一个类MyFGDetector的创建函数CreateMyFGDetector代码如下: static CvFGDetector奉cvCreateMyFGDetector(){return(new MyFGDetecto“));,最后将这个创建函数CreateMyFGDetector放在前景检测模块列表的第一项,此处定义其名称为FG—MY,描述为”My Background Difference object detection”,代码如下: DetModule_FGDetector FGDetectorModules[]= { {cvCreateMyFGDetector,"FG—MY","My Background Difference object detection”), {cvCreateFGDetector0,"FG-o”,”Foreground Object Detection from Videos Containing Complex Background.ACM MM2003."), {cvCreateFGDetectorOSimple,"FG_OS","Simplyfied version ofFG_0”}, {cvCreateFGDetectorl,”FG-1”,”Adaptive background mixture models for real-time tracking. CVPRI 999”), ln2
21.52MB
文件大小:
评论区