From 1736cc9739cfbfd181ef2f4921940d9679b1ad82 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 18 Jun 2012 10:59:28 +0000 Subject: [PATCH] Code style fix. dbt face detection example turned off for Windows. --- .../contrib/detection_based_tracker.hpp | 32 +++++++++---------- samples/cpp/dbt_face_detection.cpp | 16 +++++++++- .../cpp/detection_based_tracker_sample.cpp | 3 +- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/modules/contrib/include/opencv2/contrib/detection_based_tracker.hpp b/modules/contrib/include/opencv2/contrib/detection_based_tracker.hpp index df482bab6..35aa81032 100644 --- a/modules/contrib/include/opencv2/contrib/detection_based_tracker.hpp +++ b/modules/contrib/include/opencv2/contrib/detection_based_tracker.hpp @@ -22,53 +22,53 @@ class DetectionBasedTracker { public: IDetector(): - MinObjSize(96, 96), - MaxObjSize(INT_MAX, INT_MAX), - ScaleFactor(1.1f), - MinNeighbours(2) + minObjSize(96, 96), + maxObjSize(INT_MAX, INT_MAX), + scaleFactor(1.1f), + minNeighbours(2) {} virtual void detect(const cv::Mat& Image, std::vector& objects) = 0; void setMinObjectSize(const cv::Size& min) { - MinObjSize = min; + minObjSize = min; } void setMaxObjectSize(const cv::Size& max) { - MaxObjSize = max; + maxObjSize = max; } cv::Size getMinObjectSize() const { - return MinObjSize; + return minObjSize; } cv::Size getMaxObjectSize() const { - return MaxObjSize; + return maxObjSize; } float getScaleFactor() { - return ScaleFactor; + return scaleFactor; } void setScaleFactor(float value) { - ScaleFactor = value; + scaleFactor = value; } int getMinNeighbours() { - return ScaleFactor; + return minNeighbours; } void setMinNeighbours(int value) { - + minNeighbours = value; } virtual ~IDetector() {} protected: - cv::Size MinObjSize; - cv::Size MaxObjSize; - int MinNeighbours; - float ScaleFactor; + cv::Size minObjSize; + cv::Size maxObjSize; + int minNeighbours; + float scaleFactor; }; DetectionBasedTracker(cv::Ptr MainDetector, cv::Ptr TrackingDetector, const Parameters& params); diff --git a/samples/cpp/dbt_face_detection.cpp b/samples/cpp/dbt_face_detection.cpp index 53bb7cf25..4d9eed6e2 100644 --- a/samples/cpp/dbt_face_detection.cpp +++ b/samples/cpp/dbt_face_detection.cpp @@ -1,3 +1,5 @@ +#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID) + #include // Gaussian Blur #include // Basic OpenCV structures (cv::Mat, Scalar) #include // OpenCV window I/O @@ -16,6 +18,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector { public: CascadeDetectorAdapter(cv::Ptr detector): + IDetector(), Detector(detector) { CV_Assert(!detector.empty()); @@ -23,7 +26,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector void detect(const cv::Mat &Image, std::vector &objects) { - Detector->detectMultiScale(Image, objects, ScaleFactor, MinNeighbours, 0, MinObjSize, MaxObjSize); + Detector->detectMultiScale(Image, objects, scaleFactor, minNeighbours, 0, minObjSize, maxObjSize); } virtual ~CascadeDetectorAdapter() {} @@ -87,4 +90,15 @@ int main(int argc, char* argv[]) return 0; } +#else + +#include +int main() +{ + printf("This sample works for UNIX or ANDROID only\n"); + return 0; +} + +#endif + diff --git a/samples/cpp/detection_based_tracker_sample.cpp b/samples/cpp/detection_based_tracker_sample.cpp index 470304790..e08c319db 100644 --- a/samples/cpp/detection_based_tracker_sample.cpp +++ b/samples/cpp/detection_based_tracker_sample.cpp @@ -65,6 +65,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector { public: CascadeDetectorAdapter(cv::Ptr detector): + IDetector(), Detector(detector) { CV_Assert(!detector.empty()); @@ -72,7 +73,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector void detect(const cv::Mat &Image, std::vector &objects) { - Detector->detectMultiScale(Image, objects, 1.1, 3, 0, MinObjSize, MaxObjSize); + Detector->detectMultiScale(Image, objects, 1.1, 3, 0, minObjSize, maxObjSize); } virtual ~CascadeDetectorAdapter() {}