Commit 3dd72adfdba9cecaa33a1ada07c24274f0390d0e

Authored by Josh Klontz
2 parents 6f85ca66 79ac19cc

Merge branch 'pr/156'

.gitignore
@@ -42,3 +42,7 @@ data/INRIAPerson/sigset @@ -42,3 +42,7 @@ data/INRIAPerson/sigset
42 data/KTH/sigset 42 data/KTH/sigset
43 data/CaltechPedestrians/annotations 43 data/CaltechPedestrians/annotations
44 44
  45 +### Sublime ###
  46 +*.check_cache
  47 +*.sublime-project
  48 +*.sublime-workspace
README.md
@@ -14,4 +14,3 @@ To optionally check out a particular [tagged release](https://github.com/biometr @@ -14,4 +14,3 @@ To optionally check out a particular [tagged release](https://github.com/biometr
14 14
15 15
16 [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/biometrics/openbr/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 16 [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/biometrics/openbr/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
17 -  
app/CMakeLists.txt
@@ -5,4 +5,6 @@ add_subdirectory(br) @@ -5,4 +5,6 @@ add_subdirectory(br)
5 add_subdirectory(examples) 5 add_subdirectory(examples)
6 6
7 # Build OpenBR GUI application 7 # Build OpenBR GUI application
8 -add_subdirectory(br-gui) 8 +if(NOT ${BR_EMBEDDED})
  9 + add_subdirectory(br-gui)
  10 +endif()
openbr/core/cluster.cpp
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
21 #include <QSet> 21 #include <QSet>
22 #include <limits> 22 #include <limits>
23 #include <openbr/openbr_plugin.h> 23 #include <openbr/openbr_plugin.h>
  24 +#include <assert.h>
24 25
25 #include "openbr/core/bee.h" 26 #include "openbr/core/bee.h"
26 #include "openbr/core/cluster.h" 27 #include "openbr/core/cluster.h"
openbr/core/opencvutils.cpp
@@ -15,7 +15,9 @@ @@ -15,7 +15,9 @@
15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16 16
17 #include <opencv2/highgui/highgui.hpp> 17 #include <opencv2/highgui/highgui.hpp>
  18 +#include <opencv2/highgui/highgui_c.h>
18 #include <opencv2/imgproc/imgproc.hpp> 19 #include <opencv2/imgproc/imgproc.hpp>
  20 +#include <opencv2/imgproc/imgproc_c.h>
19 #include <openbr/openbr_plugin.h> 21 #include <openbr/openbr_plugin.h>
20 22
21 #include "opencvutils.h" 23 #include "opencvutils.h"
openbr/core/opencvutils.h
@@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
22 #include <QString> 22 #include <QString>
23 #include <QStringList> 23 #include <QStringList>
24 #include <opencv2/core/core.hpp> 24 #include <opencv2/core/core.hpp>
  25 +#include <assert.h>
25 26
26 namespace OpenCVUtils 27 namespace OpenCVUtils
27 { 28 {
openbr/gui/tail.cpp
1 #include <QtConcurrentRun> 1 #include <QtConcurrentRun>
2 2
3 #include "tail.h" 3 #include "tail.h"
  4 +#include <assert.h>
4 5
5 using namespace br; 6 using namespace br;
6 7
openbr/gui/utility.cpp
1 #include <limits> 1 #include <limits>
2 #include <vector> 2 #include <vector>
  3 +#include <assert.h>
3 #include <opencv2/imgproc/imgproc.hpp> 4 #include <opencv2/imgproc/imgproc.hpp>
  5 +#include <opencv2/imgproc/imgproc_c.h>
4 #include "utility.h" 6 #include "utility.h"
5 7
6 using namespace cv; 8 using namespace cv;
openbr/openbr.cpp
@@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
24 #include "core/qtutils.h" 24 #include "core/qtutils.h"
25 #include "plugins/openbr_internal.h" 25 #include "plugins/openbr_internal.h"
26 #include <opencv2/highgui/highgui.hpp> 26 #include <opencv2/highgui/highgui.hpp>
  27 +#include <opencv2/highgui/highgui_c.h>
27 28
28 using namespace br; 29 using namespace br;
29 30
openbr/openbr_plugin.h
@@ -41,6 +41,7 @@ @@ -41,6 +41,7 @@
41 #include <QVector> 41 #include <QVector>
42 #include <opencv2/core/core.hpp> 42 #include <opencv2/core/core.hpp>
43 #include <openbr/openbr.h> 43 #include <openbr/openbr.h>
  44 +#include <assert.h>
44 45
45 /*! 46 /*!
46 * \defgroup cpp_plugin_sdk C++ Plugin SDK 47 * \defgroup cpp_plugin_sdk C++ Plugin SDK
openbr/plugins/cascade.cpp
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16 16
17 #include <opencv2/objdetect/objdetect.hpp> 17 #include <opencv2/objdetect/objdetect.hpp>
  18 +//#include <opencv2/objdetect/objdetect_c.h>
18 #include "openbr_internal.h" 19 #include "openbr_internal.h"
19 #include "openbr/core/opencvutils.h" 20 #include "openbr/core/opencvutils.h"
20 #include "openbr/core/resource.h" 21 #include "openbr/core/resource.h"
@@ -86,11 +87,11 @@ class CascadeTransform : public UntrainableMetaTransform @@ -86,11 +87,11 @@ class CascadeTransform : public UntrainableMetaTransform
86 87
87 for (int i=0; i<t.size(); i++) { 88 for (int i=0; i<t.size(); i++) {
88 const Mat &m = t[i]; 89 const Mat &m = t[i];
89 - vector<Rect> rects;  
90 - vector<int> rejectLevels;  
91 - vector<double> levelWeights;  
92 - if (ROCMode) cascade->detectMultiScale(m, rects, rejectLevels, levelWeights, 1.2, 5, (enrollAll ? 0 : CV_HAAR_FIND_BIGGEST_OBJECT) | CV_HAAR_SCALE_IMAGE, Size(minSize, minSize), Size(), true);  
93 - else cascade->detectMultiScale(m, rects, 1.2, 5, enrollAll ? 0 : CV_HAAR_FIND_BIGGEST_OBJECT, Size(minSize, minSize)); 90 + std::vector<Rect> rects;
  91 + std::vector<int> rejectLevels;
  92 + std::vector<double> levelWeights;
  93 + if (ROCMode) cascade->detectMultiScale(m, rects, rejectLevels, levelWeights, 1.2, 5, (enrollAll ? 0 : CASCADE_FIND_BIGGEST_OBJECT) | CASCADE_SCALE_IMAGE, Size(minSize, minSize), Size(), true);
  94 + else cascade->detectMultiScale(m, rects, 1.2, 5, enrollAll ? 0 : CASCADE_FIND_BIGGEST_OBJECT, Size(minSize, minSize));
94 95
95 if (!enrollAll && rects.empty()) 96 if (!enrollAll && rects.empty())
96 rects.push_back(Rect(0, 0, m.cols, m.rows)); 97 rects.push_back(Rect(0, 0, m.cols, m.rows));
openbr/plugins/cvt.cpp
@@ -14,6 +14,7 @@ @@ -14,6 +14,7 @@
14 * limitations under the License. * 14 * limitations under the License. *
15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16 16
  17 +#include <opencv2/imgproc/imgproc_c.h>
17 #include <opencv2/imgproc/imgproc.hpp> 18 #include <opencv2/imgproc/imgproc.hpp>
18 #include "openbr_internal.h" 19 #include "openbr_internal.h"
19 #include "openbr/core/opencvutils.h" 20 #include "openbr/core/opencvutils.h"
openbr/plugins/distance.cpp
@@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
18 #include <QtConcurrentRun> 18 #include <QtConcurrentRun>
19 #include <numeric> 19 #include <numeric>
20 #include <opencv2/imgproc/imgproc.hpp> 20 #include <opencv2/imgproc/imgproc.hpp>
  21 +#include <opencv2/imgproc/imgproc_c.h>
21 #include "openbr_internal.h" 22 #include "openbr_internal.h"
22 23
23 #include "openbr/core/distance_sse.h" 24 #include "openbr/core/distance_sse.h"
@@ -61,6 +62,7 @@ private: @@ -61,6 +62,7 @@ private:
61 (a.m().type() != b.m().type())) 62 (a.m().type() != b.m().type()))
62 return -std::numeric_limits<float>::max(); 63 return -std::numeric_limits<float>::max();
63 64
  65 +// TODO: this max value is never returned based on the switch / default
64 float result = std::numeric_limits<float>::max(); 66 float result = std::numeric_limits<float>::max();
65 switch (metric) { 67 switch (metric) {
66 case Correlation: 68 case Correlation:
openbr/plugins/draw.cpp
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16 16
17 #include <opencv2/highgui/highgui.hpp> 17 #include <opencv2/highgui/highgui.hpp>
  18 +#include <opencv2/highgui/highgui_c.h>
18 #include <opencv2/imgproc/imgproc.hpp> 19 #include <opencv2/imgproc/imgproc.hpp>
19 #include <vector> 20 #include <vector>
20 #include "openbr_internal.h" 21 #include "openbr_internal.h"
openbr/plugins/eyes.cpp
@@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
34 */ 34 */
35 35
36 #include <opencv2/imgproc/imgproc.hpp> 36 #include <opencv2/imgproc/imgproc.hpp>
  37 +#include <opencv2/imgproc/imgproc_c.h>
37 #include "openbr_internal.h" 38 #include "openbr_internal.h"
38 #include "openbr/core/opencvutils.h" 39 #include "openbr/core/opencvutils.h"
39 40
openbr/plugins/format.cpp
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
20 #include <QtXml> 20 #include <QtXml>
21 #endif // BR_EMBEDDED 21 #endif // BR_EMBEDDED
22 #include <opencv2/highgui/highgui.hpp> 22 #include <opencv2/highgui/highgui.hpp>
  23 +#include <opencv2/highgui/highgui_c.h>
23 #include "openbr_internal.h" 24 #include "openbr_internal.h"
24 25
25 #include "openbr/core/bee.h" 26 #include "openbr/core/bee.h"
openbr/plugins/gui.cpp
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 #include <QLineEdit> 12 #include <QLineEdit>
13 13
14 #include <opencv2/imgproc/imgproc.hpp> 14 #include <opencv2/imgproc/imgproc.hpp>
  15 +#include <opencv2/imgproc/imgproc_c.h>
15 #include "openbr_internal.h" 16 #include "openbr_internal.h"
16 #include "openbr/gui/utility.h" 17 #include "openbr/gui/utility.h"
17 18
openbr/plugins/hist.cpp
@@ -94,7 +94,7 @@ class BinTransform : public UntrainableTransform @@ -94,7 +94,7 @@ class BinTransform : public UntrainableTransform
94 } else if (channels == 2) { 94 } else if (channels == 2) {
95 // If there are two channels, the first is channel is assumed to be a weight vector 95 // If there are two channels, the first is channel is assumed to be a weight vector
96 // and the second channel contains the vectors we would like to bin. 96 // and the second channel contains the vectors we would like to bin.
97 - vector<Mat> mv; 97 + std::vector<Mat> mv;
98 cv::split(src, mv); 98 cv::split(src, mv);
99 weights = mv[0]; 99 weights = mv[0];
100 weights.convertTo(weights, CV_32F); 100 weights.convertTo(weights, CV_32F);
openbr/plugins/integral.cpp
1 #include <opencv2/imgproc/imgproc.hpp> 1 #include <opencv2/imgproc/imgproc.hpp>
  2 +#include <opencv2/imgproc/imgproc_c.h>
2 #include <Eigen/Core> 3 #include <Eigen/Core>
3 #include "openbr_internal.h" 4 #include "openbr_internal.h"
4 5
@@ -293,7 +294,7 @@ private: @@ -293,7 +294,7 @@ private:
293 Sobel(src, dx, CV_32F, 1, 0, CV_SCHARR); 294 Sobel(src, dx, CV_32F, 1, 0, CV_SCHARR);
294 Sobel(src, dy, CV_32F, 0, 1, CV_SCHARR); 295 Sobel(src, dy, CV_32F, 0, 1, CV_SCHARR);
295 cartToPolar(dx, dy, magnitude, angle, true); 296 cartToPolar(dx, dy, magnitude, angle, true);
296 - vector<Mat> mv; 297 + std::vector<Mat> mv;
297 if ((channel == Magnitude) || (channel == MagnitudeAndAngle)) { 298 if ((channel == Magnitude) || (channel == MagnitudeAndAngle)) {
298 const float theoreticalMaxMagnitude = sqrt(2*pow(float(2*(3+10+3)*255), 2.f)); 299 const float theoreticalMaxMagnitude = sqrt(2*pow(float(2*(3+10+3)*255), 2.f));
299 mv.push_back(magnitude / theoreticalMaxMagnitude); 300 mv.push_back(magnitude / theoreticalMaxMagnitude);
openbr/plugins/lbp.cpp
@@ -15,7 +15,9 @@ @@ -15,7 +15,9 @@
15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16 16
17 #include <opencv2/imgproc/imgproc.hpp> 17 #include <opencv2/imgproc/imgproc.hpp>
  18 +#include <opencv2/imgproc/imgproc_c.h>
18 #include <opencv2/highgui/highgui.hpp> 19 #include <opencv2/highgui/highgui.hpp>
  20 +#include <opencv2/highgui/highgui_c.h>
19 #include <limits> 21 #include <limits>
20 #include "openbr_internal.h" 22 #include "openbr_internal.h"
21 23
openbr/plugins/ltp.cpp
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16 16
17 #include <opencv2/imgproc/imgproc.hpp> 17 #include <opencv2/imgproc/imgproc.hpp>
  18 +#include <opencv2/imgproc/imgproc_c.h>
18 #include <limits> 19 #include <limits>
19 #include "openbr_internal.h" 20 #include "openbr_internal.h"
20 21
openbr/plugins/mask.cpp
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 15 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16 16
17 #include <opencv2/imgproc/imgproc.hpp> 17 #include <opencv2/imgproc/imgproc.hpp>
  18 +#include <opencv2/imgproc/imgproc_c.h>
18 #include "openbr_internal.h" 19 #include "openbr_internal.h"
19 20
20 using namespace cv; 21 using namespace cv;
@@ -164,7 +165,7 @@ class LargestConvexAreaTransform : public UntrainableTransform @@ -164,7 +165,7 @@ class LargestConvexAreaTransform : public UntrainableTransform
164 void project(const Template &src, Template &dst) const 165 void project(const Template &src, Template &dst) const
165 { 166 {
166 std::vector< std::vector<Point> > contours; 167 std::vector< std::vector<Point> > contours;
167 - findContours(src.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE); 168 + findContours(src.m().clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE);
168 double maxArea = 0; 169 double maxArea = 0;
169 foreach (const std::vector<Point> &contour, contours) { 170 foreach (const std::vector<Point> &contour, contours) {
170 std::vector<Point> hull; 171 std::vector<Point> hull;
openbr/plugins/motion.cpp
@@ -62,7 +62,8 @@ class SubtractBackgroundTransform : public TimeVaryingTransform @@ -62,7 +62,8 @@ class SubtractBackgroundTransform : public TimeVaryingTransform
62 { 62 {
63 Q_OBJECT 63 Q_OBJECT
64 64
65 - BackgroundSubtractorMOG2 mog; 65 + // TODO: This is broken.
  66 + // BackgroundSubtractorMOG2 mog;
66 67
67 public: 68 public:
68 SubtractBackgroundTransform() : TimeVaryingTransform(false, false) {} 69 SubtractBackgroundTransform() : TimeVaryingTransform(false, false) {}
@@ -72,7 +73,8 @@ private: @@ -72,7 +73,8 @@ private:
72 { 73 {
73 dst = src; 74 dst = src;
74 Mat mask; 75 Mat mask;
75 - mog(src, mask); 76 + // TODO: broken
  77 + // mog(src, mask);
76 erode(mask, mask, Mat()); 78 erode(mask, mask, Mat());
77 dilate(mask, mask, Mat()); 79 dilate(mask, mask, Mat());
78 dst.file.set("Mask", QVariant::fromValue(mask)); 80 dst.file.set("Mask", QVariant::fromValue(mask));
@@ -86,7 +88,8 @@ private: @@ -86,7 +88,8 @@ private:
86 void finalize(TemplateList &output) 88 void finalize(TemplateList &output)
87 { 89 {
88 (void) output; 90 (void) output;
89 - mog = BackgroundSubtractorMOG2(); 91 + // TODO: Broken
  92 + // mog = BackgroundSubtractorMOG2();
90 } 93 }
91 }; 94 };
92 95
openbr/plugins/normalize.cpp
@@ -137,7 +137,7 @@ private: @@ -137,7 +137,7 @@ private:
137 const QList<int> labels = data.indexProperty(inputVariable); 137 const QList<int> labels = data.indexProperty(inputVariable);
138 const int dims = m.cols; 138 const int dims = m.cols;
139 139
140 - vector<Mat> mv, av, bv; 140 + std::vector<Mat> mv, av, bv;
141 split(m, mv); 141 split(m, mv);
142 for (size_t c = 0; c < mv.size(); c++) { 142 for (size_t c = 0; c < mv.size(); c++) {
143 av.push_back(Mat(1, dims, CV_64FC1)); 143 av.push_back(Mat(1, dims, CV_64FC1));
openbr/plugins/stream.cpp
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 #include <QQueue> 7 #include <QQueue>
8 #include <QtConcurrent> 8 #include <QtConcurrent>
9 #include <opencv/highgui.h> 9 #include <opencv/highgui.h>
  10 +#include <opencv2/highgui/highgui.hpp>
10 #include "openbr_internal.h" 11 #include "openbr_internal.h"
11 #include "openbr/core/common.h" 12 #include "openbr/core/common.h"
12 #include "openbr/core/opencvutils.h" 13 #include "openbr/core/opencvutils.h"
@@ -736,7 +737,6 @@ protected: @@ -736,7 +737,6 @@ protected:
736 frameSource = new VideoReader(); 737 frameSource = new VideoReader();
737 } 738 }
738 } 739 }
739 -  
740 open_res = frameSource->open(curr); 740 open_res = frameSource->open(curr);
741 if (!open_res) 741 if (!open_res)
742 { 742 {
@@ -1420,6 +1420,7 @@ public: @@ -1420,6 +1420,7 @@ public:
1420 { 1420 {
1421 // Delete all the stages 1421 // Delete all the stages
1422 for (int i = 0; i < processingStages.size(); i++) { 1422 for (int i = 0; i < processingStages.size(); i++) {
  1423 +// TODO: Are we releasing memory which is already freed?
1423 delete processingStages[i]; 1424 delete processingStages[i];
1424 } 1425 }
1425 processingStages.clear(); 1426 processingStages.clear();