Code style fix. dbt face detection example turned off for Windows.

pull/2/head
Alexander Smorkalov 13 years ago
parent db08656a38
commit 1736cc9739
  1. 32
      modules/contrib/include/opencv2/contrib/detection_based_tracker.hpp
  2. 16
      samples/cpp/dbt_face_detection.cpp
  3. 3
      samples/cpp/detection_based_tracker_sample.cpp

@ -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<cv::Rect>& 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<IDetector> MainDetector, cv::Ptr<IDetector> TrackingDetector, const Parameters& params);

@ -1,3 +1,5 @@
#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
#include <opencv2/imgproc/imgproc.hpp> // Gaussian Blur
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O
@ -16,6 +18,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
{
public:
CascadeDetectorAdapter(cv::Ptr<cv::CascadeClassifier> 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<cv::Rect> &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 <stdio.h>
int main()
{
printf("This sample works for UNIX or ANDROID only\n");
return 0;
}
#endif

@ -65,6 +65,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
{
public:
CascadeDetectorAdapter(cv::Ptr<cv::CascadeClassifier> 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<cv::Rect> &objects)
{
Detector->detectMultiScale(Image, objects, 1.1, 3, 0, MinObjSize, MaxObjSize);
Detector->detectMultiScale(Image, objects, 1.1, 3, 0, minObjSize, maxObjSize);
}
virtual ~CascadeDetectorAdapter()
{}

Loading…
Cancel
Save