Commit 3dd72adfdba9cecaa33a1ada07c24274f0390d0e

Authored by Josh Klontz
2 parents 6f85ca66 79ac19cc

Merge branch 'pr/156'

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