-
Notifications
You must be signed in to change notification settings - Fork 0
/
Driver.h
67 lines (44 loc) · 1.27 KB
/
Driver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
NumberPlateRecognition using SVM
Driver.h
Michal Půlpán
Loads image based on arguments
Gets image, detects all possible regions and trains SVM
*/
#include <vector>
#include <string>
//#include <iostream>
#include <algorithm>
#include <filesystem>
#include "DetectRegions.h"
#include "opencv2/ml/ml.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
class Driver {
public:
Driver(){};
void mainLoop(const std::vector<std::string> &arguments);
private:
cv::Mat Work( cv::Ptr<cv::ml::SVM> svm, const cv::Mat& input_img);
cv::Mat loadImg(const std::string& path);
std::string inputFile_;
std::string inputFolder;
std::string outputFolder;
bool showSteps_;
bool loop;
bool showOutput;
bool saveOutput;
bool usingPhoto;
bool usingFolder;
bool debug;
cv::Ptr<cv::ml::SVM> svm_;
cv::Mat DrawRotatedRect(const cv::Mat& mat, const cv::RotatedRect& rect);
void run();
bool isItReallyAPlate(const Plate& plate);
void printHelp();
void loadPhoto();
void loadFolder();
void saveToFolder();
cv::Ptr<cv::ml::SVM> TrainSVM();
};