File tree Expand file tree Collapse file tree 5 files changed +7
-22
lines changed
Expand file tree Collapse file tree 5 files changed +7
-22
lines changed Original file line number Diff line number Diff line change @@ -54,22 +54,12 @@ std::unique_ptr<BaseDetector> BaseDetector::CreateDetector(tracking::Detectors d
5454 break ;
5555
5656 case tracking::Face_HAAR:
57- #if (CV_VERSION_MAJOR < 5)
5857 detector = std::make_unique<FaceDetector>(frame);
59- #else
60- std::cerr << " Haar detector was removed from OpenCV 5.0" << std::endl;
61- CV_Assert (0 );
62- #endif
6358 break ;
6459
6560 case tracking::Pedestrian_HOG:
6661 case tracking::Pedestrian_C4:
67- #if (CV_VERSION_MAJOR < 5)
6862 detector = std::make_unique<PedestrianDetector>(frame);
69- #else
70- std::cerr << " HOG detector was removed from OpenCV 5.0" << std::endl;
71- CV_Assert (0 );
72- #endif
7363 break ;
7464
7565#ifdef USE_OCV_DNN
Original file line number Diff line number Diff line change 11#include " FaceDetector.h"
22
3- #if (CV_VERSION_MAJOR < 5)
4-
53// /
64// / \brief FaceDetector::FaceDetector
75// / \param gray
@@ -59,5 +57,3 @@ void FaceDetector::Detect(const cv::UMat& gray)
5957 m_regions.push_back (rect);
6058 }
6159}
62-
63- #endif // (CV_VERSION_MAJOR < 5)
Original file line number Diff line number Diff line change 22
33#include " BaseDetector.h"
44
5- #if (CV_VERSION_MAJOR < 5)
5+ #if (CV_VERSION_MAJOR >= 5)
6+ #include < opencv2/xobjdetect.hpp>
7+ #endif // (CV_VERSION_MAJOR < 5)
8+
69// /
710// / \brief The FaceDetector class
811// /
@@ -25,4 +28,3 @@ class FaceDetector final : public BaseDetector
2528private:
2629 cv::CascadeClassifier m_cascade;
2730};
28- #endif // (CV_VERSION_MAJOR < 5)
Original file line number Diff line number Diff line change 11#include " PedestrianDetector.h"
22#include " nms.h"
33
4- #if (CV_VERSION_MAJOR < 5)
5-
64// /
75// / \brief PedestrianDetector::PedestrianDetector
86// / \param gray
@@ -105,4 +103,3 @@ void PedestrianDetector::Detect(const cv::UMat& gray)
105103 m_regions.push_back (rect);
106104 }
107105}
108- #endif // (CV_VERSION_MAJOR < 5)
Original file line number Diff line number Diff line change 22
33#include " BaseDetector.h"
44
5- #if (CV_VERSION_MAJOR < 5)
5+ #if (CV_VERSION_MAJOR >= 5)
6+ #include < opencv2/xobjdetect.hpp>
7+ #endif // (CV_VERSION_MAJOR < 5)
68
79#include " pedestrians/c4-pedestrian-detector.h"
810
@@ -50,5 +52,3 @@ class PedestrianDetector final : public BaseDetector
5052 static const int HUMAN_xdiv = 9 ;
5153 static const int HUMAN_ydiv = 4 ;
5254};
53-
54- #endif // (CV_VERSION_MAJOR < 5)
You can’t perform that action at this time.
0 commit comments