Code style fix. dbt face detection example turned off for Windows.
This commit is contained in:
parent
db08656a38
commit
1736cc9739
@ -22,53 +22,53 @@ class DetectionBasedTracker
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IDetector():
|
IDetector():
|
||||||
MinObjSize(96, 96),
|
minObjSize(96, 96),
|
||||||
MaxObjSize(INT_MAX, INT_MAX),
|
maxObjSize(INT_MAX, INT_MAX),
|
||||||
ScaleFactor(1.1f),
|
scaleFactor(1.1f),
|
||||||
MinNeighbours(2)
|
minNeighbours(2)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
virtual void detect(const cv::Mat& Image, std::vector<cv::Rect>& objects) = 0;
|
virtual void detect(const cv::Mat& Image, std::vector<cv::Rect>& objects) = 0;
|
||||||
|
|
||||||
void setMinObjectSize(const cv::Size& min)
|
void setMinObjectSize(const cv::Size& min)
|
||||||
{
|
{
|
||||||
MinObjSize = min;
|
minObjSize = min;
|
||||||
}
|
}
|
||||||
void setMaxObjectSize(const cv::Size& max)
|
void setMaxObjectSize(const cv::Size& max)
|
||||||
{
|
{
|
||||||
MaxObjSize = max;
|
maxObjSize = max;
|
||||||
}
|
}
|
||||||
cv::Size getMinObjectSize() const
|
cv::Size getMinObjectSize() const
|
||||||
{
|
{
|
||||||
return MinObjSize;
|
return minObjSize;
|
||||||
}
|
}
|
||||||
cv::Size getMaxObjectSize() const
|
cv::Size getMaxObjectSize() const
|
||||||
{
|
{
|
||||||
return MaxObjSize;
|
return maxObjSize;
|
||||||
}
|
}
|
||||||
float getScaleFactor()
|
float getScaleFactor()
|
||||||
{
|
{
|
||||||
return ScaleFactor;
|
return scaleFactor;
|
||||||
}
|
}
|
||||||
void setScaleFactor(float value)
|
void setScaleFactor(float value)
|
||||||
{
|
{
|
||||||
ScaleFactor = value;
|
scaleFactor = value;
|
||||||
}
|
}
|
||||||
int getMinNeighbours()
|
int getMinNeighbours()
|
||||||
{
|
{
|
||||||
return ScaleFactor;
|
return minNeighbours;
|
||||||
}
|
}
|
||||||
void setMinNeighbours(int value)
|
void setMinNeighbours(int value)
|
||||||
{
|
{
|
||||||
|
minNeighbours = value;
|
||||||
}
|
}
|
||||||
virtual ~IDetector() {}
|
virtual ~IDetector() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
cv::Size MinObjSize;
|
cv::Size minObjSize;
|
||||||
cv::Size MaxObjSize;
|
cv::Size maxObjSize;
|
||||||
int MinNeighbours;
|
int minNeighbours;
|
||||||
float ScaleFactor;
|
float scaleFactor;
|
||||||
};
|
};
|
||||||
|
|
||||||
DetectionBasedTracker(cv::Ptr<IDetector> MainDetector, cv::Ptr<IDetector> TrackingDetector, const Parameters& params);
|
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/imgproc/imgproc.hpp> // Gaussian Blur
|
||||||
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
|
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
|
||||||
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O
|
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O
|
||||||
@ -16,6 +18,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CascadeDetectorAdapter(cv::Ptr<cv::CascadeClassifier> detector):
|
CascadeDetectorAdapter(cv::Ptr<cv::CascadeClassifier> detector):
|
||||||
|
IDetector(),
|
||||||
Detector(detector)
|
Detector(detector)
|
||||||
{
|
{
|
||||||
CV_Assert(!detector.empty());
|
CV_Assert(!detector.empty());
|
||||||
@ -23,7 +26,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
|
|||||||
|
|
||||||
void detect(const cv::Mat &Image, std::vector<cv::Rect> &objects)
|
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()
|
virtual ~CascadeDetectorAdapter()
|
||||||
{}
|
{}
|
||||||
@ -87,4 +90,15 @@ int main(int argc, char* argv[])
|
|||||||
return 0;
|
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:
|
public:
|
||||||
CascadeDetectorAdapter(cv::Ptr<cv::CascadeClassifier> detector):
|
CascadeDetectorAdapter(cv::Ptr<cv::CascadeClassifier> detector):
|
||||||
|
IDetector(),
|
||||||
Detector(detector)
|
Detector(detector)
|
||||||
{
|
{
|
||||||
CV_Assert(!detector.empty());
|
CV_Assert(!detector.empty());
|
||||||
@ -72,7 +73,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
|
|||||||
|
|
||||||
void detect(const cv::Mat &Image, std::vector<cv::Rect> &objects)
|
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()
|
virtual ~CascadeDetectorAdapter()
|
||||||
{}
|
{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user