vector<float> sigmaPositive;
vector<float> muNegative;
vector<float> sigmaNegative;
float learnRate; //学习速率,控制分类器参数更新的步长
vector<Rect> detectBox; //需要检测的box
Mat detectFeatureValue;
RNG rng; //随机数
private:
void HaarFeature(Rect& _objectBox, int _numFeature);
void sampleRect(Mat& _image, Rect& _objectBox, float _rInner, float _rOuter, int _maxSampleNum, vector<Rect>& _sampleBox);
void sampleRect(Mat& _image, Rect& _objectBox, float _srw, vector<Rect>& _sampleBox);
void getFeatureValue(Mat& _imageIntegral, vector<Rect>& _sampleBox, Mat& _sampleFeatureValue);
void classifierUpdate(Mat& _sampleFeatureValue, vector<float>& _mu, vector<float>& _sigma, float _learnRate);
void radioClassifier(vector<float>& _muPos, vector<float>& _sigmaPos, vector<float>& _muNeg, vector<float>& _sigmaNeg,
Mat& _sampleFeatureValue, float& _radioMax, int& _radioMaxIndex);
public:
void processFrame(Mat& _frame, Rect& _objectBox);
void init(Mat& _frame, Rect& _objectBox);
};
CompressiveTracker.cpp
- #include "CompressiveTracker.h"
- #include <math.h>
- #include <iostream>
- using namespace cv;
- using namespace std;
- //------------------------------------------------
- //构造函数,初始化各参数
- CompressiveTracker::CompressiveTracker(void)