blob: fe7f836ffd9b6fda13bfe804f008d86ea9152bef (
plain)
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
|
/*
* Blob.hpp
*
*
* A blob is a homogenous patch represented by a polygonal contour.
* Typically a blob tracker uses the contour to figure out the blob's
* persistence and "upgrades" it with ids and other temporal
* information.
*
*/
#ifndef BLOB_H
#define BLOB_H
#include <vector>
class Blob {
public:
std::vector <cv::Point> pts; // the contour of the blob
int nPts; // number of pts;
int id;
float area;
float length;
float angle;
float maccel; //distance traveled since last frame
float age; //how long the blob has been at war
float sitting; //how long hes been sitting in the same place
float downTime;
float lastTimeTimeWasChecked;
cv::Rect boundingRect;
cv::RotatedRect angleBoundingRect;
cv::Point2f centroid, lastCentroid, D;
bool simulated;
bool hole;
cv::Scalar color;
//----------------------------------------
Blob() {
area = 0.0f;
length = 0.0f;
hole = false;
nPts = 0;
simulated = false;
age = 0.0f;
sitting = 0.0f;
color = 0xFFFFFF;
//freakishly long variable name (ala Apple)
//~lastTimeTimeWasChecked = ofGetElapsedTimeMillis(); //get current time as of creation
}
};
#endif
|