-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDriving_DH.h
69 lines (54 loc) · 1.65 KB
/
Driving_DH.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
68
69
#ifndef DRIVING_DH_H
#define DRIVING_DH_H
#include"opencv2/opencv.hpp"//
using namespace cv;
using namespace std;
class Driving_DH
{
public:
Driving_DH();
Driving_DH(bool printFlag, double sLevel); //cam
Driving_DH(string& filename); //img
Driving_DH(const char* filename); //img
void driving(Mat& frame, double& steerVal, int& resultLineCnt, bool rotaryFlag); //level은 감,가속
void mappingSet(bool cFlag);
private:
void mappingSetSection(double section0_, double section1_, double section2_, double section3_, double section4_, double section5_, double section6_);
void mappingSetValue(double value0_, double value1_, double value2_, double value3_, double value4_, double value5_, double value6_);
void basicSetting();
// 생성자마다 기본세팅
void lineExtend(Vec4i& line, int mode, double& lineSlope);
// 직선을 입력하면 화면전체크기의 직선으로 반환
void imgProcess(Mat& frame, double& steerVal, int& resultLineCnt, bool rotaryFlag);
// imgProcess를 호출하면 frame의 차선을 인식하여
// steerVal로 주행각을 반환한다
// 가중치가 1.0일때( 50을 기준으로 하여 0 ~ 100 ).
double mapping(int linePoint);
// (0 ~ frame_size.height) 의 값을 넣으면
// (0 ~ 50)으로 정해진 setting에따라 맵핑
Size frame_size;
Mat frame_ROI_Line;
Point RoiCenter;
Mat frame_ROI;
Mat frame_hsv;
Mat yellowThreshold;
Mat whiteThreshold;
Mat frame_yellow;
Mat frame_white;
Mat frame_edge;
Point lowest;
Vec4i lowestLine;
Vec4i rightLine;
Vec4i leftLine;
//double rightSlope;
//double leftSlope;
Vec4i resultLine;
bool print;
bool printResult;
double speed;
double steering;
double straightLevel;
double section[7];
double value[7];
};
#endif //DRIVING_DH_H