Moved detection to its own folder

This commit is contained in:
Matt Hill
2014-08-21 07:10:04 -04:00
parent 9aef5ba92c
commit 74bbdc0c5b
2 changed files with 11 additions and 15 deletions

View File

@@ -23,10 +23,6 @@
#include <iostream> #include <iostream>
#include <stdio.h> #include <stdio.h>
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/ml/ml.hpp"
#include "utility.h" #include "utility.h"
#include "support/timing.h" #include "support/timing.h"
@@ -38,28 +34,28 @@ struct PlateRegion
std::vector<PlateRegion> children; std::vector<PlateRegion> children;
}; };
class RegionDetector
class Detector
{ {
public: public:
RegionDetector(Config* config); Detector(Config* config);
virtual ~RegionDetector(); virtual ~Detector();
bool isLoaded(); bool isLoaded();
std::vector<PlateRegion> detect(cv::Mat frame); std::vector<PlateRegion> detect(cv::Mat frame);
std::vector<PlateRegion> detect(cv::Mat frame, std::vector<cv::Rect> regionsOfInterest); virtual std::vector<PlateRegion> detect(cv::Mat frame, std::vector<cv::Rect> regionsOfInterest);
private: protected:
Config* config; Config* config;
float scale_factor;
cv::CascadeClassifier* plate_cascade;
bool loaded; bool loaded;
float scale_factor;
std::vector<PlateRegion> doCascade(cv::Mat frame, std::vector<cv::Rect> regionsOfInterest);
std::vector<PlateRegion> aggregateRegions(std::vector<cv::Rect> regions); std::vector<PlateRegion> aggregateRegions(std::vector<cv::Rect> regions);
}; };
#endif // OPENALPR_REGIONDETECTOR_H #endif // OPENALPR_REGIONDETECTOR_H