RLL Computer Vision Code: code/mainwindow.cpp 源文件

RLL Computer Vision

RLL Computer Vision Code  1.0
江苏科技大学HLL战队机器视觉代码
mainwindow.cpp
浏览该文件的文档.
1 #include "mainwindow.h"
2 #include "ui_mainwindow.h"
3 
4 MainWindow::MainWindow(QWidget *parent) :
5  QMainWindow(parent),
6  ui(new Ui::MainWindow)
7 {
8  ui->setupUi(this);
9 
10  //滑动条文本框初始值设置
11  ui->label_redMinValue->setNum(armourDetector.getThreshod(0, 0));
12  ui->label_greenMinValue->setNum(armourDetector.getThreshod(1, 0));
13  ui->label_blueMinValue->setNum(armourDetector.getThreshod(2, 0));
14  ui->label_redMaxValue->setNum(armourDetector.getThreshod(0, 1));
15  ui->label_greenMaxValue->setNum(armourDetector.getThreshod(1, 1));
16  ui->label_blueMaxValue->setNum(armourDetector.getThreshod(2, 1));
17  //滑动条初始值设置
18  ui->horizontalScrollBar_redMin->setValue(armourDetector.getThreshod(0, 0));
19  ui->horizontalScrollBar_greenMin->setValue(armourDetector.getThreshod(1, 0));
20  ui->horizontalScrollBar_blueMin->setValue(armourDetector.getThreshod(2, 0));
21  ui->horizontalScrollBar_redMax->setValue(armourDetector.getThreshod(0, 1));
22  ui->horizontalScrollBar_greenMax->setValue(armourDetector.getThreshod(1, 1));
23  ui->horizontalScrollBar_blueMax->setValue(armourDetector.getThreshod(2, 1));
24 
25  //灯柱块筛选条件初始值设置
26  ui->angleRange->setValue(static_cast<double>(armourDetector.params.angleRange));
27  ui->minArea->setValue(static_cast<double>(armourDetector.params.minArea));
28  ui->maxHeightWidthRat->setValue(static_cast<double>(armourDetector.params.maxHeightWidthRat));
29  ui->minHeightWidthRat->setValue(static_cast<double>(armourDetector.params.minHeightWidthRat));
30  ui->maxWidthRat->setValue(static_cast<double>(armourDetector.params.maxWidthRat));
31  ui->maxHeightRat->setValue(static_cast<double>(armourDetector.params.maxHeightRat));
32  ui->maxAngleDiff->setValue(static_cast<double>(armourDetector.params.maxAngleDiff));
33  ui->maxHeightGapRat->setValue(static_cast<double>(armourDetector.params.maxHeightGapRat));
34  ui->minHeightGapRat->setValue(static_cast<double>(armourDetector.params.minHeightGapRat));
35 }
36 
38 {
39  delete ui;
40 }
41 
42 /*三通道阈值过滤滑动条设置*/
44 {
45  value = value < armourDetector.getThreshod(0, 1) ? value : armourDetector.getThreshod(0, 1);
46  armourDetector.setThreshod(0, 0, value);
47  ui->label_redMinValue->setNum(armourDetector.getThreshod(0, 0));
48 }
49 
51 {
52  value = value < armourDetector.getThreshod(1, 1) ? value : armourDetector.getThreshod(1, 1);
53  armourDetector.setThreshod(1, 0, value);
54  ui->label_greenMinValue->setNum(armourDetector.getThreshod(1, 0));
55 }
56 
58 {
59  value = value < armourDetector.getThreshod(2, 1) ? value : armourDetector.getThreshod(2, 1);
60  armourDetector.setThreshod(2, 0, value);
61  ui->label_blueMinValue->setNum(armourDetector.getThreshod(2, 0));
62 }
63 
65 {
66  value = value > armourDetector.getThreshod(0, 0) ? value : armourDetector.getThreshod(0, 0);
67  armourDetector.setThreshod(0, 1, value);
68  ui->label_redMaxValue->setNum(armourDetector.getThreshod(0, 1));
69 }
70 
72 {
73  value = value > armourDetector.getThreshod(1, 0) ? value : armourDetector.getThreshod(1, 0);
74  armourDetector.setThreshod(1, 1, value);
75  ui->label_greenMaxValue->setNum(armourDetector.getThreshod(1, 1));
76 }
77 
79 {
80  value = value > armourDetector.getThreshod(2, 0) ? value : armourDetector.getThreshod(2, 0);
81  armourDetector.setThreshod(2, 1, value);
82  ui->label_blueMaxValue->setNum(armourDetector.getThreshod(2, 1));
83 }
84 
86 {
87  armourDetector.params.angleRange = static_cast<float>(arg1);
88 }
89 
91 {
92  armourDetector.params.minArea = static_cast<float>(arg1);
93 }
94 
96 {
97  armourDetector.params.maxHeightWidthRat = static_cast<float>(arg1);
98 }
99 
101 {
102  armourDetector.params.minHeightWidthRat = static_cast<float>(arg1);
103 }
104 
106 {
107  armourDetector.params.maxWidthRat = static_cast<float>(arg1);
108 }
109 
111 {
112  armourDetector.params.maxHeightRat = static_cast<float>(arg1);
113 }
114 
116 {
117  armourDetector.params.maxAngleDiff = static_cast<float>(arg1);
118 }
119 
121 {
122  armourDetector.params.maxHeightGapRat = static_cast<float>(arg1);
123 }
124 
126 {
127  armourDetector.params.minHeightGapRat = static_cast<float>(arg1);
128 }
void on_horizontalScrollBar_redMin_valueChanged(int value)
Definition: mainwindow.cpp:43
void on_minHeightGapRat_valueChanged(double arg1)
Definition: mainwindow.cpp:125
void on_minHeightWidthRat_valueChanged(double arg1)
Definition: mainwindow.cpp:100
Definition: mainwindow.h:10
void on_horizontalScrollBar_blueMax_valueChanged(int value)
Definition: mainwindow.cpp:78
int getThreshod(int channel, int minOrMax) const
获取指定通道最大值或者最小值
void on_minArea_valueChanged(double arg1)
Definition: mainwindow.cpp:90
void on_maxHeightGapRat_valueChanged(double arg1)
Definition: mainwindow.cpp:120
void on_maxHeightRat_valueChanged(double arg1)
Definition: mainwindow.cpp:110
void on_horizontalScrollBar_greenMin_valueChanged(int value)
Definition: mainwindow.cpp:50
void on_maxAngleDiff_valueChanged(double arg1)
Definition: mainwindow.cpp:115
void on_horizontalScrollBar_blueMin_valueChanged(int value)
Definition: mainwindow.cpp:57
void setThreshod(int channel, int minOrMax, int value)
设置预处理图像阈值
Ui::MainWindow * ui
Definition: mainwindow.h:55
void on_horizontalScrollBar_redMax_valueChanged(int value)
Definition: mainwindow.cpp:64
MainWindow(QWidget *parent=0)
Definition: mainwindow.cpp:4
void on_maxHeightWidthRat_valueChanged(double arg1)
Definition: mainwindow.cpp:95
struct HCVC::ArmourDetector::Params params
void on_maxWidthRat_valueChanged(double arg1)
Definition: mainwindow.cpp:105
void on_angleRange_valueChanged(double arg1)
Definition: mainwindow.cpp:85
void on_horizontalScrollBar_greenMax_valueChanged(int value)
Definition: mainwindow.cpp:71
ArmourDetector armourDetector
图像检测器,处理并分析图像找出装甲的初始位置
Definition: main_control.h:82
制作者   doxygen 1.8.13