电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

运动目标跟踪与检测的源代码(CAMSHIFT算法)VIP专享VIP免费

运动目标跟踪与检测的源代码(CAMSHIFT算法)_第1页
运动目标跟踪与检测的源代码(CAMSHIFT算法)_第2页
运动目标跟踪与检测的源代码(CAMSHIFT算法)_第3页
该运行文件在VC6.0 环境下编译通过,是一个 stand-alone 运行程序,不需要OPENCV的DLL 库支持。在运行之前,请先连接好 USB 接口的摄像头。然后可以用鼠标选定欲跟踪目标。 #ifdef _CH_ #pragma package #endif #ifndef _EiC #include "cv.h" #include "highgui.h" #include #include #endif IplImage *image = 0, *hsv = 0, *hue = 0, *mask = 0, *backproject = 0, *histimg = 0; CvHistogram *hist = 0; int backproject_mode = 0; int select_object = 0; int track_object = 0; int show_hist = 1; CvPoint origin; CvRect selection; CvRect track_window; CvBox2D track_box; // tracking 返回的区域 box,带角度 CvConnectedComp track_comp; int hdims = 48; // 划分 HIST 的个数,越高越精确 float hranges_arr[] = {0,180}; float* hranges = hranges_arr; int vmin = 10, vmax = 256, smin = 30; void on_mouse( int event, int x, int y, int flags ) { if( !image ) return; if( image->origin ) y = image->height - y; if( select_object ) { selection.x = MIN(x,origin.x); selection.y = MIN(y,origin.y); selection.width = selection.x + CV_IABS(x - origin.x); selection.height = selection.y + CV_IABS(y - origin.y); selection.x = MAX( selection.x, 0 ); selection.y = MAX( selection.y, 0 ); selection.width = MIN( selection.width, image->width ); selection.height = MIN( selection.height, image->height ); selection.width -= selection.x; selection.height -= selection.y; } switch( event ) { case CV_EVENT_LBUTTONDOWN: origin = cvPoint(x,y); selection = cvRect(x,y,0,0); select_object = 1; break; case CV_EVENT_LBUTTONUP: select_object = 0; if( selection.width > 0 && selection.height > 0 ) track_object = -1; #ifdef _DEBUG printf("/n # 鼠标的选择区域:"); printf("/n X = %d, Y = %d, Width = %d, Height = %d", selection.x, selection.y, selection.width, selection.height); #endif brea...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部