资源简介
摄像头物体跟踪,采用CT算法,vs2010直接打开
代码片段和文件信息
#include “CompressiveTracker.h“
#include
#include
using namespace cv;
using namespace std;
//------------------------------------------------
CompressiveTracker::CompressiveTracker(void)
{
featureMinNumRect = 2;
featureMaxNumRect = 4; // number of rectangle from 2 to 4
featureNum = 50; // number of all weaker classifiers i.efeature pool
rOuterPositive = 4; // radical scope of positive samples
rSearchWindow = 25; // size of search window
muPositive = vector(featureNum 0.0f);
muNegative = vector(featureNum 0.0f);
sigmaPositive = vector(featureNum 1.0f);
sigmaNegative = vector(featureNum 1.0f);
learnRate = 0.85f; // Learning rate parameter
}
CompressiveTracker::~CompressiveTracker(void)
{
}
void CompressiveTracker::HaarFeature(Rect& _objectBox int _numFeature)
/*Description: compute Haar features
Arguments:
-_objectBox: [x y width height] object rectangle
-_numFeature: total number of features.The default is 50.
*/
{
features = vector>(_numFeature vector());
featuresWeight = vector>(_numFeature vector());
int numRect;
Rect rectTemp;
float weightTemp;
for (int i=0; i<_numFeature; i++)
{
numRect = cvFloor(rng.uniform((double)featureMinNumRect (double)featureMaxNumRect));
//int c = 1;
for (int j=0; j {
rectTemp.x = cvFloor(rng.uniform(0.0 (double)(_objectBox.width - 3)));
rectTemp.y = cvFloor(rng.uniform(0.0 (double)(_objectBox.height - 3)));
rectTemp.width = cvCeil(rng.uniform(0.0 (double)(_objectBox.width - rectTemp.x - 2)));
rectTemp.height = cvCeil(rng.uniform(0.0 (double)(_objectBox.height - rectTemp.y - 2)));
features[i].push_back(rectTemp);
weightTemp = (float)pow(-1.0 cvFloor(rng.uniform(0.0 2.0))) / sqrt(float(numRect));
//weightTemp = (float)pow(-1.0 c);
featuresWeight[i].push_back(weightTemp);
}
}
}
void CompressiveTracker::sampleRect(Mat& _image Rect& _objectBox float _rInner float _rOuter int _maxSampleNum vector& _sampleBox)
/* Description: compute the coordinate of positive and negative sample image templates
Arguments:
-_image: processing frame
-_objectBox: recent object position
-_rInner: inner sampling radius
-_rOuter: Outer sampling radius
-_maxSampleNum: maximal number of sampled images
-_sampleBox: Storing the rectangle coordinates of the sampled images.
*/
{
int rowsz = _image.rows - _objectBox.height - 1;
int colsz = _image.cols - _objectBox.width - 1;
float inradsq = _rInner*_rInner;
float outradsq = _rOuter*_rOuter;
int dist;
int minrow = max(0(int)_objectBox.y-(int)_rInner);
int maxrow = min((int)rowsz-1(int)_objectBox.y+(int)_rInner);
int mincol = max(0(int)_objectBox.x-(int)_rInner);
int maxcol = min((int)colsz-1(int)_objectBox.x+(int)_rInne
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-08-27 17:26 CTFromCam_v0\
目录 0 2012-08-27 17:26 CTFromCam_v0\CompressiveTracking\
文件 9132 2012-08-24 13:15 CTFromCam_v0\CompressiveTracking\CompressiveTracker.cpp
文件 2163 2012-08-23 17:59 CTFromCam_v0\CompressiveTracking\CompressiveTracker.h
文件 4005 2012-08-07 09:58 CTFromCam_v0\CompressiveTracking\CompressiveTracking.vcproj
文件 1449 2012-08-24 10:47 CTFromCam_v0\CompressiveTracking\CompressiveTracking.vcproj.HP98402794308.Administrator.user
文件 1427 2012-08-24 13:46 CTFromCam_v0\CompressiveTracking\CompressiveTracking.vcproj.PC-201008102047.Administrator.user
目录 0 2012-08-27 17:28 CTFromCam_v0\CompressiveTracking\Debug\
目录 0 2012-08-27 17:28 CTFromCam_v0\CompressiveTracking\Release\
文件 4286 2012-08-24 12:49 CTFromCam_v0\CompressiveTracking\RunTracker.cpp
文件 962560 2011-12-04 05:39 CTFromCam_v0\CompressiveTracking\david.mpg
文件 12 2012-08-07 14:56 CTFromCam_v0\CompressiveTracking\init.txt
文件 9440256 2012-08-24 13:46 CTFromCam_v0\CompressiveTracking.ncb
文件 923 2012-08-24 10:43 CTFromCam_v0\CompressiveTracking.sln
文件 17408 2012-08-24 13:46 CTFromCam_v0\CompressiveTracking.suo
目录 0 2012-08-27 17:26 CTFromCam_v0\Release\
文件 39936 2012-08-24 13:15 CTFromCam_v0\Release\CompressiveTracking.exe
文件 822272 2012-08-24 13:15 CTFromCam_v0\Release\CompressiveTracking.pdb
文件 962560 2011-12-04 05:39 CTFromCam_v0\Release\david.mpg
文件 12 2012-08-07 14:56 CTFromCam_v0\Release\init.txt
- 上一篇:惯性导航基本原理-(入门两天半).pdf
- 下一篇:无线网卡ath9k驱动Linux
相关资源
- DirectShow显示USB摄像头
- OV7725摄像头循迹小车
- FPGA驱动摄像头采集图像实现LCD显示
- OV7670摄像头基于STM32驱动源程序
- 从摄像头提取视频文件
- DirectX.Capture ffdshow摄像头录制视频拍照
- 微方摄像头监控系统V9.65破解版.rar
- Tesseract-OCR在VS2010下调用API所需要的
- AnkhSvn-2.1.7444.278.msi & AnkhSvn-2.1.8420.8.
- qt5_V4L2_Camera 实现摄像头实时画面显示
- 飞思卡尔第十届智能车比赛摄像头组
- 大数库miracl 7.0.1 附带vs2010编译工程及
- Opencv摄像头校正
- 基于VS2010的OpenGL 3D场景
- 机器人大赛摄像头搬运组
- 海康威视智能交通摄像头抓拍调试软
- 海康摄像头+web的demo118545
- tracert课程设计
- 圆点摄像头激光测距源代码---本人亲
- 32位 opencv 3.4.1 lib和dll文件
- 摄像头视频图像采集,以图片形式存
- Windows下 QT 5 调用 大华 SDK 实现摄像头
- 群晖USB摄像头套件
- 基于OV5640摄像头二维码识别例程
- opencv+zbar实现摄像头二维码识别
- 2017全国电子设计大赛滚球控制系统程
- 第11届恩智浦智能小车摄像头国赛程序
- 基于stm32的ov7725直存SD卡
- 内部vs2010版本人事管理系统全源码
- 海康威视安卓移动端摄像头调用demo
评论
共有 条评论