pull/29/head
Alex Leontiev 11 years ago
parent ca4d53254b
commit ff73c6f431
  1. 4
      modules/tracking/src/TLD.cpp
  2. 9
      modules/tracking/src/TLD.hpp
  3. 4
      modules/tracking/src/TLDEnsembleClassifier.cpp
  4. 27
      modules/tracking/src/trackerTLD.cpp

@ -50,7 +50,7 @@
using namespace cv;
namespace cv
namespace cv {namespace tld
{
//debug functions and variables
@ -363,4 +363,4 @@ unsigned short int TLDEnsembleClassifier::code(const uchar* data,int rowstep)con
return position;
}
}
}}

@ -45,9 +45,7 @@
#include <algorithm>
#include <limits.h>
using namespace cv;
namespace cv
namespace cv {namespace tld
{
//debug functions and variables
@ -67,7 +65,8 @@ void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,Rect2d whiteOne
void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,std::vector<Rect2d>& whiteOnes);
//aux functions and variables
#define CLIP(x,a,b) MIN(MAX((x),(a)),(b))
//#define CLIP(x,a,b) MIN(MAX((x),(a)),(b))
template<typename T> inline T CLIP(T x,T a,T b){return MIN(MAX(x,a),b);}
double overlap(const Rect2d& r1,const Rect2d& r2);
void resample(const Mat& img,const RotatedRect& r2,Mat_<uchar>& samples);
void resample(const Mat& img,const Rect2d& r2,Mat_<uchar>& samples);
@ -100,4 +99,4 @@ public:
virtual ~TrackerProxy(){}
};
}
}}

@ -48,7 +48,7 @@
using namespace cv;
namespace cv
namespace cv {namespace tld
{
int TLDEnsembleClassifier::getGridSize(){
return 15;
@ -3690,4 +3690,4 @@ void TLDEnsembleClassifier::preinit(int ordinal){
x1[12]=3; x2[12]=3; y1[12]=10; y2[12]=0;
break;
}
}}
}}}

@ -52,9 +52,10 @@
#define CORE_THRESHOLD 0.5
#define NEG_EXAMPLES_IN_INIT_MODEL 300
#define MAX_EXAMPLES_IN_MODEL 500
static const Size GaussBlurKernelSize(3,3);
static const cv::Size GaussBlurKernelSize(3,3);
using namespace cv;
using namespace tld;
/*
* FIXME(optimize):
@ -66,6 +67,22 @@ using namespace cv;
* fix pushbot ->pick commits -> compare_branches->all in 1
* ||video(vadim random, better?) --> debug if box size is less than 20 --> (remove ensemble self-loop) --> (try inter_area)
* perfect PN
*
* vadim:
*
* dprintf
* variance outside
* NCC sqrt(-)
* standard patch out (403)
* pos by 2 in code()
*
* resize
* warpAffine
* cv::integral
*
* 13 as enum
*
* blurred in TrackerTLDModel()
*/
/* design decisions:
@ -496,8 +513,8 @@ bool TLDDetector::detect(const Mat& img,const Mat& imgBlurred,Rect2d& res,std::v
Mat_<unsigned int> intImgP(resized_img.rows,resized_img.cols),intImgP2(resized_img.rows,resized_img.cols);
computeIntegralImages(resized_img,intImgP,intImgP2);
for(int i=0;i<cvFloor((0.0+resized_img.cols-initSize.width)/dx);i++){
for(int j=0;j<cvFloor((0.0+resized_img.rows-initSize.height)/dy);j++){
for(int i=0,imax=cvFloor((0.0+resized_img.cols-initSize.width)/dx);i<imax;i++){
for(int j=0,jmax=cvFloor((0.0+resized_img.rows-initSize.height)/dy);j<jmax;j++){
total++;
if(!patchVariance(intImgP,intImgP2,originalVariance,Point(dx*i,dy*j),initSize)){
continue;
@ -769,10 +786,6 @@ bool Nexpert::operator()(Rect2d box){
Data::Data(Rect2d initBox){
double minDim=MIN(initBox.width,initBox.height);
scale = 20.0/minDim;
/*if(minDim<20){
printf("initial box has size %dx%d, while both dimensions should be no less than %d\n",(int)initBox.width,(int)initBox.height,20);
exit(EXIT_FAILURE);
}*/
minSize.width=(int)(initBox.width*20.0/minDim);
minSize.height=(int)(initBox.height*20.0/minDim);
frameNum=0;

Loading…
Cancel
Save