diff --git a/.gitignore b/.gitignore index 8c7c3c0..7fd92b6 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,7 @@ data/INRIAPerson/sigset data/KTH/sigset data/CaltechPedestrians/annotations +### Sublime ### +*.check_cache +*.sublime-project +*.sublime-workspace diff --git a/README.md b/README.md index e5f8c42..95b43b3 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,3 @@ To optionally check out a particular [tagged release](https://github.com/biometr [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/biometrics/openbr/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 7b198e4..075f48c 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -5,4 +5,6 @@ add_subdirectory(br) add_subdirectory(examples) # Build OpenBR GUI application -add_subdirectory(br-gui) +if(NOT ${BR_EMBEDDED}) + add_subdirectory(br-gui) +endif() diff --git a/openbr/core/cluster.cpp b/openbr/core/cluster.cpp index 9657a70..9b3beda 100644 --- a/openbr/core/cluster.cpp +++ b/openbr/core/cluster.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "openbr/core/bee.h" #include "openbr/core/cluster.h" diff --git a/openbr/core/opencvutils.cpp b/openbr/core/opencvutils.cpp index ebef768..ae59267 100644 --- a/openbr/core/opencvutils.cpp +++ b/openbr/core/opencvutils.cpp @@ -15,7 +15,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include +#include #include +#include #include #include "opencvutils.h" diff --git a/openbr/core/opencvutils.h b/openbr/core/opencvutils.h index 2d7cd68..35b16c9 100644 --- a/openbr/core/opencvutils.h +++ b/openbr/core/opencvutils.h @@ -22,6 +22,7 @@ #include #include #include +#include namespace OpenCVUtils { diff --git a/openbr/gui/tail.cpp b/openbr/gui/tail.cpp index 13afff2..e544dfe 100644 --- a/openbr/gui/tail.cpp +++ b/openbr/gui/tail.cpp @@ -1,6 +1,7 @@ #include #include "tail.h" +#include using namespace br; diff --git a/openbr/gui/utility.cpp b/openbr/gui/utility.cpp index 77d6d25..013ece0 100644 --- a/openbr/gui/utility.cpp +++ b/openbr/gui/utility.cpp @@ -1,6 +1,8 @@ #include #include +#include #include +#include #include "utility.h" using namespace cv; diff --git a/openbr/openbr.cpp b/openbr/openbr.cpp index 7e22278..af958db 100644 --- a/openbr/openbr.cpp +++ b/openbr/openbr.cpp @@ -24,6 +24,7 @@ #include "core/qtutils.h" #include "plugins/openbr_internal.h" #include +#include using namespace br; diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index 32e3b6d..327d67c 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -41,6 +41,7 @@ #include #include #include +#include /*! * \defgroup cpp_plugin_sdk C++ Plugin SDK diff --git a/openbr/plugins/cascade.cpp b/openbr/plugins/cascade.cpp index 2abb3c6..cc928b5 100644 --- a/openbr/plugins/cascade.cpp +++ b/openbr/plugins/cascade.cpp @@ -15,6 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include +//#include #include "openbr_internal.h" #include "openbr/core/opencvutils.h" #include "openbr/core/resource.h" @@ -86,11 +87,11 @@ class CascadeTransform : public UntrainableMetaTransform for (int i=0; i rects; - vector rejectLevels; - vector levelWeights; - 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); - else cascade->detectMultiScale(m, rects, 1.2, 5, enrollAll ? 0 : CV_HAAR_FIND_BIGGEST_OBJECT, Size(minSize, minSize)); + std::vector rects; + std::vector rejectLevels; + std::vector levelWeights; + 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); + else cascade->detectMultiScale(m, rects, 1.2, 5, enrollAll ? 0 : CASCADE_FIND_BIGGEST_OBJECT, Size(minSize, minSize)); if (!enrollAll && rects.empty()) rects.push_back(Rect(0, 0, m.cols, m.rows)); diff --git a/openbr/plugins/cvt.cpp b/openbr/plugins/cvt.cpp index ae24339..fc8d9fb 100644 --- a/openbr/plugins/cvt.cpp +++ b/openbr/plugins/cvt.cpp @@ -14,6 +14,7 @@ * limitations under the License. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#include #include #include "openbr_internal.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/distance.cpp b/openbr/plugins/distance.cpp index b2106c8..7d2b242 100644 --- a/openbr/plugins/distance.cpp +++ b/openbr/plugins/distance.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "openbr_internal.h" #include "openbr/core/distance_sse.h" @@ -61,6 +62,7 @@ private: (a.m().type() != b.m().type())) return -std::numeric_limits::max(); +// TODO: this max value is never returned based on the switch / default float result = std::numeric_limits::max(); switch (metric) { case Correlation: diff --git a/openbr/plugins/draw.cpp b/openbr/plugins/draw.cpp index 0a63e8c..624b67f 100644 --- a/openbr/plugins/draw.cpp +++ b/openbr/plugins/draw.cpp @@ -15,6 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include +#include #include #include #include "openbr_internal.h" diff --git a/openbr/plugins/eyes.cpp b/openbr/plugins/eyes.cpp index cdef8df..5d3929d 100644 --- a/openbr/plugins/eyes.cpp +++ b/openbr/plugins/eyes.cpp @@ -34,6 +34,7 @@ */ #include +#include #include "openbr_internal.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/format.cpp b/openbr/plugins/format.cpp index aad33e8..f4baf13 100644 --- a/openbr/plugins/format.cpp +++ b/openbr/plugins/format.cpp @@ -20,6 +20,7 @@ #include #endif // BR_EMBEDDED #include +#include #include "openbr_internal.h" #include "openbr/core/bee.h" diff --git a/openbr/plugins/gui.cpp b/openbr/plugins/gui.cpp index 6d82687..a508d26 100644 --- a/openbr/plugins/gui.cpp +++ b/openbr/plugins/gui.cpp @@ -12,6 +12,7 @@ #include #include +#include #include "openbr_internal.h" #include "openbr/gui/utility.h" diff --git a/openbr/plugins/hist.cpp b/openbr/plugins/hist.cpp index 6fc3bb9..d9f0a05 100644 --- a/openbr/plugins/hist.cpp +++ b/openbr/plugins/hist.cpp @@ -94,7 +94,7 @@ class BinTransform : public UntrainableTransform } else if (channels == 2) { // If there are two channels, the first is channel is assumed to be a weight vector // and the second channel contains the vectors we would like to bin. - vector mv; + std::vector mv; cv::split(src, mv); weights = mv[0]; weights.convertTo(weights, CV_32F); diff --git a/openbr/plugins/integral.cpp b/openbr/plugins/integral.cpp index bb42b4a..f6117a0 100644 --- a/openbr/plugins/integral.cpp +++ b/openbr/plugins/integral.cpp @@ -1,4 +1,5 @@ #include +#include #include #include "openbr_internal.h" @@ -293,7 +294,7 @@ private: Sobel(src, dx, CV_32F, 1, 0, CV_SCHARR); Sobel(src, dy, CV_32F, 0, 1, CV_SCHARR); cartToPolar(dx, dy, magnitude, angle, true); - vector mv; + std::vector mv; if ((channel == Magnitude) || (channel == MagnitudeAndAngle)) { const float theoreticalMaxMagnitude = sqrt(2*pow(float(2*(3+10+3)*255), 2.f)); mv.push_back(magnitude / theoreticalMaxMagnitude); diff --git a/openbr/plugins/lbp.cpp b/openbr/plugins/lbp.cpp index 40e972e..b295286 100644 --- a/openbr/plugins/lbp.cpp +++ b/openbr/plugins/lbp.cpp @@ -15,7 +15,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include +#include #include +#include #include #include "openbr_internal.h" diff --git a/openbr/plugins/ltp.cpp b/openbr/plugins/ltp.cpp index 984987f..df34070 100644 --- a/openbr/plugins/ltp.cpp +++ b/openbr/plugins/ltp.cpp @@ -15,6 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include +#include #include #include "openbr_internal.h" diff --git a/openbr/plugins/mask.cpp b/openbr/plugins/mask.cpp index 3019934..6898c70 100644 --- a/openbr/plugins/mask.cpp +++ b/openbr/plugins/mask.cpp @@ -15,6 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include +#include #include "openbr_internal.h" using namespace cv; @@ -164,7 +165,7 @@ class LargestConvexAreaTransform : public UntrainableTransform void project(const Template &src, Template &dst) const { std::vector< std::vector > contours; - findContours(src.clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE); + findContours(src.m().clone(), contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE); double maxArea = 0; foreach (const std::vector &contour, contours) { std::vector hull; diff --git a/openbr/plugins/motion.cpp b/openbr/plugins/motion.cpp index d746527..6f89d9b 100644 --- a/openbr/plugins/motion.cpp +++ b/openbr/plugins/motion.cpp @@ -62,7 +62,8 @@ class SubtractBackgroundTransform : public TimeVaryingTransform { Q_OBJECT - BackgroundSubtractorMOG2 mog; + // TODO: This is broken. + // BackgroundSubtractorMOG2 mog; public: SubtractBackgroundTransform() : TimeVaryingTransform(false, false) {} @@ -72,7 +73,8 @@ private: { dst = src; Mat mask; - mog(src, mask); + // TODO: broken + // mog(src, mask); erode(mask, mask, Mat()); dilate(mask, mask, Mat()); dst.file.set("Mask", QVariant::fromValue(mask)); @@ -86,7 +88,8 @@ private: void finalize(TemplateList &output) { (void) output; - mog = BackgroundSubtractorMOG2(); + // TODO: Broken + // mog = BackgroundSubtractorMOG2(); } }; diff --git a/openbr/plugins/normalize.cpp b/openbr/plugins/normalize.cpp index 25d7a69..449ca61 100644 --- a/openbr/plugins/normalize.cpp +++ b/openbr/plugins/normalize.cpp @@ -137,7 +137,7 @@ private: const QList labels = data.indexProperty(inputVariable); const int dims = m.cols; - vector mv, av, bv; + std::vector mv, av, bv; split(m, mv); for (size_t c = 0; c < mv.size(); c++) { av.push_back(Mat(1, dims, CV_64FC1)); diff --git a/openbr/plugins/stream.cpp b/openbr/plugins/stream.cpp index 229a418..8407c36 100644 --- a/openbr/plugins/stream.cpp +++ b/openbr/plugins/stream.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "openbr_internal.h" #include "openbr/core/common.h" #include "openbr/core/opencvutils.h" @@ -736,7 +737,6 @@ protected: frameSource = new VideoReader(); } } - open_res = frameSource->open(curr); if (!open_res) { @@ -1420,6 +1420,7 @@ public: { // Delete all the stages for (int i = 0; i < processingStages.size(); i++) { +// TODO: Are we releasing memory which is already freed? delete processingStages[i]; } processingStages.clear();