forked from akaifi/MultiObjectTrackingBasedOnColor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Object.cpp
112 lines (69 loc) · 1.48 KB
/
Object.cpp
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#include "Object.h"
Object::Object()
{
//set values for default constructor
setType("Object");
setColor(Scalar(0,0,0));
}
Object::Object(string name){
setType(name);
if(name=="blue"){
//TODO: use "calibration mode" to find HSV min
//and HSV max values
setHSVmin(Scalar(92,0,0));
setHSVmax(Scalar(124,256,256));
//BGR value for Green:
setColor(Scalar(255,0,0));
}
if(name=="green"){
//TODO: use "calibration mode" to find HSV min
//and HSV max values
setHSVmin(Scalar(34,50,50));
setHSVmax(Scalar(80,220,200));
//BGR value for Yellow:
setColor(Scalar(0,255,0));
}
if(name=="yellow"){
//TODO: use "calibration mode" to find HSV min
//and HSV max values
setHSVmin(Scalar(20,124,123));
setHSVmax(Scalar(30,256,256));
//BGR value for Red:
setColor(Scalar(0,255,255));
}
if(name=="red"){
//TODO: use "calibration mode" to find HSV min
//and HSV max values
setHSVmin(Scalar(0,200,0));
setHSVmax(Scalar(19,255,255));
//BGR value for Red:
setColor(Scalar(0,0,255));
}
}
Object::~Object(void)
{
}
int Object::getXPos(){
return Object::xPos;
}
void Object::setXPos(int x){
Object::xPos = x;
}
int Object::getYPos(){
return Object::yPos;
}
void Object::setYPos(int y){
Object::yPos = y;
}
Scalar Object::getHSVmin(){
return Object::HSVmin;
}
Scalar Object::getHSVmax(){
return Object::HSVmax;
}
void Object::setHSVmin(Scalar min){
Object::HSVmin = min;
}
void Object::setHSVmax(Scalar max){
Object::HSVmax = max;
}