CT压缩追踪算法


绝对的可运行,配合usb摄像头,选定目标即可对目标进行实时跟踪,效果很好。
资源截图
代码片段和文件信息
#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)
{
}


//haar算法检测器
void CompressiveTracker::HaarFeature(Rect& _objectBox int _numFeature)
/*Description: 计算haar特征    
  参数:
  -_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)_

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       9198  2012-05-01 14:45  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingCompressiveTracker.cpp

     文件       2163  2012-08-23 17:59  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingCompressiveTracker.h

     文件       4005  2012-08-07 09:59  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingCompressiveTracking.vcproj

     文件       1449  2012-08-24 10:47  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingCompressiveTracking.vcproj.HP98402794308.Administrator.user

     文件       1427  2012-08-24 13:46  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingCompressiveTracking.vcproj.PC-201008102047.Administrator.user

     文件       4540  2012-05-01 21:21  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingCompressiveTracking.vcxproj

     文件       1168  2012-04-27 11:07  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingCompressiveTracking.vcxproj.filters

     文件        143  2012-04-27 11:06  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingCompressiveTracking.vcxproj.user

     文件     962560  2011-12-04 05:39  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingdavid.mpg

     文件         12  2012-08-07 14:56  压缩TLD追踪方法CTFromCam_v0CompressiveTrackinginit.txt

     文件       1454  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleasecl.command.1.tlog

     文件      25986  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleaseCL.read.1.tlog

     文件       1442  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleaseCL.write.1.tlog

     文件    1136877  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleaseCompressiveTracker.obj

     文件        381  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleaseCompressiveTracking.exe.intermediate.manifest

     文件         87  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleaseCompressiveTracking.lastbuildstate

     文件       3820  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleaseCompressiveTracking.log

     文件       1902  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleaselink.command.1.tlog

     文件       3234  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleaselink.read.1.tlog

     文件        956  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleaselink.write.1.tlog

     文件        616  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleasemt.command.1.tlog

     文件       1044  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleasemt.read.1.tlog

     文件        412  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleasemt.write.1.tlog

     文件    1015000  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleaseRunTracker.obj

     文件     479232  2012-05-05 09:40  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingReleasevc100.pdb

     文件       4334  2012-05-05 09:39  压缩TLD追踪方法CTFromCam_v0CompressiveTrackingRunTracker.cpp

     文件    9440256  2012-08-24 13:46  压缩TLD追踪方法CTFromCam_v0CompressiveTracking.ncb

     文件   11685888  2012-05-05 13:19  压缩TLD追踪方法CTFromCam_v0CompressiveTracking.sdf

     文件        924  2012-04-27 11:07  压缩TLD追踪方法CTFromCam_v0CompressiveTracking.sln

     文件        923  2012-08-24 10:43  压缩TLD追踪方法CTFromCam_v0CompressiveTracking.sln.old

............此处省略23个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)