Commit 3dd72adfdba9cecaa33a1ada07c24274f0390d0e
Merge branch 'pr/156'
Showing
25 changed files
with
46 additions
and
15 deletions
.gitignore
README.md
app/CMakeLists.txt
openbr/core/cluster.cpp
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
openbr/gui/tail.cpp
openbr/gui/utility.cpp
openbr/openbr.cpp
openbr/openbr_plugin.h
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
openbr/plugins/format.cpp
openbr/plugins/gui.cpp
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
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(); | ... | ... |