Commit ff73c6f4 authored by Alex Leontiev's avatar Alex Leontiev

Vadim

parent ca4d5325
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
using namespace cv; using namespace cv;
namespace cv namespace cv {namespace tld
{ {
//debug functions and variables //debug functions and variables
...@@ -363,4 +363,4 @@ unsigned short int TLDEnsembleClassifier::code(const uchar* data,int rowstep)con ...@@ -363,4 +363,4 @@ unsigned short int TLDEnsembleClassifier::code(const uchar* data,int rowstep)con
return position; return position;
} }
} }}
...@@ -45,9 +45,7 @@ ...@@ -45,9 +45,7 @@
#include <algorithm> #include <algorithm>
#include <limits.h> #include <limits.h>
using namespace cv; namespace cv {namespace tld
namespace cv
{ {
//debug functions and variables //debug functions and variables
...@@ -67,7 +65,8 @@ void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,Rect2d whiteOne ...@@ -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); void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,std::vector<Rect2d>& whiteOnes);
//aux functions and variables //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); 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 RotatedRect& r2,Mat_<uchar>& samples);
void resample(const Mat& img,const Rect2d& r2,Mat_<uchar>& samples); void resample(const Mat& img,const Rect2d& r2,Mat_<uchar>& samples);
...@@ -100,4 +99,4 @@ public: ...@@ -100,4 +99,4 @@ public:
virtual ~TrackerProxy(){} virtual ~TrackerProxy(){}
}; };
} }}
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
using namespace cv; using namespace cv;
namespace cv namespace cv {namespace tld
{ {
int TLDEnsembleClassifier::getGridSize(){ int TLDEnsembleClassifier::getGridSize(){
return 15; return 15;
...@@ -3690,4 +3690,4 @@ void TLDEnsembleClassifier::preinit(int ordinal){ ...@@ -3690,4 +3690,4 @@ void TLDEnsembleClassifier::preinit(int ordinal){
x1[12]=3; x2[12]=3; y1[12]=10; y2[12]=0; x1[12]=3; x2[12]=3; y1[12]=10; y2[12]=0;
break; break;
} }
}} }}}
...@@ -52,9 +52,10 @@ ...@@ -52,9 +52,10 @@
#define CORE_THRESHOLD 0.5 #define CORE_THRESHOLD 0.5
#define NEG_EXAMPLES_IN_INIT_MODEL 300 #define NEG_EXAMPLES_IN_INIT_MODEL 300
#define MAX_EXAMPLES_IN_MODEL 500 #define MAX_EXAMPLES_IN_MODEL 500
static const Size GaussBlurKernelSize(3,3); static const cv::Size GaussBlurKernelSize(3,3);
using namespace cv; using namespace cv;
using namespace tld;
/* /*
* FIXME(optimize): * FIXME(optimize):
...@@ -66,6 +67,22 @@ using namespace cv; ...@@ -66,6 +67,22 @@ using namespace cv;
* fix pushbot ->pick commits -> compare_branches->all in 1 * 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) * ||video(vadim random, better?) --> debug if box size is less than 20 --> (remove ensemble self-loop) --> (try inter_area)
* perfect PN * 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: /* design decisions:
...@@ -496,8 +513,8 @@ bool TLDDetector::detect(const Mat& img,const Mat& imgBlurred,Rect2d& res,std::v ...@@ -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); Mat_<unsigned int> intImgP(resized_img.rows,resized_img.cols),intImgP2(resized_img.rows,resized_img.cols);
computeIntegralImages(resized_img,intImgP,intImgP2); computeIntegralImages(resized_img,intImgP,intImgP2);
for(int i=0;i<cvFloor((0.0+resized_img.cols-initSize.width)/dx);i++){ for(int i=0,imax=cvFloor((0.0+resized_img.cols-initSize.width)/dx);i<imax;i++){
for(int j=0;j<cvFloor((0.0+resized_img.rows-initSize.height)/dy);j++){ for(int j=0,jmax=cvFloor((0.0+resized_img.rows-initSize.height)/dy);j<jmax;j++){
total++; total++;
if(!patchVariance(intImgP,intImgP2,originalVariance,Point(dx*i,dy*j),initSize)){ if(!patchVariance(intImgP,intImgP2,originalVariance,Point(dx*i,dy*j),initSize)){
continue; continue;
...@@ -769,10 +786,6 @@ bool Nexpert::operator()(Rect2d box){ ...@@ -769,10 +786,6 @@ bool Nexpert::operator()(Rect2d box){
Data::Data(Rect2d initBox){ Data::Data(Rect2d initBox){
double minDim=MIN(initBox.width,initBox.height); double minDim=MIN(initBox.width,initBox.height);
scale = 20.0/minDim; 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.width=(int)(initBox.width*20.0/minDim);
minSize.height=(int)(initBox.height*20.0/minDim); minSize.height=(int)(initBox.height*20.0/minDim);
frameNum=0; frameNum=0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment