Commit ed4aeef7 authored by Alex Leontiev's avatar Alex Leontiev

coding style

parent b6b81962
This diff is collapsed.
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
#include "precomp.hpp" #include "precomp.hpp"
#include "opencv2/video/tracking.hpp" #include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
#include <algorithm> #include<algorithm>
#include <limits.h> #include<limits.h>
namespace cv {namespace tld namespace cv {namespace tld
{ {
...@@ -58,22 +58,21 @@ namespace cv {namespace tld ...@@ -58,22 +58,21 @@ namespace cv {namespace tld
#define dprintf(x) #define dprintf(x)
#endif #endif
#define MEASURE_TIME(a) {\ #define MEASURE_TIME(a) {\
clock_t start;float milisec=0.0;\ clock_t start;float milisec = 0.0;\
start=clock();{a} milisec=1000.0*(clock()-start)/CLOCKS_PER_SEC;\ start = clock();{a} milisec = 1000.0 * (clock() - start) / CLOCKS_PER_SEC;\
dprintf(("%-90s took %f milis\n",#a,milisec)); } dprintf(("%-90s took %f milis\n",#a,milisec)); }
#define HERE dprintf(("line %d\n",__LINE__));fflush(stderr); #define HERE dprintf(("line %d\n",__LINE__));fflush(stderr);
#define START_TICK(name) { clock_t start;double milisec=0.0; start=clock(); #define START_TICK(name) { clock_t start;double milisec = 0.0; start = clock();
#define END_TICK(name) milisec=1000.0*(clock()-start)/CLOCKS_PER_SEC;\ #define END_TICK(name) milisec = 1000.0 * (clock() - start) / CLOCKS_PER_SEC;\
dprintf(("%s took %f milis\n",name,milisec)); } dprintf(("%s took %f milis\n",name,milisec)); }
extern Rect2d etalon; extern Rect2d etalon;
void myassert(const Mat& img); void myassert(const Mat& img);
void printPatch(const Mat_<uchar>& standardPatch); void printPatch(const Mat_<uchar>& standardPatch);
std::string type2str(const Mat& mat); std::string type2str(const Mat& mat);
void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,Rect2d whiteOne=Rect2d(-1.0,-1.0,-1.0,-1.0)); void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,Rect2d whiteOne = Rect2d(-1.0,-1.0,-1.0,-1.0));
void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,std::vector<Rect2d>& whiteOnes,String fileName=""); void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,std::vector<Rect2d>& whiteOnes,String fileName = "");
//aux functions and variables //aux functions and variables
//#define CLIP(x,a,b) std::min(std::max((x),(a)),(b))
template<typename T> inline T CLIP(T x,T a,T b){return std::min(std::max(x,a),b);} template<typename T> inline T CLIP(T x,T a,T b){return std::min(std::max(x,a),b);}
/** Computes overlap between the two given rectangles. Overlap is computed as ratio of rectangles' intersection to that /** Computes overlap between the two given rectangles. Overlap is computed as ratio of rectangles' intersection to that
* of their union.*/ * of their union.*/
...@@ -88,8 +87,8 @@ double variance(const Mat& img); ...@@ -88,8 +87,8 @@ double variance(const Mat& img);
* of the same size).*/ * of the same size).*/
double NCC(const Mat_<uchar>& patch1,const Mat_<uchar>& patch2); double NCC(const Mat_<uchar>& patch1,const Mat_<uchar>& patch2);
void getClosestN(std::vector<Rect2d>& scanGrid,Rect2d bBox,int n,std::vector<Rect2d>& res); void getClosestN(std::vector<Rect2d>& scanGrid,Rect2d bBox,int n,std::vector<Rect2d>& res);
double scaleAndBlur(const Mat& originalImg,int scale,Mat& scaledImg,Mat& blurredImg,Size GaussBlurKernelSize); double scaleAndBlur(const Mat& originalImg,int scale,Mat& scaledImg,Mat& blurredImg,Size GaussBlurKernelSize, double scaleStep);
unsigned int getMedian(const std::vector<unsigned int>& values, int size=-1); int getMedian(const std::vector<int>& values, int size = -1);
class TLDEnsembleClassifier{ class TLDEnsembleClassifier{
public: public:
...@@ -99,8 +98,8 @@ public: ...@@ -99,8 +98,8 @@ public:
double posteriorProbabilityFast(const uchar* data)const; double posteriorProbabilityFast(const uchar* data)const;
void prepareClassifier(int rowstep); void prepareClassifier(int rowstep);
private: private:
TLDEnsembleClassifier(std::vector<Vec4b> meas,int beg,int end); TLDEnsembleClassifier(const std::vector<Vec4b>& meas,int beg,int end);
static void stepPrefSuff(std::vector<Vec4b>& arr,int pos,int len,int gridSize); static void stepPrefSuff(std::vector<Vec4b> & arr,int pos,int len,int gridSize);
int code(const uchar* data,int rowstep)const; int code(const uchar* data,int rowstep)const;
int codeFast(const uchar* data)const; int codeFast(const uchar* data)const;
std::vector<Point2i> posAndNeg; std::vector<Point2i> posAndNeg;
...@@ -111,8 +110,8 @@ private: ...@@ -111,8 +110,8 @@ private:
class TrackerProxy{ class TrackerProxy{
public: public:
virtual bool init( const Mat& image, const Rect2d& boundingBox)=0; virtual bool init( const Mat& image, const Rect2d& boundingBox) = 0;
virtual bool update(const Mat& image, Rect2d& boundingBox)=0; virtual bool update(const Mat& image, Rect2d& boundingBox) = 0;
virtual ~TrackerProxy(){} virtual ~TrackerProxy(){}
}; };
......
This diff is collapsed.
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