-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathocvcolor.cpp
41 lines (40 loc) · 1 KB
/
ocvcolor.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
#include "ocvcolor.h"
ocvColor::ocvColor(QString ColorName, QColor rgb, Scalar HSVlower, Scalar HSVupper) {
this->ColorName = ColorName;
this->rgb = rgb;
this->HSVlower = HSVlower;
this->HSVupper = HSVupper;
}
void ocvColor::set_HSV(eHSV hsv, Scalar value_hsv) {
switch(hsv) {
case lower_: {
this->HSVlower = value_hsv;
break;
}
case upper_: {
this->HSVupper = value_hsv;
break;
}
}
}
Scalar ocvColor::get_HSV(eHSV hsv) {
Scalar aux = {0,0,0};
switch(hsv){
case lower_: {
aux = this->HSVlower;
break;
}
case upper_: {
aux = this->HSVupper;
break;
}
} return aux;
}
QVector<Point> ocvColor::get_allPOINTS() {
return this->trackedPOINTS;
}
void ocvColor::operator+(Point pt) {
this->trackedPOINTS.insert(this->trackedPOINTS.begin(), pt);
if(this->trackedPOINTS.size() > BUFFER)
this->trackedPOINTS.pop_back();
}