Commit 79fa530f authored by Alex Leontiev's avatar Alex Leontiev

vadim

parent 7dca000b
......@@ -88,8 +88,6 @@ using namespace tld;
*
* ?10. all in one class
*
* -->21. precompute offset
*
* 16. loops limits
* 17. inner scope loops
*/
......@@ -569,7 +567,7 @@ bool TLDDetector::detect(const Mat& img,const Mat& imgBlurred,Rect2d& res,std::v
negs.push_back(patches[i].rect);
}
dfprintf((stdout,"%d pos and %d neg\n",(int)poss.size(),(int)negs.size()));
drawWithRects(img,negs,poss);
drawWithRects(img,negs,poss,"tech");
#endif
dfprintf((stdout,"%d after ensemble\n",pass));
......
......@@ -70,7 +70,7 @@ void myassert(const Mat& img);
void printPatch(const Mat_<uchar>& standardPatch);
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,std::vector<Rect2d>& whiteOnes);
void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,std::vector<Rect2d>& whiteOnes,String fileName="");
//aux functions and variables
//#define CLIP(x,a,b) std::min(std::max((x),(a)),(b))
......
......@@ -65,8 +65,9 @@ void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,Rect2d whiteOne
}
imshow("img",image);
}
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,String filename){
Mat image;
static int frameCounter=1;
img.copyTo(image);
for(int i=0;i<(int)whiteOnes.size();i++){
rectangle( image,whiteOnes[i], 255, 1, 1 );
......@@ -75,6 +76,12 @@ void drawWithRects(const Mat& img,std::vector<Rect2d>& blackOnes,std::vector<Rec
rectangle( image,blackOnes[i], 0, 1, 1 );
}
imshow("img",image);
if(filename.length()>0){
char inbuf[100];
sprintf(inbuf,"%s%d.jpg",filename.c_str(),frameCounter);
imwrite(inbuf,image);
frameCounter++;
}
}
void myassert(const Mat& img){
int count=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