-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBallTracker.h
50 lines (41 loc) · 1.06 KB
/
BallTracker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "Utils.h"
#include <deque>
#include "Robot.h"
using namespace std;
#ifndef BALLTRACKER_H
#define BALLTRACKER_H
class Robot;
static int width = 320;
static int height = 240;
static CvScalar BALL_COLOR_HSV = cvScalar(270,0.52,0.5);
const double rg[3]={20,0.2,0.3};
int checkColorThreshold(float* c);
struct BallTracker
{
deque<cv::Point3f> pos_scr;//x,y,r on screen
deque<cv::Point3f> pos;//x,y,t in worldCoordinate
deque<IplImage*> images;
Robot* robot;
~BallTracker();
void scr2wld(int frameId);
int pushFrame(const IplImage* image, double t);
int processFrame(int frameId);
int popFrame(int numOfFrame);
int popBackFrame(int numOfFrame);
cv::Point3f ballDetect(const IplImage* image1);
void setParent(Robot* robot){ this->robot = robot; };
};
struct Area
{
int id;
double x;
double y;
int xmin;
int ymin;
int xmax;
int ymax;
int area;
Area(int id,int x,int y,int xmin,int xmax,int ymin,int ymax,int area)
{this->id=id;this->x=x;this->y=y;this->area=area;this->xmin=xmin;this->xmax=xmax;this->ymin=ymin;this->ymax=ymax;};
};
#endif