aboutsummaryrefslogtreecommitdiff
path: root/src/Blob.hpp
diff options
context:
space:
mode:
authorAntoine Villeret <avilleret@users.sourceforge.net>2014-07-10 14:39:22 +0000
committerAntoine Villeret <avilleret@users.sourceforge.net>2014-07-10 14:39:22 +0000
commitba994f4404b6eadcab4e0ead46ef4d3ffeceb024 (patch)
tree099dcc6caf1391cf23947317287623c389b9982d /src/Blob.hpp
parente44f63152eb063b5e2e1e05e332439d7c4b7f828 (diff)
lots of changes !
1. switch to a new build system based on automake (because we need to check for some lib on ./configure before make) 2. sort files in different directory 3. add some new features (some of them need OpenCV >= 2.4.5) svn path=/trunk/externals/pix_opencv/; revision=17324
Diffstat (limited to 'src/Blob.hpp')
-rw-r--r--src/Blob.hpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/Blob.hpp b/src/Blob.hpp
new file mode 100644
index 0000000..fe7f836
--- /dev/null
+++ b/src/Blob.hpp
@@ -0,0 +1,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
+
+