Commit c708ac1ea8060ee35a5634c37cdb143bac0025ee

Authored by Mark Burge
1 parent 83b596bd

Inital support for OS X Mavericks, Clang 5.0, OpenCV 2.4.7, C++11, libstdc++

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 <QImage>
2 2 #include <limits>
3 3 #include <vector>
  4 +#include <assert.h>
4 5 #include <opencv2/imgproc/imgproc.hpp>
  6 +#include <opencv2/imgproc/imgproc_c.h>
5 7  
6 8 using namespace cv;
7 9  
... ...
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  
... ... @@ -353,17 +354,6 @@ void br_set_filename(br_template tmpl, const char *filename)
353 354 t->file.name = filename;
354 355 }
355 356  
356   -const char* br_get_metadata_string(br_template tmpl, const char *key)
357   -{
358   - Template *t = reinterpret_cast<Template*>(tmpl);
359   - // need an object outside of this scope
360   - // so the char pointer is valid
361   - static QByteArray result;
362   - QVariant qvar = t->file.value(key);
363   - result = QtUtils::toString(qvar).toUtf8();
364   - return result.data();
365   -}
366   -
367 357 br_template_list br_enroll_template(br_template tmpl)
368 358 {
369 359 Template *t = reinterpret_cast<Template*>(tmpl);
... ...
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 : CV_HAAR_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"
... ...
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  
17 18 using namespace cv;
... ...
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,10 @@ class LargestConvexAreaTransform : public UntrainableTransform
164 165 void project(const Template &src, Template &dst) const
165 166 {
166 167 std::vector< std::vector<Point> > contours;
  168 + // TODO: Fix, src.clone is a br_template not opencv array
  169 + /*
167 170 findContours(src.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE);
  171 + */
168 172 double maxArea = 0;
169 173 foreach (const std::vector<Point> &contour, contours) {
170 174 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
... ... @@ -132,7 +132,7 @@ private:
132 132 const QList<int> labels = data.indexProperty(inputVariable);
133 133 const int dims = m.cols;
134 134  
135   - vector<Mat> mv, av, bv;
  135 + std::vector<Mat> mv, av, bv;
136 136 split(m, mv);
137 137 for (size_t c = 0; c < mv.size(); c++) {
138 138 av.push_back(Mat(1, dims, CV_64FC1));
... ...
openbr/plugins/stream.cpp
... ... @@ -3,7 +3,7 @@
3 3 #include <QThreadPool>
4 4 #include <QSemaphore>
5 5 #include <QMap>
6   -#include <opencv/highgui.h>
  6 +#include <opencv2/highgui/highgui.hpp>
7 7 #include <QtConcurrent>
8 8 #include "openbr_internal.h"
9 9  
... ...