├── README.md ├── client ├── README.md └── win64 │ └── src │ ├── CengLou.pro │ ├── CengLou.pro.user │ ├── Table of Contents.hhc │ ├── about.cpp │ ├── about.h │ ├── about.ui │ ├── help.chm │ ├── help.hhp │ ├── ic.ico │ ├── lulu.png │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── mainwindow.ui │ ├── spider.py │ ├── switchcontrol.cpp │ ├── switchcontrol.h │ ├── switchcontrol.ui │ ├── videoproc.cpp │ ├── videoproc.h │ ├── yawinf.cpp │ ├── yawinf.h │ └── yawinf.ui ├── elecCtl ├── README.md └── src │ └── README.md ├── mechanics ├── README.md ├── pic │ └── wholeCar.jpeg ├── 云台中控.SLDPRT ├── 云台支架.SLDPRT ├── 云台支架0816.SLDPRT └── 装配体2.SLDASM ├── other ├── README.md ├── clientpic │ ├── client.png │ ├── clientpic.png │ └── xmCam.gif ├── detect │ └── faceDetect.png └── jetsonpic │ ├── re │ ├── tk1.jpg │ └── tx2.png └── vision ├── CengLou.pro ├── Makefile ├── README.md ├── ccallocal.cpp ├── ccallocal.h ├── ccallocal.o ├── cfacerec.cpp ├── cfacerec.h ├── cfacerec.o ├── cgetimg.cpp ├── cgetimg.h ├── cgetimg.o ├── cimgproc.cpp ├── cimgproc.h ├── cimgproc.o ├── cserial.cpp ├── cserial.h ├── cserial.o ├── csetting.cpp ├── csetting.h ├── faceinfotomysql.cpp ├── faceinfotomysql.h ├── fairsionCam ├── ReadMe └── fairsionCamera_arm_i686.bin ├── jetpack └── README.md ├── main.cpp ├── main.o └── module └── haarcascade_frontalface_alt.xml /README.md: -------------------------------------------------------------------------------- 1 |

Welcome to CengLou 👋

2 | 3 | > 一个想到哪做到哪的机器人项目 a 4 |

5 | 6 |

7 | 8 | ### ✨ 简介 9 | 1.毕业设计的项目-基于OpenCV的人脸识别工具的设计与实现; 10 | 2.但是目前毕业了,人脸识别功能将在新版本中去除,物体识别将会代替 11 | 12 | ⬇️[下载地址](https://github.com/Hiiam9) 13 | 14 | ## 🚀 快速使用 15 | ⚙️机械结构: 16 | 目前拼凑出的整体图如下,后续会舍弃掉一些(如测试使用的intel神经元计算棒) 17 |

各个模块细节查看:https://github.com/Hiiam9/CengLou/blob/main/mechanics

18 | 19 | 💡整体软硬件平台 20 | 21 | ⚡️硬件: 22 | 上位机---Nvidia Tegra K1 || Nvidia Tegra X1 || Nvidia Tegra X2 23 |

24 | 下位机---STM32 F4系列芯片(引脚可能部分不同) 25 | 底 盘---STM32 F1系列芯片 (底盘采用的是有方机器人的套件,只有遥控部分做了一些线路和通信协议的改动) 26 | 27 | 📷 摄像头 28 | 29 | 30 | **在使用之前,请务必阅读各个目录的README文件** 31 | 将最新工程clone到本地,并进入CengLou目录 32 | 33 | 1. #sudo chmod +x install.sh 34 | 35 | 2. #./install 36 | 37 | 3. #./cenglou -f /*启动人脸识别*/ 38 | 39 | 说明:安装脚本install.sh 使用了各个工程的makefile文件,如需单独使用某个工程,请单独编译。 40 | 41 | ## 🛠 功能与设置 42 | 功能: 43 | - 人脸识别与云台跟踪 44 | 人脸检测

45 | - 识别信息存入数据库 46 | 47 | 设置: 48 | ```bash 49 | #./cenglou -f /*单独启动人脸识别模式,不向下位机发送数据,不存入数据库*/ 50 | 51 | #./cenglou -a /*启动所有功能 人脸识别 入库 向下位机发送yaw&pitch坐标*/ 52 | ``` 53 | ## 🚀 客户端 54 | *客户端目前只测试了ubuntu 14.04 及以上的linux操作系统,但理论上只要运行客户端的主机安装了OpenCV3和Py3 即可跨平台* 55 | v1.0 Form: 56 |

57 | - 功能 : 58 | 1.光毓电机调试 59 | 2.雄迈摄像头串口调试 60 | 3.yaw-pitch 三环读取 61 | 4.后台数据库识别信息查看 62 | 5.上位机状态展示 63 | 64 | 客户端下载:[源码地址](https://github.com/Hiiam9/CengLou/tree/main/client) 65 | 构建说明参考client目录下的[README](https://github.com/Hiiam9/CengLou/blob/main/client/README.md)文件 66 | ## ⚡️ 调试 67 | ## 📱通信协议 68 | 1.上位机至下位机通信协议 69 | 主要用于云台角度交互 70 | |Byte0|Byte1|Byte2|Byte3|Byte4|Byte5| 71 | |:--|:--|:--|:--|:--|:--| 72 | |0xA0|cmdID|CRC8_Check|pitch_data|pitch_data|pitch_data| 73 | |Byte6|Byte7|Byte8|Byte9|Byte10|Byte11| 74 | |pitch_data|yaw_data|yaw_data|yaw_data|yaw_data|flag| 75 | 76 | ## 📖数据库 77 | 本项目数据库拟采用MYSQL进行存储,只要存储目标的特征信息 78 | 79 | ## 😘 参与此项目 80 | 由于目前此项目完全是一个人在搞,个人水平的限制造成太多不完善,希望有相同爱好的朋友参与进来,一起搞机!!! 81 | 期待来信 *email:ulis2020@163.com* 82 | 83 | ## 📝 其他项目 84 | 85 | 🔐综合漏洞扫描:[项目地址](https://github.com/Hiiam9/lampShadow) 86 | -------------------------------------------------------------------------------- /client/README.md: -------------------------------------------------------------------------------- 1 | 此目录存放CengLou的客户端程序源码 2 | 依赖环境 :因为使用的是qt库,理论上只要安装好opencv 和 python 即可跨平台 3 | qt4 ~ qmake 4 | g++ 5 | OpenCV 3.4.1(其余版本可能会通用,若使用新版本可能会有些API被移除) 6 | 7 | test客户端主要功能为接收 上位机传输的图像和调试电机及串口数据的功能 8 | 9 | ## 雄迈摄像头[OPTION] 10 | 由于客户端可以调试雄迈模组的变焦镜头,所以将介绍放在这里 11 | 这个变焦镜头的方案参照一次偶然视频刷到的拆个网络监控摄像头的模组+变焦镜头实现拉流获取视频的功能,所以想着之后为机器人加个图传 12 | 正好还有变焦功能,所以就做了这个,由于这个变焦镜头并不是必不可少的,所以加了个option的标号 13 | 14 | 变焦镜头介绍: 15 | 默认地址码:1 波特率:9600 协议:Pelco-d 16 | RS485通用指令 电压3.3V 17 |

18 | -------------------------------------------------------------------------------- /client/win64/src/CengLou.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | QT += multimedia 6 | QT += multimediawidgets 7 | #QT += axcontainer 8 | QT += serialport 9 | QT += core gui network 10 | 11 | 12 | CONFIG += c++11 13 | CONFIG += console 14 | 15 | # The following define makes your compiler emit warnings if you use 16 | # any Qt feature that has been marked deprecated (the exact warnings 17 | # depend on your compiler). Please consult the documentation of the 18 | # deprecated API in order to know how to port your code away from it. 19 | DEFINES += QT_DEPRECATED_WARNINGS 20 | 21 | # You can also make your code fail to compile if it uses deprecated APIs. 22 | # In order to do so, uncomment the following line. 23 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 24 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 25 | 26 | 27 | INCLUDEPATH+=/usr/local/include/opencv \ 28 | /usr/local/include/opencv2 29 | 30 | LIBS+= /usr/local/lib/libopencv_calib3d.so \ 31 | /usr/local/lib/libopencv_video.so \ 32 | /usr/local/lib/libopencv_core.so \ 33 | /usr/local/lib/libopencv_highgui.so \ 34 | /usr/local/lib/libopencv_imgproc.so \ 35 | /usr/local/lib/libopencv_imgcodecs.so \ 36 | /usr/local/lib/libopencv_shape.so \ 37 | /usr/local/lib/libopencv_videoio.so 38 | 39 | 40 | 41 | 42 | SOURCES += \ 43 | about.cpp \ 44 | main.cpp \ 45 | mainwindow.cpp \ 46 | yawinf.cpp 47 | 48 | HEADERS += \ 49 | about.h \ 50 | mainwindow.h \ 51 | yawinf.h 52 | 53 | FORMS += \ 54 | about.ui \ 55 | mainwindow.ui \ 56 | yawinf.ui 57 | 58 | 59 | RC_ICONS = ic.ico 60 | 61 | # Default rules for deployment. 62 | qnx: target.path = /tmp/$${TARGET}/bin 63 | else: unix:!android: target.path = /opt/$${TARGET}/bin 64 | !isEmpty(target.path): INSTALLS += target 65 | -------------------------------------------------------------------------------- /client/win64/src/CengLou.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {c71ddc43-8d9d-450e-86af-69f6b50241c1} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | -fno-delayed-template-parsing 60 | 61 | true 62 | 63 | 64 | 65 | ProjectExplorer.Project.Target.0 66 | 67 | Desktop Qt 5.13.2 MinGW 64-bit 68 | Desktop Qt 5.13.2 MinGW 64-bit 69 | qt.qt5.5132.win64_mingw73_kit 70 | 0 71 | 0 72 | 0 73 | 74 | E:/ProgramByULis/coding/cl/client/build-CengLou-Desktop_Qt_5_13_2_MinGW_64_bit-Debug 75 | 76 | 77 | true 78 | qmake 79 | 80 | QtProjectManager.QMakeBuildStep 81 | true 82 | 83 | false 84 | false 85 | false 86 | 87 | 88 | true 89 | Make 90 | 91 | Qt4ProjectManager.MakeStep 92 | 93 | false 94 | 95 | 96 | false 97 | 98 | 2 99 | Build 100 | 101 | ProjectExplorer.BuildSteps.Build 102 | 103 | 104 | 105 | true 106 | Make 107 | 108 | Qt4ProjectManager.MakeStep 109 | 110 | true 111 | clean 112 | 113 | false 114 | 115 | 1 116 | Clean 117 | 118 | ProjectExplorer.BuildSteps.Clean 119 | 120 | 2 121 | false 122 | 123 | Debug 124 | Debug 125 | Qt4ProjectManager.Qt4BuildConfiguration 126 | 2 127 | true 128 | 129 | 130 | E:/ProgramByULis/coding/cl/client/build-CengLou-Desktop_Qt_5_13_2_MinGW_64_bit-Release 131 | 132 | 133 | true 134 | qmake 135 | 136 | QtProjectManager.QMakeBuildStep 137 | false 138 | 139 | false 140 | false 141 | true 142 | 143 | 144 | true 145 | Make 146 | 147 | Qt4ProjectManager.MakeStep 148 | 149 | false 150 | 151 | 152 | false 153 | 154 | 2 155 | Build 156 | 157 | ProjectExplorer.BuildSteps.Build 158 | 159 | 160 | 161 | true 162 | Make 163 | 164 | Qt4ProjectManager.MakeStep 165 | 166 | true 167 | clean 168 | 169 | false 170 | 171 | 1 172 | Clean 173 | 174 | ProjectExplorer.BuildSteps.Clean 175 | 176 | 2 177 | false 178 | 179 | Release 180 | Release 181 | Qt4ProjectManager.Qt4BuildConfiguration 182 | 0 183 | true 184 | 185 | 186 | E:/ProgramByULis/coding/cl/client/build-CengLou-Desktop_Qt_5_13_2_MinGW_64_bit-Profile 187 | 188 | 189 | true 190 | qmake 191 | 192 | QtProjectManager.QMakeBuildStep 193 | true 194 | 195 | false 196 | true 197 | true 198 | 199 | 200 | true 201 | Make 202 | 203 | Qt4ProjectManager.MakeStep 204 | 205 | false 206 | 207 | 208 | false 209 | 210 | 2 211 | Build 212 | 213 | ProjectExplorer.BuildSteps.Build 214 | 215 | 216 | 217 | true 218 | Make 219 | 220 | Qt4ProjectManager.MakeStep 221 | 222 | true 223 | clean 224 | 225 | false 226 | 227 | 1 228 | Clean 229 | 230 | ProjectExplorer.BuildSteps.Clean 231 | 232 | 2 233 | false 234 | 235 | Profile 236 | Profile 237 | Qt4ProjectManager.Qt4BuildConfiguration 238 | 0 239 | true 240 | 241 | 3 242 | 243 | 244 | 0 245 | 部署 246 | 247 | ProjectExplorer.BuildSteps.Deploy 248 | 249 | 1 250 | Deploy Configuration 251 | 252 | ProjectExplorer.DefaultDeployConfiguration 253 | 254 | 1 255 | 256 | 257 | dwarf 258 | 259 | cpu-cycles 260 | 261 | 262 | 250 263 | -F 264 | true 265 | 4096 266 | false 267 | false 268 | 1000 269 | 270 | true 271 | 272 | false 273 | false 274 | false 275 | false 276 | true 277 | 0.01 278 | 10 279 | true 280 | kcachegrind 281 | 1 282 | 25 283 | 284 | 1 285 | true 286 | false 287 | true 288 | valgrind 289 | 290 | 0 291 | 1 292 | 2 293 | 3 294 | 4 295 | 5 296 | 6 297 | 7 298 | 8 299 | 9 300 | 10 301 | 11 302 | 12 303 | 13 304 | 14 305 | 306 | 2 307 | 308 | CengLou 309 | 310 | Qt4ProjectManager.Qt4RunConfiguration:E:/ProgramByULis/coding/cl/client/src/CengLou.pro 311 | 312 | 3768 313 | false 314 | true 315 | true 316 | false 317 | false 318 | true 319 | 320 | E:/ProgramByULis/coding/cl/client/build-CengLou-Desktop_Qt_5_13_2_MinGW_64_bit-Debug 321 | 322 | 1 323 | 324 | 325 | 326 | ProjectExplorer.Project.TargetCount 327 | 1 328 | 329 | 330 | ProjectExplorer.Project.Updater.FileVersion 331 | 22 332 | 333 | 334 | Version 335 | 22 336 | 337 | 338 | -------------------------------------------------------------------------------- /client/win64/src/Table of Contents.hhc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /client/win64/src/about.cpp: -------------------------------------------------------------------------------- 1 | #include "about.h" 2 | #include "ui_about.h" 3 | 4 | about::about(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::about) 7 | { 8 | ui->setupUi(this); 9 | //禁止修改窗口大小 10 | setWindowFlags(windowFlags()&~Qt::WindowMaximizeButtonHint); // 禁止最大化按钮 11 | 12 | setFixedSize(this->width(),this->height()); // 禁止拖动窗口大小 13 | /* 14 | //显示顶部背景 15 | //1.路径包含 16 | QString bg_path("C:\\Users\\Mypc\\Desktop\\bg.jpg"); 17 | //2.创建图片对象 18 | QPixmap *bg_pix = new QPixmap(bg_path); 19 | //3.设置大小兼容 20 | QPixmap pix2 = bg_pix->scaled(ui->label_background->size()); 21 | //4.将图片放到控件 22 | ui->label_background->setPixmap(pix2); 23 | */ 24 | } 25 | 26 | about::~about() 27 | { 28 | delete ui; 29 | } 30 | 31 | void about::on_pushButton_clicked() 32 | { 33 | delete this; 34 | } 35 | 36 | void about::on_commandLinkButton_clicked() 37 | { 38 | QDesktopServices::openUrl(QUrl(QLatin1String("https://www.baidu.com"))); 39 | } 40 | -------------------------------------------------------------------------------- /client/win64/src/about.h: -------------------------------------------------------------------------------- 1 | #ifndef ABOUT_H 2 | #define ABOUT_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Ui { 9 | class about; 10 | } 11 | 12 | class about : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit about(QWidget *parent = nullptr); 18 | ~about(); 19 | 20 | private slots: 21 | void on_pushButton_clicked(); 22 | 23 | void on_commandLinkButton_clicked(); 24 | 25 | private: 26 | Ui::about *ui; 27 | }; 28 | 29 | #endif // ABOUT_H 30 | -------------------------------------------------------------------------------- /client/win64/src/about.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | about 4 | 5 | 6 | true 7 | 8 | 9 | 10 | 0 11 | 0 12 | 371 13 | 262 14 | 15 | 16 | 17 | 关于 18 | 19 | 20 | 21 | 22 | 0 23 | 10 24 | 371 25 | 251 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 60 36 | 80 37 | 291 38 | 16 39 | 40 | 41 | 42 | 本软件只为学习使用,未经授权,不得任何商业用途 43 | 44 | 45 | 46 | 47 | 48 | 120 49 | 40 50 | 141 51 | 16 52 | 53 | 54 | 55 | 欲穷千里目,更上一层楼 56 | 57 | 58 | 59 | 60 | 61 | 120 62 | 160 63 | 131 64 | 16 65 | 66 | 67 | 68 | 版权所有:ULis @2020 69 | 70 | 71 | 72 | 73 | 74 | 130 75 | 180 76 | 121 77 | 31 78 | 79 | 80 | 81 | 开源地址 82 | 83 | 84 | 85 | 86 | 87 | 110 88 | 120 89 | 151 90 | 16 91 | 92 | 93 | 94 | CengLou Computer Vision 95 | 96 | 97 | 98 | 99 | 100 | 140 101 | 140 102 | 81 103 | 16 104 | 105 | 106 | 107 | Version 0.1.1 108 | 109 | 110 | 111 | 112 | 113 | 140 114 | 230 115 | 80 116 | 20 117 | 118 | 119 | 120 | 确定 121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /client/win64/src/help.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/client/win64/src/help.chm -------------------------------------------------------------------------------- /client/win64/src/help.hhp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/client/win64/src/help.hhp -------------------------------------------------------------------------------- /client/win64/src/ic.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/client/win64/src/ic.ico -------------------------------------------------------------------------------- /client/win64/src/lulu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/client/win64/src/lulu.png -------------------------------------------------------------------------------- /client/win64/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | 8 | QApplication a(argc, argv); 9 | MainWindow w; 10 | w.show(); 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /client/win64/src/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | #include 4 | 5 | 6 | using namespace cv; 7 | MainWindow::MainWindow(QWidget *parent) 8 | : QMainWindow(parent) 9 | , ui(new Ui::MainWindow) 10 | { 11 | std::cout<<"software start"<setupUi(this); 13 | //禁止修改窗口大小 14 | setWindowFlags(windowFlags()&~Qt::WindowMaximizeButtonHint); // 禁止最大化按钮 15 | 16 | setFixedSize(this->width(),this->height()); // 禁止拖动窗口大小 17 | 18 | SerialPort = new QSerialPort; 19 | 20 | QString pic_path ="D:\\Documents\\src\\lulu.png"; 21 | QPixmap *pic_pix = new QPixmap(pic_path); 22 | //3.设置大小兼容 23 | QPixmap pix = pic_pix->scaled(ui->label_pic->size()); 24 | //4.将图片放到控件 25 | ui->label_pic->setPixmap(pix); 26 | 27 | /* //视频显示区默认图像 28 | //显示顶部背景 29 | //1.路径包含 30 | QString bg_path("C:\\Users\\Mypc\\Desktop\\bg.jpg"); 31 | //2.创建图片对象 32 | QPixmap *bg_pix = new QPixmap(bg_path); 33 | //3.设置大小兼容 34 | QPixmap pix2 = bg_pix->scaled(ui->label_player->size()); 35 | //4.将图片放到控件 36 | ui->label_player->setPixmap(pix2); 37 | */ 38 | 39 | mediaPlayer = new QMediaPlayer(); 40 | layout_video = new QVBoxLayout; 41 | videoWidget = new QVideoWidget(); 42 | layout_video->setMargin(1); 43 | 44 | 45 | connect(ui->spinBox, SIGNAL(valueChanged(int)), 46 | ui->horizontalSlider, SLOT(setValue(int))); 47 | connect(ui->horizontalSlider, SIGNAL(valueChanged(int)), 48 | ui->spinBox, SLOT(setValue(int))); 49 | 50 | connect(ui->actionopen, SIGNAL(triggered()), this, SLOT(on_btn_openFile_clicked()));//打开文件信号连接 51 | 52 | connect(SerialPort,SIGNAL(readyRead()),this,SLOT(serial_Read())); 53 | 54 | 55 | timer = new QTimer(this); 56 | connect(timer, SIGNAL(timeout()), this, SLOT(importFrame())); 57 | 58 | //实时接收模式 udp套接字 信号连接 59 | recver.bind(QHostAddress::Any,52475); 60 | connect(&recver,SIGNAL(readyRead()),this,SLOT(recvVideoShow())); 61 | 62 | 63 | Init(); 64 | 65 | } 66 | 67 | MainWindow::~MainWindow() 68 | { 69 | delete ui; 70 | delete SerialPort; 71 | delete mediaPlayer; 72 | delete layout_video; 73 | delete videoWidget; 74 | delete pro; 75 | } 76 | 77 | void MainWindow::Init(){ 78 | 79 | 80 | //读取串口信息 81 | foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) 82 | { 83 | // 自动读取串口号添加到端口portBox中 84 | QSerialPort serial; 85 | serial.setPort(info); 86 | if(serial.open(QIODevice::ReadWrite)) 87 | { 88 | ui->portBox->addItem(info.portName()); 89 | serial.close(); 90 | } 91 | } 92 | 93 | //所有开关关闭 94 | this->procTk1 = false; 95 | 96 | QStringList baudList; //波特率 97 | QStringList parityList; //校验位 98 | QStringList dataBitsList; //数据位 99 | QStringList stopBitsList; //停止位 100 | // 波特率 //波特率默认选择下拉第三项:9600 101 | 102 | baudList<<"1200"<<"2400"<< 103 | "4800"<<"9600"<< 104 | "14400"<<"19200"<< 105 | "38400"<<"56000"<< 106 | "57600"<<"115200"; 107 | ui->boteBox->addItems(baudList); 108 | ui->boteBox->setCurrentIndex(9); 109 | 110 | // 校验 //校验默认选择无 111 | parityList<<"No"<<"Odd"<<"Even"; 112 | ui->comboBox_check->addItems(parityList); 113 | ui->comboBox_check->setCurrentIndex(0); 114 | 115 | 116 | // 数据位 //数据位默认选择8位 117 | dataBitsList<<"5"<<"6"<<"7"<<"8"; 118 | ui->comboBox_data->addItems(dataBitsList); 119 | ui->comboBox_data->setCurrentIndex(3); 120 | 121 | 122 | // 停止位 //停止位默认选择1位 123 | stopBitsList<<"1"<<"2"; 124 | ui->comboBox_end->addItems(stopBitsList); 125 | ui->comboBox_end->setCurrentIndex(0); 126 | } 127 | 128 | //接收视频显示函数 129 | void MainWindow::recvVideoShow(){ 130 | if(this->recvModel){ 131 | quint64 size = recver.pendingDatagramSize(); 132 | QByteArray buf; 133 | buf.resize(size); 134 | QHostAddress addr; 135 | quint16 port; 136 | recver.readDatagram(buf.data(),buf.size(),&addr,&port); 137 | buf = qUncompress(buf); 138 | QBuffer buffer(&buf); 139 | QImageReader reader(&buffer,"JPEG"); 140 | QImage image = reader.read();//read()方法用来读取设备图像,也可读取视频,读取成功返回QImage*,否则返回NULL 141 | ui->label_player->setPixmap(QPixmap::fromImage(image)); 142 | ui->label_player->resize(image.width(),image.height()); 143 | } 144 | } 145 | 146 | 147 | void MainWindow::on_btn_openFile_clicked() 148 | { 149 | QString path = QFileDialog::getOpenFileName(this, tr("选择视频"), ".", tr("Image Files(*.flv *.mp4)"));//得到视频路径 150 | //根据label_player尺寸设置播放区域 151 | videoWidget->resize(ui->label_player->size()); 152 | layout_video->addWidget(videoWidget); 153 | ui->label_player->setLayout(layout_video); 154 | mediaPlayer->setVideoOutput(videoWidget); 155 | mediaPlayer->setMedia(QUrl::fromLocalFile(path)); 156 | mediaPlayer->play(); 157 | } 158 | 159 | 160 | void MainWindow::on_action_about_triggered() 161 | { 162 | ab = new about(); 163 | ab->setWindowFlags(ab->windowFlags()&~Qt::WindowMaximizeButtonHint&~Qt::WindowMinimizeButtonHint); 164 | 165 | ab->show(); 166 | } 167 | 168 | void MainWindow::on_openPort_btn_clicked()//打开串口点击事件 169 | { 170 | if(ui->portBox->currentText()==""){ 171 | 172 | QMessageBox::information(this,"warning","没有找到串口"); 173 | } 174 | 175 | // 打开串口 176 | if(ui->openPort_btn->text() == "打开串口") 177 | { 178 | // 设置串口号 179 | 180 | SerialPort->setPortName(ui->portBox->currentText()); 181 | // 打开串口 182 | if(SerialPort->open(QIODevice::ReadWrite)) 183 | { 184 | // 设置波特率 185 | SerialPort->setBaudRate(ui->boteBox->currentText().toInt()); 186 | //设置数据位数 187 | switch(ui->comboBox_data->currentIndex()) 188 | { 189 | case 5: SerialPort->setDataBits(QSerialPort::Data5); break; 190 | case 6: SerialPort->setDataBits(QSerialPort::Data6); break; 191 | case 7: SerialPort->setDataBits(QSerialPort::Data7); break; 192 | case 8: SerialPort->setDataBits(QSerialPort::Data8); break; 193 | default: break; 194 | } 195 | // 设置校验位 196 | //SerialPort->setParity(QSerialPort::NoParity); 197 | //设置奇偶校验 198 | switch(ui->comboBox_check->currentIndex()) 199 | { 200 | case 0: SerialPort->setParity(QSerialPort::NoParity); break; 201 | case 1: SerialPort->setParity(QSerialPort::OddParity); break; 202 | case 2: SerialPort->setParity(QSerialPort::EvenParity); break; 203 | default: break; 204 | } 205 | // 设置流控制 206 | SerialPort->setFlowControl(QSerialPort::NoFlowControl); 207 | //设置停止位 208 | switch(ui->comboBox_end->currentIndex()) 209 | { 210 | case 1: SerialPort->setStopBits(QSerialPort::OneStop); break; 211 | case 2: SerialPort->setStopBits(QSerialPort::TwoStop); break; 212 | default: break; 213 | } 214 | } 215 | //打开串口 216 | else 217 | { 218 | QMessageBox::about(nullptr, "提示", "串口无法打开\r\n不存在或已被占用"); 219 | return; 220 | } 221 | ui->openPort_btn->setText("关闭串口"); 222 | //下拉菜单控件使能 223 | ui->portBox->setEnabled(false); 224 | ui->boteBox->setEnabled(false); 225 | ui->comboBox_data->setEnabled(false); 226 | ui->comboBox_check->setEnabled(false); 227 | ui->comboBox_end->setEnabled(false); 228 | 229 | //搜索串口按键使能 230 | //ui->searchBtn->setEnabled(false); 231 | 232 | //发送按键使能 233 | ui->pushButton_sendData->setEnabled(true); 234 | } 235 | // 关闭串口 236 | else 237 | { 238 | SerialPort->close(); 239 | ui->openPort_btn->setText("打开串口"); 240 | //下拉按键使能 241 | ui->portBox->setEnabled(true); 242 | ui->boteBox->setEnabled(true); 243 | ui->comboBox_data->setEnabled(true); 244 | ui->comboBox_check->setEnabled(true); 245 | ui->comboBox_end->setEnabled(true); 246 | //搜索串口按键使能 247 | // ui->searchBtn->setEnabled(true); 248 | //发送按键使能 249 | ui->pushButton_sendData->setEnabled(false); 250 | } 251 | 252 | 253 | } 254 | 255 | void MainWindow::on_btn_Connect_Stm32_clicked()//连接stm32按钮点击事件 256 | { 257 | string ip = "192.168.1.4"; 258 | int port = 8888; 259 | 260 | if(ui->portBox->currentText()!=""){//判断端口是否打开,暂时先这么写 261 | 262 | int count = 0; 263 | while(count<=100){ 264 | 265 | ui->progressBar_stm32->setValue(count); 266 | count++; 267 | } 268 | } 269 | else 270 | QMessageBox::information(this,"warning","请先打开串口"); 271 | } 272 | 273 | void MainWindow::on_pushButton_left_clicked()//左旋按钮单击事件 274 | { 275 | if(ui->openPort_btn->text() == "打开串口"){ 276 | QMessageBox::information(this,"warning","无法连接电机,请先打开串口"); 277 | return; 278 | } 279 | SerialPort->clear(); 280 | if(this->yaw_right_angle <= -360) 281 | this->yaw_right_angle = 0; 282 | else 283 | { 284 | this->yaw_right_angle -= 30; 285 | QByteArray Data_1; 286 | QString Data = "3E A3 01 08 EA 00 00 00 00 00 00 00 00 00 "; 287 | switch (this->yaw_right_angle) {//更简洁的方法则需使用字符串拼接 288 | case -30 :{ 289 | Data = "3E A3 01 08 EA 48 F4 FF FF FF FF FF FF 36 "; 290 | qDebug()<yaw_right_angle; 292 | break; 293 | } 294 | case -60 :{ 295 | Data = "3E A3 01 08 EA 90 E8 FF FF FF FF FF FF 72 "; 296 | qDebug()<yaw_right_angle; 298 | break; 299 | } 300 | case -90 :{ 301 | Data = "3E A3 01 08 EA D8 DC FF FF FF FF FF FF AE "; 302 | qDebug()<yaw_right_angle; 304 | break; 305 | } 306 | case -120 :{ 307 | Data = "3E A3 01 08 EA 20 D1 FF FF FF FF FF FF EB "; 308 | qDebug()<yaw_right_angle; 310 | break; 311 | } 312 | case -150 :{ 313 | Data = "3E A3 01 08 EA 68 C5 FF FF FF FF FF FF 27 "; 314 | qDebug()<yaw_right_angle; 316 | break; 317 | } 318 | case -180 :{ 319 | Data = "3E A3 01 08 EA B0 B9 FF FF FF FF FF FF 63 "; 320 | qDebug()<yaw_right_angle; 322 | break; 323 | } 324 | case -210 :{ 325 | Data = "3E A3 01 08 EA F8 AD FF FF FF FF FF FF 9F "; 326 | qDebug()<yaw_right_angle; 328 | break; 329 | } 330 | case -240 :{ 331 | Data = "3E A3 01 08 EA 40 A2 FF FF FF FF FF FF DC "; 332 | qDebug()<yaw_right_angle; 334 | break; 335 | } 336 | case -270 :{ 337 | Data = "3E A3 01 08 EA 88 96 FF FF FF FF FF FF 18 "; 338 | qDebug()<yaw_right_angle; 340 | break; 341 | } 342 | case -300 :{ 343 | Data = "3E A3 01 08 EA D0 8A FF FF FF FF FF FF 54 "; 344 | qDebug()<yaw_right_angle; 346 | break; 347 | } 348 | case -330 :{ 349 | Data = "3E A3 01 08 EA 18 7F FF FF FF FF FF FF 91 "; 350 | qDebug()<yaw_right_angle; 352 | break; 353 | } 354 | case -360 :{ 355 | Data = "3E A3 01 08 EA 60 73 FF FF FF FF FF FF CD "; 356 | qDebug()<yaw_right_angle; 358 | break; 359 | } 360 | default:{ 361 | Data = "3E A3 01 08 EA 00 00 00 00 00 00 00 00 00 "; 362 | qDebug()<yaw_right_angle; 364 | break; 365 | } 366 | } 367 | if(yawAuto) 368 | ui->spinBox->setValue(yaw_right_angle); 369 | Data_1 = QByteArray::fromHex (Data.toLatin1().data());//按十六进制编码发送 370 | SerialPort->write(Data_1); 371 | } 372 | } 373 | 374 | 375 | void MainWindow::serial_Read() 376 | { 377 | 378 | QString buffer_1; 379 | //从缓冲区中读取数据 380 | QByteArray buffer = SerialPort->readAll(); 381 | if((!buffer.isEmpty()))//如果非空说明有数据接收 382 | { //转换成16进制大写 383 | QString str=buffer.toHex().data(); 384 | str=str.toUpper(); 385 | //一个16进制占4位,8位为一字节,所以每两位16进制空一格 386 | for(int i=0;iplainTextEdit_recv->toPlainText(); 394 | //清空显示 395 | ui->plainTextEdit_recv->clear(); 396 | //重新显示 397 | if(hexable==0){ 398 | receive += QString(buffer); 399 | ui->plainTextEdit_recv->appendPlainText(receive); 400 | }//直接显示 401 | else { 402 | receive += QString(buffer_1); 403 | ui->plainTextEdit_recv->appendPlainText(receive); 404 | }//16进制显示 405 | } 406 | buffer.clear(); 407 | 408 | } 409 | 410 | 411 | void MainWindow::on_pushButton_sendData_clicked() 412 | { 413 | QByteArray Data_1; 414 | //获取输入窗口sendData的数据 415 | QString Data = ui->plainTextEdit_send->toPlainText(); 416 | if(endable) {Data+='\r';Data+='\n';}//插入换行 417 | //Data_1 = Data.toUtf8();//转换成utf8格式的字节流发送 418 | Data_1 = QByteArray::fromHex (Data.toLatin1().data());//按十六进制编码发送 419 | // 写入发送缓存区 420 | SerialPort->write(Data_1); 421 | 422 | 423 | } 424 | 425 | void MainWindow::on_pushButton_clear_clicked() 426 | { 427 | ui->plainTextEdit_recv->setPlainText(""); 428 | } 429 | 430 | 431 | 432 | void MainWindow::on_horizontalSlider_valueChanged(int value)//云台角度滑动条 433 | { 434 | if(ui->openPort_btn->text() == "打开串口"){ 435 | QMessageBox::information(this,"warning","请先打开串口"); 436 | } 437 | else{ 438 | if(!(ui->checkBox_auto->checkState())){ 439 | QByteArray Data_2; 440 | //获取输入窗口sendData的数据 441 | uint32_t locValue = ui->horizontalSlider->value()*100; 442 | int crc = (locValue&(0x00ff)) + (locValue >> 8); 443 | QString key; 444 | QString crcKey; 445 | key = QString("%1").arg(locValue,2,16,QLatin1Char('0'));//k为int型或char型都可 446 | crcKey = QString("%1").arg(crc,2,16,QLatin1Char('0')); 447 | qDebug()<write(Data_2); 453 | } 454 | } 455 | } 456 | 457 | void MainWindow::on_checkBox_auto_stateChanged(int arg1)//滑动条勾选自动事件 458 | { 459 | this->yawAuto = !this->yawAuto; 460 | if(ui->checkBox_auto->checkState()){ 461 | ui->horizontalSlider->setEnabled(false); 462 | } 463 | else 464 | ui->horizontalSlider->setEnabled(true); 465 | } 466 | 467 | void MainWindow::on_radioButton_hex_clicked(bool checked) 468 | { 469 | if(checked == true) 470 | hexable = true; 471 | } 472 | 473 | void MainWindow::on_actionhelp_triggered()//点击帮助 474 | { 475 | QProcess *helpProcess = new QProcess(this); 476 | QStringList argument("E:\\cl\\CengLou\\help.chm"); 477 | helpProcess->start("hh.exe", argument);//运行另一个程序片段的代码 478 | } 479 | 480 | void MainWindow::on_radioButton_5_clicked()//视频处理机 Tk1被选择 481 | { 482 | this->procTk1 = true; 483 | } 484 | 485 | 486 | void MainWindow::on_pushButton_360_yaw_clicked() 487 | { 488 | QByteArray Data_1; 489 | //获取输入窗口sendData的数据 490 | QString Data = "3E A2 01 04 E5 A0 8C 00 00 2C"; 491 | Data_1 = QByteArray::fromHex (Data.toLatin1().data());//按十六进制编码发送 492 | SerialPort->write(Data_1); 493 | } 494 | 495 | void MainWindow::on_pushButton_stop_yaw_clicked() 496 | { 497 | QByteArray Data_1; 498 | //获取输入窗口sendData的数据 499 | QString Data = "3E 80 01 04 C3"; 500 | Data_1 = QByteArray::fromHex (Data.toLatin1().data());//按十六进制编码发送 501 | SerialPort->write(Data_1); 502 | } 503 | 504 | void MainWindow::on_pushButton_right_clicked()//yaw右旋点击事件 505 | { 506 | if(ui->openPort_btn->text() == "打开串口"){ 507 | QMessageBox::information(this,"warning","无法连接电机,请先打开串口"); 508 | return; 509 | } 510 | SerialPort->clear(); 511 | if(this->yaw_right_angle >= 360) 512 | this->yaw_right_angle = 0; 513 | else 514 | { 515 | this->yaw_right_angle += 30; 516 | QByteArray Data_1; 517 | QString Data = "3E A3 01 08 EA 00 00 00 00 00 00 00 00 00 "; 518 | switch (this->yaw_right_angle) {//更简洁的方法则需使用字符串拼接 519 | case 30 :{ 520 | Data = "3E A3 01 08 EA B8 0B 00 00 00 00 00 00 C3 "; 521 | qDebug()<yaw_right_angle; 523 | break; 524 | } 525 | case 60 :{ 526 | Data = "3E A3 01 08 EA 70 17 00 00 00 00 00 00 87 "; 527 | qDebug()<yaw_right_angle; 529 | break; 530 | } 531 | case 90 :{ 532 | Data = "3E A3 01 08 EA 28 23 00 00 00 00 00 00 4B "; 533 | qDebug()<yaw_right_angle; 535 | break; 536 | } 537 | case 120 :{ 538 | Data = "3E A3 01 08 EA E0 2E 00 00 00 00 00 00 0E "; 539 | qDebug()<yaw_right_angle; 541 | break; 542 | } 543 | case 150 :{ 544 | Data = "3E A3 01 08 EA 98 3A 00 00 00 00 00 00 D2 "; 545 | qDebug()<yaw_right_angle; 547 | break; 548 | } 549 | case 180 :{ 550 | Data = "3E A3 01 08 EA 50 46 00 00 00 00 00 00 96 "; 551 | qDebug()<yaw_right_angle; 553 | break; 554 | } 555 | case 210 :{ 556 | Data = "3E A3 01 08 EA 08 52 00 00 00 00 00 00 5A "; 557 | qDebug()<yaw_right_angle; 559 | break; 560 | } 561 | case 240 :{ 562 | Data = "3E A3 01 08 EA C0 5D 00 00 00 00 00 00 1D "; 563 | qDebug()<yaw_right_angle; 565 | break; 566 | } 567 | case 270 :{ 568 | Data = "3E A3 01 08 EA 78 69 00 00 00 00 00 00 E1 "; 569 | qDebug()<yaw_right_angle; 571 | break; 572 | } 573 | case 300 :{ 574 | Data = "3E A3 01 08 EA 30 75 00 00 00 00 00 00 A5 "; 575 | qDebug()<yaw_right_angle; 577 | break; 578 | } 579 | case 330 :{ 580 | Data = "3E A3 01 08 EA E8 80 00 00 00 00 00 00 68 "; 581 | qDebug()<yaw_right_angle; 583 | break; 584 | } 585 | case 360 :{ 586 | Data = "3E A3 01 08 EA A0 8C 00 00 00 00 00 00 2C "; 587 | qDebug()<yaw_right_angle; 589 | break; 590 | } 591 | default:{ 592 | Data = "3E A3 01 08 EA 00 00 00 00 00 00 00 00 00 "; 593 | qDebug()<yaw_right_angle; 595 | break; 596 | } 597 | } 598 | if(yawAuto) 599 | ui->spinBox->setValue(yaw_right_angle); 600 | Data_1 = QByteArray::fromHex (Data.toLatin1().data());//按十六进制编码发送 601 | SerialPort->write(Data_1); 602 | } 603 | 604 | } 605 | 606 | void MainWindow::on_actionyaw_triggered() 607 | { 608 | //菜单->配置->电机信息->yaw 点击事件 609 | this->yawinfWindow = new yawinf(); 610 | yawinfWindow->show(); 611 | } 612 | 613 | void MainWindow::on_pushButton_2_clicked() // 实时接收模式按钮点击事件 614 | { 615 | this->recvModel = true; 616 | cap = VideoCapture("rtsp://192.168.1.9:554/user=admin&password=&channel=1&stream=1.sdp?real_stream"); 617 | if(!cap.isOpened()) 618 | { 619 | qDebug()<<"open camera faild"; 620 | return; 621 | } 622 | importFrame(); 623 | } 624 | 625 | 626 | void MainWindow::importFrame() 627 | { 628 | 629 | ui->label_center_info->setText(""); 630 | cap >> frame; 631 | imshow("test",frame); 632 | Mat dst; 633 | Mat dst1; 634 | cvtColor(frame, dst, CV_BGR2RGB);//only RGB of Qt 635 | cv::resize(dst,dst1,Size(ui->label_player->width(),ui->label_player->height())); 636 | QImage srcQImage = QImage((uchar*)(dst1.data), dst1.cols, dst1.rows, QImage::Format_RGB888); 637 | ui->label_player->setPixmap(QPixmap::fromImage(srcQImage)); 638 | timer->start(33); 639 | } 640 | 641 | void MainWindow::on_btn_Connect_Pi_clicked()//连接树莓派按钮点击 642 | { 643 | 644 | 645 | int count = 0; 646 | while(count<=100){ 647 | 648 | ui->progressBar_Pi->setValue(count); 649 | count++; 650 | } 651 | pro = new QProcess; 652 | 653 | pro->start("\"C:\\Program Files (x86)\\NetSarang\\Xshell 6\\Xshell.exe\""); 654 | 655 | 656 | 657 | } 658 | 659 | void MainWindow::on_pushButton_force_add_clicked()//变焦+ 660 | { 661 | 662 | QByteArray Data_1; 663 | QString Data = "FF 01 00 40 00 00 41 FF 01 00 00 00 00 01"; 664 | Data_1 = QByteArray::fromHex (Data.toLatin1().data()); 665 | SerialPort->write(Data_1); 666 | } 667 | 668 | 669 | 670 | void MainWindow::on_pushButton_force_red_clicked()//变焦- 671 | { 672 | QByteArray Data_1; 673 | QString Data = "FF 01 00 20 00 00 21 FF 01 00 00 00 00 01"; 674 | Data_1 = QByteArray::fromHex (Data.toLatin1().data()); 675 | SerialPort->write(Data_1); 676 | } 677 | 678 | void MainWindow::on_pushButton_write_img_clicked() //采集按钮点击事件 679 | { 680 | cap >> frame; 681 | cv::imwrite("E:\\cl\\test.jpg", frame); 682 | QMessageBox::information(this,"消息","保存成功"); 683 | } 684 | -------------------------------------------------------------------------------- /client/win64/src/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "about.h" 11 | #include 12 | #include 13 | #include 14 | #include "switchcontrol.h" 15 | #include 16 | #include 17 | #include "yawinf.h" 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | 26 | using namespace cv; 27 | using namespace std; 28 | 29 | QT_BEGIN_NAMESPACE 30 | namespace Ui { class MainWindow; } 31 | QT_END_NAMESPACE 32 | 33 | class MainWindow : public QMainWindow 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | MainWindow(QWidget *parent = nullptr); 39 | ~MainWindow(); 40 | 41 | 42 | private slots: 43 | 44 | void on_btn_openFile_clicked(); 45 | 46 | void on_action_about_triggered(); 47 | 48 | void on_openPort_btn_clicked(); 49 | 50 | void on_btn_Connect_Stm32_clicked(); 51 | 52 | void on_pushButton_left_clicked(); 53 | 54 | void serial_Read();//串口数据读取显示 55 | 56 | void on_pushButton_sendData_clicked(); 57 | 58 | void on_pushButton_clear_clicked(); 59 | 60 | void on_horizontalSlider_valueChanged(int value); 61 | 62 | void on_checkBox_auto_stateChanged(int arg1); 63 | 64 | void on_radioButton_hex_clicked(bool checked); 65 | 66 | void on_actionhelp_triggered(); 67 | 68 | void on_radioButton_5_clicked(); 69 | 70 | void on_pushButton_360_yaw_clicked(); 71 | 72 | void on_pushButton_stop_yaw_clicked(); 73 | 74 | void on_pushButton_right_clicked(); 75 | 76 | void on_actionyaw_triggered(); 77 | 78 | void on_pushButton_2_clicked(); 79 | 80 | void recvVideoShow(); // 接收视频显示函数 81 | void importFrame(); // 显示网络摄像头视频 82 | 83 | void on_btn_Connect_Pi_clicked(); 84 | 85 | void on_pushButton_force_add_clicked(); 86 | 87 | void on_pushButton_force_red_clicked(); 88 | 89 | void on_pushButton_write_img_clicked(); 90 | 91 | public: 92 | void Init(); 93 | 94 | public: 95 | QMediaPlayer *mediaPlayer; 96 | QVBoxLayout *layout_video; 97 | QVideoWidget *videoWidget; 98 | QSerialPort *SerialPort; 99 | bool hexable; //16进制 100 | bool utf8able; //utf8 101 | bool endable;//换行 102 | bool procTk1; //视屏处理机tk1 选择开关 103 | bool yawAuto = false; //勾选自动时候为真 104 | int yaw_right_angle = 0;// 记录yaw右旋按钮点击事件中角度值的变化 105 | bool recvModel; // 实时接收模式 1 时有效 106 | cv::VideoCapture cap; // OpenCV摄像机类 107 | Mat frame; 108 | QTimer *timer; 109 | 110 | private: 111 | Ui::MainWindow *ui; 112 | about *ab; 113 | yawinf *yawinfWindow; 114 | QUdpSocket recver; // 用于接收视频的udp套接字 115 | QProcess *pro; 116 | 117 | 118 | }; 119 | #endif // MAINWINDOW_H 120 | -------------------------------------------------------------------------------- /client/win64/src/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1114 10 | 644 11 | 12 | 13 | 14 | 层楼(win连接端 version1.0) ——Powered by ULis 15 | 16 | 17 | 18 | 19 | 20 | 20 21 | 20 22 | 761 23 | 381 24 | 25 | 26 | 27 | background-color: rgb(0, 0, 0); 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 550 37 | 440 38 | 160 39 | 22 40 | 41 | 42 | 43 | 180 44 | 45 | 46 | Qt::Horizontal 47 | 48 | 49 | 50 | 51 | 52 | 730 53 | 440 54 | 42 55 | 22 56 | 57 | 58 | 59 | 180 60 | 61 | 62 | 63 | 64 | 65 | 20 66 | 390 67 | 761 68 | 20 69 | 70 | 71 | 72 | Qt::Horizontal 73 | 74 | 75 | 76 | 77 | 78 | 10 79 | 20 80 | 20 81 | 381 82 | 83 | 84 | 85 | Qt::Vertical 86 | 87 | 88 | 89 | 90 | 91 | 20 92 | 10 93 | 761 94 | 16 95 | 96 | 97 | 98 | Qt::Horizontal 99 | 100 | 101 | 102 | 103 | 104 | 770 105 | 20 106 | 20 107 | 381 108 | 109 | 110 | 111 | Qt::Vertical 112 | 113 | 114 | 115 | 116 | 117 | 550 118 | 410 119 | 123 120 | 31 121 | 122 | 123 | 124 | 125 | 126 | 127 | 云台角度 128 | 129 | 130 | 131 | 132 | 133 | 134 | 自动 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 390 144 | 410 145 | 101 146 | 21 147 | 148 | 149 | 150 | 云台pitch测试 151 | 152 | 153 | 154 | 155 | 156 | 990 157 | 490 158 | 111 159 | 101 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 900 170 | 380 171 | 88 172 | 56 173 | 174 | 175 | 176 | 177 | 178 | 179 | 校验位 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 900 192 | 430 193 | 88 194 | 56 195 | 196 | 197 | 198 | 199 | 200 | 201 | 停止位 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 1000 214 | 400 215 | 81 216 | 21 217 | 218 | 219 | 220 | 打开串口 221 | 222 | 223 | 224 | 225 | 226 | 800 227 | 380 228 | 88 229 | 56 230 | 231 | 232 | 233 | 234 | 235 | 236 | 端口号 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 800 249 | 430 250 | 88 251 | 56 252 | 253 | 254 | 255 | 256 | 257 | 258 | 波特率 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 800 271 | 500 272 | 88 273 | 56 274 | 275 | 276 | 277 | 278 | 279 | 280 | 数据位 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 790 293 | 50 294 | 311 295 | 151 296 | 297 | 298 | 299 | true 300 | 301 | 302 | 303 | 304 | 305 | 790 306 | 240 307 | 311 308 | 91 309 | 310 | 311 | 312 | 313 | 314 | 315 | 790 316 | 212 317 | 54 318 | 20 319 | 320 | 321 | 322 | 发送 323 | 324 | 325 | 326 | 327 | 328 | 1000 329 | 450 330 | 80 331 | 21 332 | 333 | 334 | 335 | 发送数据 336 | 337 | 338 | 339 | 340 | 341 | 900 342 | 500 343 | 80 344 | 20 345 | 346 | 347 | 348 | 清除显示 349 | 350 | 351 | 352 | 353 | 354 | 900 355 | 20 356 | 81 357 | 21 358 | 359 | 360 | 361 | normal 362 | 363 | 364 | 365 | 366 | 367 | 800 368 | 14 369 | 88 370 | 31 371 | 372 | 373 | 374 | 375 | 376 | 377 | 接收 378 | 379 | 380 | 381 | 382 | 383 | 384 | hex 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 310 394 | 430 395 | 41 396 | 20 397 | 398 | 399 | 400 | 右旋 401 | 402 | 403 | 404 | 405 | 406 | 260 407 | 430 408 | 41 409 | 20 410 | 411 | 412 | 413 | 左旋 414 | 415 | 416 | 417 | 418 | 419 | 270 420 | 410 421 | 91 422 | 20 423 | 424 | 425 | 426 | 云台yaw测试 427 | 428 | 429 | 430 | 431 | 432 | 260 433 | 460 434 | 41 435 | 20 436 | 437 | 438 | 439 | 360 440 | 441 | 442 | 443 | 444 | 445 | 310 446 | 460 447 | 41 448 | 20 449 | 450 | 451 | 452 | stop 453 | 454 | 455 | 456 | 457 | 458 | 380 459 | 430 460 | 41 461 | 20 462 | 463 | 464 | 465 | 上旋 466 | 467 | 468 | 469 | 470 | 471 | 480 472 | 430 473 | 31 474 | 51 475 | 476 | 477 | 478 | 采集 479 | 480 | 481 | 482 | 483 | 484 | 430 485 | 430 486 | 41 487 | 20 488 | 489 | 490 | 491 | 下旋 492 | 493 | 494 | 495 | 496 | 497 | 380 498 | 460 499 | 41 500 | 20 501 | 502 | 503 | 504 | 变焦+ 505 | 506 | 507 | 508 | 509 | 510 | 110 511 | 411 512 | 51 513 | 20 514 | 515 | 516 | 517 | Tk1 518 | 519 | 520 | 521 | 522 | 523 | 160 524 | 411 525 | 61 526 | 20 527 | 528 | 529 | 530 | stm32 531 | 532 | 533 | 534 | 535 | 536 | 20 537 | 410 538 | 91 539 | 20 540 | 541 | 542 | 543 | 当前视频处理机 544 | 545 | 546 | 547 | 548 | 549 | 20 550 | 440 551 | 91 552 | 20 553 | 554 | 555 | 556 | 实时接收模式 557 | 558 | 559 | 560 | 561 | 562 | 130 563 | 440 564 | 91 565 | 20 566 | 567 | 568 | 569 | 历史分析模式 570 | 571 | 572 | 573 | 574 | 575 | 70 576 | 570 577 | 131 578 | 20 579 | 580 | 581 | 582 | 0 583 | 584 | 585 | 586 | 587 | 588 | 70 589 | 530 590 | 131 591 | 20 592 | 593 | 594 | 595 | 0 596 | 597 | 598 | 599 | 600 | 601 | 20 602 | 530 603 | 41 604 | 21 605 | 606 | 607 | 608 | stm32 609 | 610 | 611 | 612 | 613 | 614 | 210 615 | 530 616 | 51 617 | 20 618 | 619 | 620 | 621 | 连接 622 | 623 | 624 | 625 | 626 | 627 | 20 628 | 570 629 | 16 630 | 21 631 | 632 | 633 | 634 | Pi 635 | 636 | 637 | 638 | 639 | 640 | 210 641 | 570 642 | 51 643 | 20 644 | 645 | 646 | 647 | 连接 648 | 649 | 650 | 651 | 652 | 653 | 20 654 | 500 655 | 761 656 | 20 657 | 658 | 659 | 660 | Qt::Horizontal 661 | 662 | 663 | 664 | 665 | 666 | 20 667 | 470 668 | 61 669 | 20 670 | 671 | 672 | 673 | 识别目标 674 | 675 | 676 | 677 | 678 | 679 | 90 680 | 471 681 | 51 682 | 20 683 | 684 | 685 | 686 | 人脸 687 | 688 | 689 | 690 | 691 | 692 | 160 693 | 470 694 | 51 695 | 21 696 | 697 | 698 | 699 | 气球 700 | 701 | 702 | 703 | 704 | 705 | 430 706 | 460 707 | 41 708 | 20 709 | 710 | 711 | 712 | 变焦- 713 | 714 | 715 | 716 | 717 | 718 | 620 719 | 40 720 | 151 721 | 20 722 | 723 | 724 | 725 | 机器人第一人称视角 726 | 727 | 728 | 729 | 730 | 731 | 380 732 | 200 733 | 71 734 | 16 735 | 736 | 737 | 738 | color: rgb(255, 255, 255); 739 | 740 | 741 | 无信号 742 | 743 | 744 | 745 | 746 | 747 | 290 748 | 530 749 | 61 750 | 16 751 | 752 | 753 | 754 | 摄像头 IP 755 | 756 | 757 | 758 | 759 | 760 | 320 761 | 570 762 | 31 763 | 20 764 | 765 | 766 | 767 | 端口 768 | 769 | 770 | 771 | 772 | 773 | 360 774 | 530 775 | 101 776 | 20 777 | 778 | 779 | 780 | 781 | 782 | 783 | 360 784 | 570 785 | 41 786 | 20 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 0 796 | 0 797 | 1114 798 | 28 799 | 800 | 801 | 802 | 803 | 编辑 804 | 805 | 806 | 807 | 808 | 809 | 810 | 帮助 811 | 812 | 813 | 814 | 815 | 816 | 817 | 配置 818 | 819 | 820 | 821 | 电机配置 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | open a video 835 | 836 | 837 | 838 | 839 | about 840 | 841 | 842 | 843 | 844 | about 845 | 846 | 847 | 848 | 849 | 打开 850 | 851 | 852 | 853 | 854 | 关于 855 | 856 | 857 | 858 | 859 | 保存 860 | 861 | 862 | 863 | 864 | 帮助 865 | 866 | 867 | 868 | 869 | yaw 870 | 871 | 872 | 873 | 874 | pitch 875 | 876 | 877 | 878 | 879 | 880 | 881 | -------------------------------------------------------------------------------- /client/win64/src/spider.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/client/win64/src/spider.py -------------------------------------------------------------------------------- /client/win64/src/switchcontrol.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "SwitchControl.h" 4 | 5 | SwitchControl::SwitchControl(QWidget *parent) 6 | : QWidget(parent), 7 | m_nHeight(16), 8 | m_bChecked(false), 9 | m_radius(8.0), 10 | m_nMargin(3), 11 | m_checkedColor(0, 150, 136), 12 | m_thumbColor(Qt::white), 13 | m_disabledColor(190, 190, 190), 14 | m_background(Qt::black) 15 | { 16 | // 鼠标滑过光标形状 - 手型 17 | setCursor(Qt::PointingHandCursor); 18 | 19 | // 连接信号槽 20 | connect(&m_timer, SIGNAL(timeout()), this, SLOT(onTimeout())); 21 | } 22 | 23 | // 绘制开关 24 | void SwitchControl::paintEvent(QPaintEvent *event) 25 | { 26 | Q_UNUSED(event); 27 | 28 | QPainter painter(this); 29 | painter.setPen(Qt::NoPen); 30 | painter.setRenderHint(QPainter::Antialiasing); 31 | 32 | QPainterPath path; 33 | QColor background; 34 | QColor thumbColor; 35 | qreal dOpacity; 36 | if (isEnabled()) { // 可用状态 37 | if (m_bChecked) { // 打开状态 38 | background = m_checkedColor; 39 | thumbColor = m_checkedColor; 40 | dOpacity = 0.600; 41 | } else { //关闭状态 42 | background = m_background; 43 | thumbColor = m_thumbColor; 44 | dOpacity = 0.800; 45 | } 46 | } else { // 不可用状态 47 | background = m_background; 48 | dOpacity = 0.260; 49 | thumbColor = m_disabledColor; 50 | } 51 | // 绘制大椭圆 52 | painter.setBrush(background); 53 | painter.setOpacity(dOpacity); 54 | path.addRoundedRect(QRectF(m_nMargin, m_nMargin, width() - 2 * m_nMargin, height() - 2 * m_nMargin), m_radius, m_radius); 55 | painter.drawPath(path.simplified()); 56 | 57 | // 绘制小椭圆 58 | painter.setBrush(thumbColor); 59 | painter.setOpacity(1.0); 60 | painter.drawEllipse(QRectF(m_nX - (m_nHeight / 2), m_nY - (m_nHeight / 2), height(), height())); 61 | } 62 | 63 | // 鼠标按下事件 64 | void SwitchControl::mousePressEvent(QMouseEvent *event) 65 | { 66 | if (isEnabled()) { 67 | if (event->buttons() & Qt::LeftButton) { 68 | event->accept(); 69 | } else { 70 | event->ignore(); 71 | } 72 | } 73 | } 74 | 75 | // 鼠标释放事件 - 切换开关状态、发射toggled()信号 76 | void SwitchControl::mouseReleaseEvent(QMouseEvent *event) 77 | { 78 | if (isEnabled()) { 79 | if ((event->type() == QMouseEvent::MouseButtonRelease) && (event->button() == Qt::LeftButton)) { 80 | event->accept(); 81 | m_bChecked = !m_bChecked; 82 | emit toggled(m_bChecked); 83 | m_timer.start(10); 84 | } else { 85 | event->ignore(); 86 | } 87 | } 88 | } 89 | 90 | // 大小改变事件 91 | void SwitchControl::resizeEvent(QResizeEvent *event) 92 | { 93 | m_nX = m_nHeight / 2; 94 | m_nY = m_nHeight / 2; 95 | QWidget::resizeEvent(event); 96 | } 97 | 98 | // 默认大小 99 | QSize SwitchControl::sizeHint() const 100 | { 101 | return minimumSizeHint(); 102 | } 103 | 104 | // 最小大小 105 | QSize SwitchControl::minimumSizeHint() const 106 | { 107 | return QSize(2 * (m_nHeight + m_nMargin), m_nHeight + 2 * m_nMargin); 108 | } 109 | 110 | // 切换状态 - 滑动 111 | void SwitchControl::onTimeout() 112 | { 113 | if (m_bChecked) { 114 | m_nX += 1; 115 | if (m_nX >= width() - m_nHeight) 116 | m_timer.stop(); 117 | } else { 118 | m_nX -= 1; 119 | if (m_nX <= m_nHeight / 2) 120 | m_timer.stop(); 121 | } 122 | update(); 123 | } 124 | 125 | // 返回开关状态 - 打开:true 关闭:false 126 | bool SwitchControl::isToggled() const 127 | { 128 | return m_bChecked; 129 | } 130 | 131 | // 设置开关状态 132 | void SwitchControl::setToggle(bool checked) 133 | { 134 | m_bChecked = checked; 135 | m_timer.start(10); 136 | } 137 | 138 | // 设置背景颜色 139 | void SwitchControl::setBackgroundColor(QColor color) 140 | { 141 | m_background = color; 142 | } 143 | 144 | // 设置选中颜色 145 | void SwitchControl::setCheckedColor(QColor color) 146 | { 147 | m_checkedColor = color; 148 | } 149 | 150 | // 设置不可用颜色 151 | void SwitchControl::setDisbaledColor(QColor color) 152 | { 153 | m_disabledColor = color; 154 | } 155 | -------------------------------------------------------------------------------- /client/win64/src/switchcontrol.h: -------------------------------------------------------------------------------- 1 | #ifndef SWITCH_CONTROL 2 | #define SWITCH_CONTROL 3 | 4 | #include 5 | #include 6 | 7 | class SwitchControl : public QWidget 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | explicit SwitchControl(QWidget *parent = 0); 13 | 14 | // 返回开关状态 - 打开:true 关闭:false 15 | bool isToggled() const; 16 | 17 | // 设置开关状态 18 | void setToggle(bool checked); 19 | 20 | // 设置背景颜色 21 | void setBackgroundColor(QColor color); 22 | 23 | // 设置选中颜色 24 | void setCheckedColor(QColor color); 25 | 26 | // 设置不可用颜色 27 | void setDisbaledColor(QColor color); 28 | 29 | protected: 30 | // 绘制开关 31 | void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; 32 | 33 | // 鼠标按下事件 34 | void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; 35 | 36 | // 鼠标释放事件 - 切换开关状态、发射toggled()信号 37 | void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; 38 | 39 | // 大小改变事件 40 | void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; 41 | 42 | // 缺省大小 43 | QSize sizeHint() const Q_DECL_OVERRIDE; 44 | QSize minimumSizeHint() const Q_DECL_OVERRIDE; 45 | 46 | signals: 47 | // 状态改变时,发射信号 48 | void toggled(bool checked); 49 | 50 | private slots: 51 | // 状态切换时,用于产生滑动效果 52 | void onTimeout(); 53 | 54 | private: 55 | bool m_bChecked; // 是否选中 56 | QColor m_background; // 背景颜色 57 | QColor m_checkedColor; // 选中颜色 58 | QColor m_disabledColor; // 不可用颜色 59 | QColor m_thumbColor; // 拇指颜色 60 | qreal m_radius; // 圆角 61 | qreal m_nX; // x点坐标 62 | qreal m_nY; // y点坐标 63 | qint16 m_nHeight; // 高度 64 | qint16 m_nMargin; // 外边距 65 | QTimer m_timer; // 定时器 66 | }; 67 | 68 | #endif // SWITCH_CONTROL 69 | -------------------------------------------------------------------------------- /client/win64/src/switchcontrol.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SwitchControl 6 | 7 | 8 | 9 | 0 10 | 0 11 | 400 12 | 300 13 | 14 | 15 | 16 | Form 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /client/win64/src/videoproc.cpp: -------------------------------------------------------------------------------- 1 | #include "videoproc.h" 2 | #include 3 | using namespace cv; 4 | 5 | videoproc::videoproc() 6 | { 7 | //####测试 8 | cv::Mat src = cv::imread("C:\\Users\\Mypc\\Desktop\\timg.jpg"); 9 | imshow("test",src); 10 | waitKey(0); 11 | //##### 12 | } 13 | -------------------------------------------------------------------------------- /client/win64/src/videoproc.h: -------------------------------------------------------------------------------- 1 | #ifndef VIDEOPROC_H 2 | #define VIDEOPROC_H 3 | 4 | 5 | class videoproc 6 | { 7 | public: 8 | videoproc(); 9 | }; 10 | 11 | #endif // VIDEOPROC_H 12 | -------------------------------------------------------------------------------- /client/win64/src/yawinf.cpp: -------------------------------------------------------------------------------- 1 | #include "yawinf.h" 2 | #include "ui_yawinf.h" 3 | 4 | yawinf::yawinf(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::yawinf) 7 | { 8 | ui->setupUi(this); 9 | //禁止修改窗口大小 10 | setWindowFlags(windowFlags()&~Qt::WindowMaximizeButtonHint); // 禁止最大化按钮 11 | 12 | setFixedSize(this->width(),this->height()); // 禁止拖动窗口大小 13 | } 14 | 15 | yawinf::~yawinf() 16 | { 17 | delete ui; 18 | } 19 | -------------------------------------------------------------------------------- /client/win64/src/yawinf.h: -------------------------------------------------------------------------------- 1 | #ifndef YAWINF_H 2 | #define YAWINF_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class yawinf; 8 | } 9 | 10 | class yawinf : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit yawinf(QWidget *parent = nullptr); 16 | ~yawinf(); 17 | 18 | private: 19 | Ui::yawinf *ui; 20 | }; 21 | 22 | #endif // YAWINF_H 23 | -------------------------------------------------------------------------------- /client/win64/src/yawinf.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | yawinf 4 | 5 | 6 | 7 | 0 8 | 0 9 | 594 10 | 417 11 | 12 | 13 | 14 | yaw轴电机信息 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /elecCtl/README.md: -------------------------------------------------------------------------------- 1 | 这个目录是电控的资料及相关代码 2 | -------------------------------------------------------------------------------- /elecCtl/src/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mechanics/README.md: -------------------------------------------------------------------------------- 1 | - 这个目录包含nightwish V1.0的机械图纸 2 | 其中 底盘是直接淘宝购买的有方机器人的小车地盘 3 | -------------------------------------------------------------------------------- /mechanics/pic/wholeCar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/mechanics/pic/wholeCar.jpeg -------------------------------------------------------------------------------- /mechanics/云台中控.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/mechanics/云台中控.SLDPRT -------------------------------------------------------------------------------- /mechanics/云台支架.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/mechanics/云台支架.SLDPRT -------------------------------------------------------------------------------- /mechanics/云台支架0816.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/mechanics/云台支架0816.SLDPRT -------------------------------------------------------------------------------- /mechanics/装配体2.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/mechanics/装配体2.SLDASM -------------------------------------------------------------------------------- /other/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /other/clientpic/client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/other/clientpic/client.png -------------------------------------------------------------------------------- /other/clientpic/clientpic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/other/clientpic/clientpic.png -------------------------------------------------------------------------------- /other/clientpic/xmCam.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/other/clientpic/xmCam.gif -------------------------------------------------------------------------------- /other/detect/faceDetect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/other/detect/faceDetect.png -------------------------------------------------------------------------------- /other/jetsonpic/re: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /other/jetsonpic/tk1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/other/jetsonpic/tk1.jpg -------------------------------------------------------------------------------- /other/jetsonpic/tx2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/other/jetsonpic/tx2.png -------------------------------------------------------------------------------- /vision/CengLou.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG += console c++11 3 | CONFIG -= app_bundle 4 | CONFIG -= qt 5 | 6 | SOURCES += main.cpp \ 7 | cgetimg.cpp \ 8 | cimgproc.cpp \ 9 | ccallocal.cpp \ 10 | cserial.cpp \ 11 | cfacerec.cpp \ 12 | csetting.cpp \ 13 | faceinfotomysql.cpp 14 | 15 | INCLUDEPATH += /usr/local/include \ 16 | /usr/local/include/opencv \ 17 | /usr/local/include/opencv2 18 | LIBS += /usr/local/lib/arm-linux-gnueabihf/libopencv_highgui.so \ 19 | /usr/local/lib/arm-linux-gnueabihf/libopencv_core.so \ 20 | /usr/local/lib/arm-linux-gnueabihf/libopencv_imgproc.so \ 21 | /usr/local/lib/arm-linux-gnueabihf/libopencv_imgcodecs.so\ 22 | /usr/lib/libfairsionCamera.so\ 23 | /usr/local/lib/arm-linux-gnueabihf/libopencv_videoio.so \ 24 | /usr/local/lib/arm-linux-gnueabihf/libopencv_objdetect.so 25 | 26 | HEADERS += \ 27 | cgetimg.h \ 28 | cimgproc.h \ 29 | ccallocal.h \ 30 | cserial.h \ 31 | cfacerec.h \ 32 | csetting.h \ 33 | faceinfotomysql.h 34 | -------------------------------------------------------------------------------- /vision/Makefile: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # Makefile for building: nightWish 3 | # Generated by qmake (3.0) (Qt 5.2.1) 4 | # Project: nightWish.pro 5 | # Template: app 6 | # Command: /usr/lib/arm-linux-gnueabihf/qt5/bin/qmake -o Makefile nightWish.pro 7 | ############################################################################# 8 | 9 | MAKEFILE = Makefile 10 | 11 | ####### Compiler, tools and options 12 | 13 | CC = gcc 14 | CXX = g++ 15 | DEFINES = 16 | CFLAGS = -pipe -O2 -Wall -W -fPIE $(DEFINES) 17 | CXXFLAGS = -pipe -O2 -std=c++0x -Wall -W -fPIE $(DEFINES) 18 | INCPATH = -I/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ -I. -I/usr/local/include -I/usr/local/include/opencv -I/usr/local/include/opencv2 19 | LINK = g++ 20 | LFLAGS = -Wl,-O1 21 | LIBS = $(SUBLIBS) /usr/local/lib/arm-linux-gnueabihf/libopencv_highgui.so /usr/local/lib/arm-linux-gnueabihf/libopencv_core.so /usr/local/lib/arm-linux-gnueabihf/libopencv_imgproc.so /usr/local/lib/arm-linux-gnueabihf/libopencv_imgcodecs.so /usr/lib/libfairsionCamera.so /usr/local/lib/arm-linux-gnueabihf/libopencv_videoio.so 22 | AR = ar cqs 23 | RANLIB = 24 | QMAKE = /usr/lib/arm-linux-gnueabihf/qt5/bin/qmake 25 | TAR = tar -cf 26 | COMPRESS = gzip -9f 27 | COPY = cp -f 28 | SED = sed 29 | COPY_FILE = cp -f 30 | COPY_DIR = cp -f -R 31 | STRIP = strip 32 | INSTALL_FILE = install -m 644 -p 33 | INSTALL_DIR = $(COPY_DIR) 34 | INSTALL_PROGRAM = install -m 755 -p 35 | DEL_FILE = rm -f 36 | SYMLINK = ln -f -s 37 | DEL_DIR = rmdir 38 | MOVE = mv -f 39 | CHK_DIR_EXISTS= test -d 40 | MKDIR = mkdir -p 41 | 42 | ####### Output directory 43 | 44 | OBJECTS_DIR = ./ 45 | 46 | ####### Files 47 | 48 | SOURCES = main.cpp \ 49 | cgetimg.cpp \ 50 | cimgproc.cpp \ 51 | ccallocal.cpp \ 52 | cserial.cpp \ 53 | cfacerec.cpp 54 | OBJECTS = main.o \ 55 | cgetimg.o \ 56 | cimgproc.o \ 57 | ccallocal.o \ 58 | cserial.o \ 59 | cfacerec.o 60 | DIST = /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/spec_pre.prf \ 61 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/shell-unix.conf \ 62 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/unix.conf \ 63 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/linux.conf \ 64 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/gcc-base.conf \ 65 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/gcc-base-unix.conf \ 66 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/g++-base.conf \ 67 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/g++-unix.conf \ 68 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/qconfig.pri \ 69 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ 70 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_concurrent.pri \ 71 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ 72 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_core.pri \ 73 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_core_private.pri \ 74 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_dbus.pri \ 75 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ 76 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_gui.pri \ 77 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_gui_private.pri \ 78 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_network.pri \ 79 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_network_private.pri \ 80 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_opengl.pri \ 81 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ 82 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ 83 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ 84 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ 85 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_printsupport.pri \ 86 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ 87 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_qml.pri \ 88 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_qmltest.pri \ 89 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_quick.pri \ 90 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_sql.pri \ 91 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_sql_private.pri \ 92 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_testlib.pri \ 93 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ 94 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_widgets.pri \ 95 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ 96 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_xml.pri \ 97 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_xml_private.pri \ 98 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/qt_functions.prf \ 99 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/qt_config.prf \ 100 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++/qmake.conf \ 101 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/spec_post.prf \ 102 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/exclusive_builds.prf \ 103 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/default_pre.prf \ 104 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/resolve_config.prf \ 105 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/default_post.prf \ 106 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/c++11.prf \ 107 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/unix/gdb_dwarf_index.prf \ 108 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/warn_on.prf \ 109 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/testcase_targets.prf \ 110 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/exceptions.prf \ 111 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/yacc.prf \ 112 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/lex.prf \ 113 | nightWish.pro \ 114 | nightWish.pro 115 | QMAKE_TARGET = nightWish 116 | DESTDIR = #avoid trailing-slash linebreak 117 | TARGET = nightWish 118 | 119 | 120 | first: all 121 | ####### Implicit rules 122 | 123 | .SUFFIXES: .o .c .cpp .cc .cxx .C 124 | 125 | .cpp.o: 126 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" 127 | 128 | .cc.o: 129 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" 130 | 131 | .cxx.o: 132 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" 133 | 134 | .C.o: 135 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" 136 | 137 | .c.o: 138 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" 139 | 140 | ####### Build rules 141 | 142 | all: Makefile $(TARGET) 143 | 144 | $(TARGET): $(OBJECTS) 145 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) 146 | 147 | Makefile: nightWish.pro /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++/qmake.conf /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/spec_pre.prf \ 148 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/shell-unix.conf \ 149 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/unix.conf \ 150 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/linux.conf \ 151 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/gcc-base.conf \ 152 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/gcc-base-unix.conf \ 153 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/g++-base.conf \ 154 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/g++-unix.conf \ 155 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/qconfig.pri \ 156 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ 157 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_concurrent.pri \ 158 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ 159 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_core.pri \ 160 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_core_private.pri \ 161 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_dbus.pri \ 162 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ 163 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_gui.pri \ 164 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_gui_private.pri \ 165 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_network.pri \ 166 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_network_private.pri \ 167 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_opengl.pri \ 168 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ 169 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ 170 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ 171 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ 172 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_printsupport.pri \ 173 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ 174 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_qml.pri \ 175 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_qmltest.pri \ 176 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_quick.pri \ 177 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_sql.pri \ 178 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_sql_private.pri \ 179 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_testlib.pri \ 180 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ 181 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_widgets.pri \ 182 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ 183 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_xml.pri \ 184 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_xml_private.pri \ 185 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/qt_functions.prf \ 186 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/qt_config.prf \ 187 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++/qmake.conf \ 188 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/spec_post.prf \ 189 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/exclusive_builds.prf \ 190 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/default_pre.prf \ 191 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/resolve_config.prf \ 192 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/default_post.prf \ 193 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/c++11.prf \ 194 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/unix/gdb_dwarf_index.prf \ 195 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/warn_on.prf \ 196 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/testcase_targets.prf \ 197 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/exceptions.prf \ 198 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/yacc.prf \ 199 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/lex.prf \ 200 | nightWish.pro 201 | $(QMAKE) -o Makefile nightWish.pro 202 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/spec_pre.prf: 203 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/shell-unix.conf: 204 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/unix.conf: 205 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/linux.conf: 206 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/gcc-base.conf: 207 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/gcc-base-unix.conf: 208 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/g++-base.conf: 209 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/common/g++-unix.conf: 210 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/qconfig.pri: 211 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri: 212 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_concurrent.pri: 213 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_concurrent_private.pri: 214 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_core.pri: 215 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_core_private.pri: 216 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_dbus.pri: 217 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_dbus_private.pri: 218 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_gui.pri: 219 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_gui_private.pri: 220 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_network.pri: 221 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_network_private.pri: 222 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_opengl.pri: 223 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_opengl_private.pri: 224 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_openglextensions.pri: 225 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri: 226 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri: 227 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_printsupport.pri: 228 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_printsupport_private.pri: 229 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_qml.pri: 230 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_qmltest.pri: 231 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_quick.pri: 232 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_sql.pri: 233 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_sql_private.pri: 234 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_testlib.pri: 235 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_testlib_private.pri: 236 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_widgets.pri: 237 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_widgets_private.pri: 238 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_xml.pri: 239 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/modules/qt_lib_xml_private.pri: 240 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/qt_functions.prf: 241 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/qt_config.prf: 242 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++/qmake.conf: 243 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/spec_post.prf: 244 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/exclusive_builds.prf: 245 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/default_pre.prf: 246 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/resolve_config.prf: 247 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/default_post.prf: 248 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/c++11.prf: 249 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/unix/gdb_dwarf_index.prf: 250 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/warn_on.prf: 251 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/testcase_targets.prf: 252 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/exceptions.prf: 253 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/yacc.prf: 254 | /usr/lib/arm-linux-gnueabihf/qt5/mkspecs/features/lex.prf: 255 | nightWish.pro: 256 | qmake: FORCE 257 | @$(QMAKE) -o Makefile nightWish.pro 258 | 259 | qmake_all: FORCE 260 | 261 | dist: 262 | @test -d .tmp/nightWish1.0.0 || mkdir -p .tmp/nightWish1.0.0 263 | $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/nightWish1.0.0/ && (cd `dirname .tmp/nightWish1.0.0` && $(TAR) nightWish1.0.0.tar nightWish1.0.0 && $(COMPRESS) nightWish1.0.0.tar) && $(MOVE) `dirname .tmp/nightWish1.0.0`/nightWish1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/nightWish1.0.0 264 | 265 | 266 | clean:compiler_clean 267 | -$(DEL_FILE) $(OBJECTS) 268 | -$(DEL_FILE) *~ core *.core 269 | 270 | 271 | ####### Sub-libraries 272 | 273 | distclean: clean 274 | -$(DEL_FILE) $(TARGET) 275 | -$(DEL_FILE) Makefile 276 | 277 | 278 | check: first 279 | 280 | compiler_yacc_decl_make_all: 281 | compiler_yacc_decl_clean: 282 | compiler_yacc_impl_make_all: 283 | compiler_yacc_impl_clean: 284 | compiler_lex_make_all: 285 | compiler_lex_clean: 286 | compiler_clean: 287 | 288 | ####### Compile 289 | 290 | main.o: main.cpp cgetimg.h \ 291 | /usr/include/fairsioncamera.h \ 292 | /usr/local/include/opencv2/opencv.hpp \ 293 | /usr/local/include/opencv2/opencv_modules.hpp \ 294 | /usr/local/include/opencv2/core.hpp \ 295 | /usr/local/include/opencv2/core/cvdef.h \ 296 | /usr/local/include/opencv2/cvconfig.h \ 297 | /usr/local/include/opencv2/core/hal/interface.h \ 298 | /usr/local/include/opencv2/core/cv_cpu_dispatch.h \ 299 | /usr/local/include/opencv2/core/cv_cpu_helper.h \ 300 | /usr/local/include/opencv2/core/version.hpp \ 301 | /usr/local/include/opencv2/core/base.hpp \ 302 | /usr/local/include/opencv2/core/cvstd.hpp \ 303 | /usr/local/include/opencv2/core/ptr.inl.hpp \ 304 | /usr/local/include/opencv2/core/neon_utils.hpp \ 305 | /usr/local/include/opencv2/core/vsx_utils.hpp \ 306 | /usr/local/include/opencv2/core/traits.hpp \ 307 | /usr/local/include/opencv2/core/matx.hpp \ 308 | /usr/local/include/opencv2/core/saturate.hpp \ 309 | /usr/local/include/opencv2/core/fast_math.hpp \ 310 | /usr/local/include/opencv2/core/types.hpp \ 311 | /usr/local/include/opencv2/core/mat.hpp \ 312 | /usr/local/include/opencv2/core/bufferpool.hpp \ 313 | /usr/local/include/opencv2/core/mat.inl.hpp \ 314 | /usr/local/include/opencv2/core/persistence.hpp \ 315 | /usr/local/include/opencv2/core/operations.hpp \ 316 | /usr/local/include/opencv2/core/cvstd.inl.hpp \ 317 | /usr/local/include/opencv2/core/utility.hpp \ 318 | /usr/local/include/opencv2/core/core_c.h \ 319 | /usr/local/include/opencv2/core/types_c.h \ 320 | /usr/local/include/opencv2/core/optim.hpp \ 321 | /usr/local/include/opencv2/core/ovx.hpp \ 322 | /usr/local/include/opencv2/calib3d.hpp \ 323 | /usr/local/include/opencv2/features2d.hpp \ 324 | /usr/local/include/opencv2/flann/miniflann.hpp \ 325 | /usr/local/include/opencv2/flann/defines.h \ 326 | /usr/local/include/opencv2/flann/config.h \ 327 | /usr/local/include/opencv2/core/affine.hpp \ 328 | /usr/local/include/opencv2/calib3d/calib3d_c.h \ 329 | /usr/local/include/opencv2/dnn.hpp \ 330 | /usr/local/include/opencv2/dnn/dnn.hpp \ 331 | /usr/local/include/opencv2/dnn/dict.hpp \ 332 | /usr/local/include/opencv2/dnn/layer.hpp \ 333 | /usr/local/include/opencv2/dnn/dnn.inl.hpp \ 334 | /usr/local/include/opencv2/flann.hpp \ 335 | /usr/local/include/opencv2/flann/flann_base.hpp \ 336 | /usr/local/include/opencv2/flann/general.h \ 337 | /usr/local/include/opencv2/flann/matrix.h \ 338 | /usr/local/include/opencv2/flann/params.h \ 339 | /usr/local/include/opencv2/flann/any.h \ 340 | /usr/local/include/opencv2/flann/saving.h \ 341 | /usr/local/include/opencv2/flann/nn_index.h \ 342 | /usr/local/include/opencv2/flann/result_set.h \ 343 | /usr/local/include/opencv2/flann/all_indices.h \ 344 | /usr/local/include/opencv2/flann/kdtree_index.h \ 345 | /usr/local/include/opencv2/flann/dynamic_bitset.h \ 346 | /usr/local/include/opencv2/flann/dist.h \ 347 | /usr/local/include/opencv2/flann/heap.h \ 348 | /usr/local/include/opencv2/flann/allocator.h \ 349 | /usr/local/include/opencv2/flann/random.h \ 350 | /usr/local/include/opencv2/flann/kdtree_single_index.h \ 351 | /usr/local/include/opencv2/flann/kmeans_index.h \ 352 | /usr/local/include/opencv2/flann/logger.h \ 353 | /usr/local/include/opencv2/flann/composite_index.h \ 354 | /usr/local/include/opencv2/flann/linear_index.h \ 355 | /usr/local/include/opencv2/flann/hierarchical_clustering_index.h \ 356 | /usr/local/include/opencv2/flann/lsh_index.h \ 357 | /usr/local/include/opencv2/flann/lsh_table.h \ 358 | /usr/local/include/opencv2/flann/autotuned_index.h \ 359 | /usr/local/include/opencv2/flann/ground_truth.h \ 360 | /usr/local/include/opencv2/flann/index_testing.h \ 361 | /usr/local/include/opencv2/flann/timer.h \ 362 | /usr/local/include/opencv2/flann/sampling.h \ 363 | /usr/local/include/opencv2/highgui.hpp \ 364 | /usr/local/include/opencv2/imgcodecs.hpp \ 365 | /usr/local/include/opencv2/videoio.hpp \ 366 | /usr/local/include/opencv2/highgui/highgui_c.h \ 367 | /usr/local/include/opencv2/imgproc/imgproc_c.h \ 368 | /usr/local/include/opencv2/imgproc/types_c.h \ 369 | /usr/local/include/opencv2/imgcodecs/imgcodecs_c.h \ 370 | /usr/local/include/opencv2/videoio/videoio_c.h \ 371 | /usr/local/include/opencv2/imgproc.hpp \ 372 | /usr/local/include/opencv2/ml.hpp \ 373 | /usr/local/include/opencv2/ml/ml.inl.hpp \ 374 | /usr/local/include/opencv2/objdetect.hpp \ 375 | /usr/local/include/opencv2/objdetect/detection_based_tracker.hpp \ 376 | /usr/local/include/opencv2/objdetect/objdetect_c.h \ 377 | /usr/local/include/opencv2/photo.hpp \ 378 | /usr/local/include/opencv2/photo/photo_c.h \ 379 | /usr/local/include/opencv2/shape.hpp \ 380 | /usr/local/include/opencv2/shape/emdL1.hpp \ 381 | /usr/local/include/opencv2/shape/shape_transformer.hpp \ 382 | /usr/local/include/opencv2/shape/hist_cost.hpp \ 383 | /usr/local/include/opencv2/shape/shape_distance.hpp \ 384 | /usr/local/include/opencv2/stitching.hpp \ 385 | /usr/local/include/opencv2/stitching/warpers.hpp \ 386 | /usr/local/include/opencv2/stitching/detail/warpers.hpp \ 387 | /usr/local/include/opencv2/core/cuda.hpp \ 388 | /usr/local/include/opencv2/core/cuda_types.hpp \ 389 | /usr/local/include/opencv2/core/cuda.inl.hpp \ 390 | /usr/local/include/opencv2/stitching/detail/warpers_inl.hpp \ 391 | /usr/local/include/opencv2/stitching/detail/matchers.hpp \ 392 | /usr/local/include/opencv2/stitching/detail/motion_estimators.hpp \ 393 | /usr/local/include/opencv2/stitching/detail/util.hpp \ 394 | /usr/local/include/opencv2/stitching/detail/util_inl.hpp \ 395 | /usr/local/include/opencv2/stitching/detail/camera.hpp \ 396 | /usr/local/include/opencv2/stitching/detail/exposure_compensate.hpp \ 397 | /usr/local/include/opencv2/stitching/detail/seam_finders.hpp \ 398 | /usr/local/include/opencv2/stitching/detail/blenders.hpp \ 399 | /usr/local/include/opencv2/superres.hpp \ 400 | /usr/local/include/opencv2/superres/optical_flow.hpp \ 401 | /usr/local/include/opencv2/video.hpp \ 402 | /usr/local/include/opencv2/video/tracking.hpp \ 403 | /usr/local/include/opencv2/video/background_segm.hpp \ 404 | /usr/local/include/opencv2/video/tracking_c.h \ 405 | /usr/local/include/opencv2/videostab.hpp \ 406 | /usr/local/include/opencv2/videostab/stabilizer.hpp \ 407 | /usr/local/include/opencv2/videostab/global_motion.hpp \ 408 | /usr/local/include/opencv2/videostab/optical_flow.hpp \ 409 | /usr/local/include/opencv2/cudaoptflow.hpp \ 410 | /usr/local/include/opencv2/videostab/motion_core.hpp \ 411 | /usr/local/include/opencv2/videostab/outlier_rejection.hpp \ 412 | /usr/local/include/opencv2/cudaimgproc.hpp \ 413 | /usr/local/include/opencv2/videostab/motion_stabilizing.hpp \ 414 | /usr/local/include/opencv2/videostab/frame_source.hpp \ 415 | /usr/local/include/opencv2/videostab/log.hpp \ 416 | /usr/local/include/opencv2/videostab/inpainting.hpp \ 417 | /usr/local/include/opencv2/videostab/fast_marching.hpp \ 418 | /usr/local/include/opencv2/videostab/fast_marching_inl.hpp \ 419 | /usr/local/include/opencv2/videostab/deblurring.hpp \ 420 | /usr/local/include/opencv2/videostab/wobble_suppression.hpp \ 421 | /usr/local/include/opencv2/videostab/ring_buffer.hpp \ 422 | /usr/local/include/opencv2/cudaarithm.hpp \ 423 | /usr/local/include/opencv2/cudabgsegm.hpp \ 424 | /usr/local/include/opencv2/cudacodec.hpp \ 425 | /usr/local/include/opencv2/cudafeatures2d.hpp \ 426 | /usr/local/include/opencv2/cudafilters.hpp \ 427 | /usr/local/include/opencv2/cudaobjdetect.hpp \ 428 | /usr/local/include/opencv2/cudastereo.hpp \ 429 | /usr/local/include/opencv2/cudawarping.hpp 430 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp 431 | 432 | cgetimg.o: cgetimg.cpp cgetimg.h \ 433 | /usr/include/fairsioncamera.h \ 434 | /usr/local/include/opencv2/opencv.hpp \ 435 | /usr/local/include/opencv2/opencv_modules.hpp \ 436 | /usr/local/include/opencv2/core.hpp \ 437 | /usr/local/include/opencv2/core/cvdef.h \ 438 | /usr/local/include/opencv2/cvconfig.h \ 439 | /usr/local/include/opencv2/core/hal/interface.h \ 440 | /usr/local/include/opencv2/core/cv_cpu_dispatch.h \ 441 | /usr/local/include/opencv2/core/cv_cpu_helper.h \ 442 | /usr/local/include/opencv2/core/version.hpp \ 443 | /usr/local/include/opencv2/core/base.hpp \ 444 | /usr/local/include/opencv2/core/cvstd.hpp \ 445 | /usr/local/include/opencv2/core/ptr.inl.hpp \ 446 | /usr/local/include/opencv2/core/neon_utils.hpp \ 447 | /usr/local/include/opencv2/core/vsx_utils.hpp \ 448 | /usr/local/include/opencv2/core/traits.hpp \ 449 | /usr/local/include/opencv2/core/matx.hpp \ 450 | /usr/local/include/opencv2/core/saturate.hpp \ 451 | /usr/local/include/opencv2/core/fast_math.hpp \ 452 | /usr/local/include/opencv2/core/types.hpp \ 453 | /usr/local/include/opencv2/core/mat.hpp \ 454 | /usr/local/include/opencv2/core/bufferpool.hpp \ 455 | /usr/local/include/opencv2/core/mat.inl.hpp \ 456 | /usr/local/include/opencv2/core/persistence.hpp \ 457 | /usr/local/include/opencv2/core/operations.hpp \ 458 | /usr/local/include/opencv2/core/cvstd.inl.hpp \ 459 | /usr/local/include/opencv2/core/utility.hpp \ 460 | /usr/local/include/opencv2/core/core_c.h \ 461 | /usr/local/include/opencv2/core/types_c.h \ 462 | /usr/local/include/opencv2/core/optim.hpp \ 463 | /usr/local/include/opencv2/core/ovx.hpp \ 464 | /usr/local/include/opencv2/calib3d.hpp \ 465 | /usr/local/include/opencv2/features2d.hpp \ 466 | /usr/local/include/opencv2/flann/miniflann.hpp \ 467 | /usr/local/include/opencv2/flann/defines.h \ 468 | /usr/local/include/opencv2/flann/config.h \ 469 | /usr/local/include/opencv2/core/affine.hpp \ 470 | /usr/local/include/opencv2/calib3d/calib3d_c.h \ 471 | /usr/local/include/opencv2/dnn.hpp \ 472 | /usr/local/include/opencv2/dnn/dnn.hpp \ 473 | /usr/local/include/opencv2/dnn/dict.hpp \ 474 | /usr/local/include/opencv2/dnn/layer.hpp \ 475 | /usr/local/include/opencv2/dnn/dnn.inl.hpp \ 476 | /usr/local/include/opencv2/flann.hpp \ 477 | /usr/local/include/opencv2/flann/flann_base.hpp \ 478 | /usr/local/include/opencv2/flann/general.h \ 479 | /usr/local/include/opencv2/flann/matrix.h \ 480 | /usr/local/include/opencv2/flann/params.h \ 481 | /usr/local/include/opencv2/flann/any.h \ 482 | /usr/local/include/opencv2/flann/saving.h \ 483 | /usr/local/include/opencv2/flann/nn_index.h \ 484 | /usr/local/include/opencv2/flann/result_set.h \ 485 | /usr/local/include/opencv2/flann/all_indices.h \ 486 | /usr/local/include/opencv2/flann/kdtree_index.h \ 487 | /usr/local/include/opencv2/flann/dynamic_bitset.h \ 488 | /usr/local/include/opencv2/flann/dist.h \ 489 | /usr/local/include/opencv2/flann/heap.h \ 490 | /usr/local/include/opencv2/flann/allocator.h \ 491 | /usr/local/include/opencv2/flann/random.h \ 492 | /usr/local/include/opencv2/flann/kdtree_single_index.h \ 493 | /usr/local/include/opencv2/flann/kmeans_index.h \ 494 | /usr/local/include/opencv2/flann/logger.h \ 495 | /usr/local/include/opencv2/flann/composite_index.h \ 496 | /usr/local/include/opencv2/flann/linear_index.h \ 497 | /usr/local/include/opencv2/flann/hierarchical_clustering_index.h \ 498 | /usr/local/include/opencv2/flann/lsh_index.h \ 499 | /usr/local/include/opencv2/flann/lsh_table.h \ 500 | /usr/local/include/opencv2/flann/autotuned_index.h \ 501 | /usr/local/include/opencv2/flann/ground_truth.h \ 502 | /usr/local/include/opencv2/flann/index_testing.h \ 503 | /usr/local/include/opencv2/flann/timer.h \ 504 | /usr/local/include/opencv2/flann/sampling.h \ 505 | /usr/local/include/opencv2/highgui.hpp \ 506 | /usr/local/include/opencv2/imgcodecs.hpp \ 507 | /usr/local/include/opencv2/videoio.hpp \ 508 | /usr/local/include/opencv2/highgui/highgui_c.h \ 509 | /usr/local/include/opencv2/imgproc/imgproc_c.h \ 510 | /usr/local/include/opencv2/imgproc/types_c.h \ 511 | /usr/local/include/opencv2/imgcodecs/imgcodecs_c.h \ 512 | /usr/local/include/opencv2/videoio/videoio_c.h \ 513 | /usr/local/include/opencv2/imgproc.hpp \ 514 | /usr/local/include/opencv2/ml.hpp \ 515 | /usr/local/include/opencv2/ml/ml.inl.hpp \ 516 | /usr/local/include/opencv2/objdetect.hpp \ 517 | /usr/local/include/opencv2/objdetect/detection_based_tracker.hpp \ 518 | /usr/local/include/opencv2/objdetect/objdetect_c.h \ 519 | /usr/local/include/opencv2/photo.hpp \ 520 | /usr/local/include/opencv2/photo/photo_c.h \ 521 | /usr/local/include/opencv2/shape.hpp \ 522 | /usr/local/include/opencv2/shape/emdL1.hpp \ 523 | /usr/local/include/opencv2/shape/shape_transformer.hpp \ 524 | /usr/local/include/opencv2/shape/hist_cost.hpp \ 525 | /usr/local/include/opencv2/shape/shape_distance.hpp \ 526 | /usr/local/include/opencv2/stitching.hpp \ 527 | /usr/local/include/opencv2/stitching/warpers.hpp \ 528 | /usr/local/include/opencv2/stitching/detail/warpers.hpp \ 529 | /usr/local/include/opencv2/core/cuda.hpp \ 530 | /usr/local/include/opencv2/core/cuda_types.hpp \ 531 | /usr/local/include/opencv2/core/cuda.inl.hpp \ 532 | /usr/local/include/opencv2/stitching/detail/warpers_inl.hpp \ 533 | /usr/local/include/opencv2/stitching/detail/matchers.hpp \ 534 | /usr/local/include/opencv2/stitching/detail/motion_estimators.hpp \ 535 | /usr/local/include/opencv2/stitching/detail/util.hpp \ 536 | /usr/local/include/opencv2/stitching/detail/util_inl.hpp \ 537 | /usr/local/include/opencv2/stitching/detail/camera.hpp \ 538 | /usr/local/include/opencv2/stitching/detail/exposure_compensate.hpp \ 539 | /usr/local/include/opencv2/stitching/detail/seam_finders.hpp \ 540 | /usr/local/include/opencv2/stitching/detail/blenders.hpp \ 541 | /usr/local/include/opencv2/superres.hpp \ 542 | /usr/local/include/opencv2/superres/optical_flow.hpp \ 543 | /usr/local/include/opencv2/video.hpp \ 544 | /usr/local/include/opencv2/video/tracking.hpp \ 545 | /usr/local/include/opencv2/video/background_segm.hpp \ 546 | /usr/local/include/opencv2/video/tracking_c.h \ 547 | /usr/local/include/opencv2/videostab.hpp \ 548 | /usr/local/include/opencv2/videostab/stabilizer.hpp \ 549 | /usr/local/include/opencv2/videostab/global_motion.hpp \ 550 | /usr/local/include/opencv2/videostab/optical_flow.hpp \ 551 | /usr/local/include/opencv2/cudaoptflow.hpp \ 552 | /usr/local/include/opencv2/videostab/motion_core.hpp \ 553 | /usr/local/include/opencv2/videostab/outlier_rejection.hpp \ 554 | /usr/local/include/opencv2/cudaimgproc.hpp \ 555 | /usr/local/include/opencv2/videostab/motion_stabilizing.hpp \ 556 | /usr/local/include/opencv2/videostab/frame_source.hpp \ 557 | /usr/local/include/opencv2/videostab/log.hpp \ 558 | /usr/local/include/opencv2/videostab/inpainting.hpp \ 559 | /usr/local/include/opencv2/videostab/fast_marching.hpp \ 560 | /usr/local/include/opencv2/videostab/fast_marching_inl.hpp \ 561 | /usr/local/include/opencv2/videostab/deblurring.hpp \ 562 | /usr/local/include/opencv2/videostab/wobble_suppression.hpp \ 563 | /usr/local/include/opencv2/videostab/ring_buffer.hpp \ 564 | /usr/local/include/opencv2/cudaarithm.hpp \ 565 | /usr/local/include/opencv2/cudabgsegm.hpp \ 566 | /usr/local/include/opencv2/cudacodec.hpp \ 567 | /usr/local/include/opencv2/cudafeatures2d.hpp \ 568 | /usr/local/include/opencv2/cudafilters.hpp \ 569 | /usr/local/include/opencv2/cudaobjdetect.hpp \ 570 | /usr/local/include/opencv2/cudastereo.hpp \ 571 | /usr/local/include/opencv2/cudawarping.hpp 572 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o cgetimg.o cgetimg.cpp 573 | 574 | cimgproc.o: cimgproc.cpp cimgproc.h 575 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o cimgproc.o cimgproc.cpp 576 | 577 | ccallocal.o: ccallocal.cpp ccallocal.h 578 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ccallocal.o ccallocal.cpp 579 | 580 | cserial.o: cserial.cpp cserial.h 581 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o cserial.o cserial.cpp 582 | 583 | cfacerec.o: cfacerec.cpp cfacerec.h 584 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o cfacerec.o cfacerec.cpp 585 | 586 | ####### Install 587 | 588 | install: FORCE 589 | 590 | uninstall: FORCE 591 | 592 | FORCE: 593 | 594 | -------------------------------------------------------------------------------- /vision/README.md: -------------------------------------------------------------------------------- 1 | 此目录存放着视觉代码和英伟达系列芯片的一些资料和安装脚本 2 | 由于需要lfs才能上传大于25m的文件,所以这里给出链接单独下载 3 | 4 | 链接: [link](https://pan.baidu.com/s/1P4s6WE_ML65hYQIy66awwA) 密码: kk0t 5 | 6 | ## 人脸检测 7 | -------------------------------------------------------------------------------- /vision/ccallocal.cpp: -------------------------------------------------------------------------------- 1 | #include "ccallocal.h" 2 | 3 | CCallocal::CCallocal() 4 | { 5 | 6 | } 7 | 8 | -------------------------------------------------------------------------------- /vision/ccallocal.h: -------------------------------------------------------------------------------- 1 | #ifndef CCALLOCAL_H 2 | #define CCALLOCAL_H 3 | 4 | 5 | class CCallocal 6 | { 7 | public: 8 | CCallocal(); 9 | }; 10 | 11 | #endif // CCALLOCAL_H 12 | -------------------------------------------------------------------------------- /vision/ccallocal.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/vision/ccallocal.o -------------------------------------------------------------------------------- /vision/cfacerec.cpp: -------------------------------------------------------------------------------- 1 | #include "cfacerec.h" 2 | 3 | CFacerec::CFacerec() 4 | { 5 | 6 | } 7 | 8 | -------------------------------------------------------------------------------- /vision/cfacerec.h: -------------------------------------------------------------------------------- 1 | #ifndef CFACEREC_H 2 | #define CFACEREC_H 3 | 4 | 5 | class CFacerec 6 | { 7 | public: 8 | CFacerec(); 9 | }; 10 | 11 | #endif // CFACEREC_H 12 | -------------------------------------------------------------------------------- /vision/cfacerec.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/vision/cfacerec.o -------------------------------------------------------------------------------- /vision/cgetimg.cpp: -------------------------------------------------------------------------------- 1 | #include "cgetimg.h" 2 | #include "cimgproc.h" 3 | 4 | CGetimg::CGetimg() 5 | { 6 | 7 | } 8 | CGetimg::~CGetimg() 9 | { 10 | 11 | } 12 | 13 | int CGetimg::getImgFromIndCam(cv::Mat &mat) 14 | { 15 | long nCameraCount = 0; 16 | long nRel = -1; 17 | long nWidth = 0; 18 | long nHeight = 0; 19 | long nFrames = 0; 20 | 21 | unsigned char *pBuffer = NULL; 22 | ICamera *pCamera = NULL; 23 | IDeviceManager *pDeviceManager = new IDeviceManager(); 24 | if(NULL == pDeviceManager) 25 | { 26 | printf("create device manager failed!\r\n"); 27 | return -1; 28 | } 29 | 30 | // Init 31 | pDeviceManager->Initialize(); 32 | // pCamera->AutoBalance(); 33 | 34 | // Get online camera count 35 | nCameraCount = pDeviceManager->GetCameraCount(2000); 36 | printf("A total of %d cameras are online!\r\n ", nCameraCount); 37 | 38 | if(nCameraCount > 0) 39 | { 40 | do 41 | { 42 | // Get first camera on camera list 43 | pCamera = pDeviceManager->GetCamera(0); 44 | 45 | if(pCamera) 46 | { 47 | printf("First camera name is %s, user name is %s, serial number is %s\r\n", 48 | pCamera->GetDeviceInfo()->GetModelName(), 49 | pCamera->GetDeviceInfo()->GetUserID(), 50 | pCamera->GetDeviceInfo()->GetSerialNumber()); 51 | 52 | // Open camera 53 | nRel = pCamera->Open(); 54 | if(0 != nRel) 55 | { 56 | printf("Open camera failed!\r\n"); 57 | break; 58 | } 59 | 60 | pCamera->SetValue("GevSCPSPacketSize", 1500); 61 | pCamera->SetValue("InterPacketDelay", 4000); 62 | 63 | // Get image width and height 64 | nWidth = pCamera->GetValue("Width"); 65 | nHeight = pCamera->GetValue("Height"); 66 | printf("camera resolution is %ld x %ld \r\n", nWidth, nHeight); 67 | pBuffer = new unsigned char[nWidth*nHeight]; 68 | 69 | // Set Trans mode 70 | nRel = pCamera->SetTransMode(TRANS_Continuous); 71 | 72 | // Start capture 73 | nRel = pCamera->StartCapture(); 74 | 75 | if(0 == nRel) 76 | { 77 | CascadeClassifier cascade, nestedCascade; 78 | bool stop = false; 79 | cascade.load("/home/ubuntu/opencv-3.4.1/data/haarcascades/haarcascade_frontalface_alt.xml"); 80 | nestedCascade.load("/home/ubuntu/opencv-3.4.1/data/haarcascades/haarcascade_eye.xml"); 81 | CImgproc proc; 82 | // Get Image 83 | while(true) 84 | { 85 | 86 | if(NULL != pCamera->GetBuffer(1000)) 87 | { 88 | nFrames++; 89 | pBuffer = (unsigned char *)pCamera->GetBuffer(1000); 90 | if(pBuffer == NULL)continue; 91 | // GetBuffer Success 92 | printf("Get Image success, Image Index is %ld\r\n", nFrames); 93 | cv::Mat img(nHeight,nWidth,CV_8UC1,pBuffer); 94 | mat = img; 95 | proc.detectFace(img, cascade, nestedCascade,2,0); 96 | cv::imshow("raw",img); 97 | cv::imwrite("/home/ubuntu/test.png",img); 98 | cv::waitKey(1); 99 | 100 | pBuffer = NULL; 101 | 102 | } 103 | } 104 | pCamera->StopCapture(); 105 | } 106 | 107 | // close camera 108 | pCamera->Close(); 109 | } 110 | }while(false); 111 | } 112 | 113 | // Releases all fairsion resources. 114 | pDeviceManager->Terminate(); 115 | 116 | } 117 | 118 | /*get KS2A17 's img*/ 119 | int CGetimg::getImgFromBaseCam() 120 | { 121 | cv::VideoCapture cap; 122 | cap.open(0); 123 | if(!cap.isOpened()) 124 | { 125 | cout<<"The Usb Cam Open Failed!"<>"<>frame; 138 | cv::imshow("UsbImg",frame); 139 | if(cv::waitKey(10) >= 0) 140 | break; 141 | } 142 | 143 | return 0; 144 | } 145 | 146 | -------------------------------------------------------------------------------- /vision/cgetimg.h: -------------------------------------------------------------------------------- 1 | #ifndef CGETIMG_H 2 | #define CGETIMG_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "../../include/fairsioncamera.h" 8 | #include 9 | 10 | using namespace std; 11 | using namespace FAIRSIONCAMERA_API; 12 | using namespace cv; 13 | 14 | 15 | 16 | class CGetimg 17 | { 18 | public: 19 | CGetimg(); 20 | ~CGetimg(); 21 | 22 | public: 23 | int getImgFromIndCam(cv::Mat &mat); 24 | int getImgFromBaseCam(); 25 | int getImgFromImg(); 26 | 27 | }; 28 | 29 | #endif // CGETIMG_H 30 | -------------------------------------------------------------------------------- /vision/cgetimg.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/vision/cgetimg.o -------------------------------------------------------------------------------- /vision/cimgproc.cpp: -------------------------------------------------------------------------------- 1 | #include "cimgproc.h" 2 | 3 | 4 | 5 | CImgproc::CImgproc() 6 | { 7 | 8 | } 9 | 10 | void CImgproc::detectFace(Mat &img, CascadeClassifier &cascade, CascadeClassifier &nestedCascade, double scale, bool tryflip) 11 | { 12 | String face_cascade_name = "/home/ubuntu/opencv-3.4.1/data/haarcascades/haarcascade_frontalface_default.xml"; 13 | 14 | String eyes_cascade_name = "/home/ubuntu/opencv-3.4.1/data/haarcascades/haarcascade_eye_tree_eyeglasses.xml"; 15 | 16 | CascadeClassifier face_cascade; //定义人脸分类器 17 | CascadeClassifier eyes_cascade; //定义人眼分类器 18 | String window_name = "Capture - Face detection"; 19 | 20 | face_cascade.load(face_cascade_name); 21 | eyes_cascade.load(eyes_cascade_name); 22 | 23 | std::vector faces; 24 | Mat frame_gray = img; 25 | //cvtColor(img, frame_gray, COLOR_BGR2GRAY); 26 | 27 | equalizeHist(frame_gray, frame_gray); 28 | //-- Detect faces 29 | face_cascade.detectMultiScale(frame_gray, faces, 1.1, 3, CV_HAAR_DO_ROUGH_SEARCH, Size(70, 70),Size(100,100)); 30 | 31 | for (size_t i = 0; i < faces.size(); i++) 32 | { //Point center(faces[i].x + faces[i].width / 2, faces[i].y + faces[i].height / 2); 33 | //ellipse(frame, center, Size(faces[i].width / 2, faces[i].height / 2), 0, 0, 360, Scalar(255, 0, 255), 4, 8, 0); 34 | rectangle(img, faces[i],Scalar(255,0,0),2,8,0); 35 | Mat faceROI = frame_gray(faces[i]); std::vector eyes; 36 | 37 | //-- In each face, detect eyes 38 | eyes_cascade.detectMultiScale(faceROI, eyes, 1.1, 1, CV_HAAR_DO_ROUGH_SEARCH, Size(3, 3)); 39 | 40 | for (size_t j = 0; j < eyes.size(); j++) 41 | { 42 | Rect rect(faces[i].x + eyes[j].x, faces[i].y + eyes[j].y, eyes[j].width, eyes[j].height); 43 | //Point eye_center(faces[i].x + eyes[j].x + eyes[j].width / 2, faces[i].y + eyes[j].y + eyes[j].height / 2); 44 | //int radius = cvRound((eyes[j].width + eyes[j].height)*0.25); 45 | //circle(frame, eye_center, radius, Scalar(255, 0, 0), 4, 8, 0); 46 | rectangle(img, rect, Scalar(0, 255, 0), 2, 8, 0); 47 | } 48 | } 49 | //-- Show what you got 50 | namedWindow(window_name, 2); 51 | imshow(window_name, img); 52 | } 53 | -------------------------------------------------------------------------------- /vision/cimgproc.h: -------------------------------------------------------------------------------- 1 | #ifndef CIMGPROC_H 2 | #define CIMGPROC_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | using namespace std; 11 | using namespace cv; 12 | 13 | 14 | 15 | 16 | class CImgproc 17 | { 18 | public: 19 | CImgproc(); 20 | 21 | public: 22 | void detectFace(Mat &img, CascadeClassifier &cascade,CascadeClassifier &nestedCascade, double scale, bool tryflip); 23 | }; 24 | 25 | #endif // CIMGPROC_H 26 | -------------------------------------------------------------------------------- /vision/cimgproc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/vision/cimgproc.o -------------------------------------------------------------------------------- /vision/cserial.cpp: -------------------------------------------------------------------------------- 1 | #include "cserial.h" 2 | 3 | CSerial::CSerial() 4 | { 5 | 6 | } 7 | 8 | -------------------------------------------------------------------------------- /vision/cserial.h: -------------------------------------------------------------------------------- 1 | #ifndef CSERIAL_H 2 | #define CSERIAL_H 3 | 4 | 5 | class CSerial 6 | { 7 | public: 8 | CSerial(); 9 | }; 10 | 11 | #endif // CSERIAL_H 12 | -------------------------------------------------------------------------------- /vision/cserial.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/vision/cserial.o -------------------------------------------------------------------------------- /vision/csetting.cpp: -------------------------------------------------------------------------------- 1 | #include "csetting.h" 2 | 3 | csetting::csetting(const std::string &filename) 4 | { 5 | FileStorage setting_fs(filename,FileStorage::READ); 6 | read(setting_fs); 7 | setting_fs.release(); 8 | } 9 | 10 | void csetting::read(const FileStorage &fileSet) 11 | { 12 | fileSet["mode"] >> c_mode; 13 | fileSet["c_saveResult"] >> c_saveResult; 14 | } 15 | 16 | void csetting::write(FileStorage &fs)const 17 | { 18 | cvWriteComment(*fs, "\n BASE Config",0); 19 | fs <<"c_mode" << c_mode; 20 | fs << "c_saveResult" << c_saveResult; 21 | } 22 | -------------------------------------------------------------------------------- /vision/csetting.h: -------------------------------------------------------------------------------- 1 | #ifndef CSETTING_H 2 | #define CSETTING_H 3 | 4 | #include 5 | #include 6 | 7 | using namespace cv; 8 | 9 | 10 | class csetting 11 | { 12 | public: 13 | csetting(const std::string &filename); 14 | 15 | void read(const FileStorage&fileSet); 16 | void write(FileStorage &fs)const; 17 | public: 18 | int c_mode; /*0 nothing 1 getface 2 other*/ 19 | int c_saveResult; 20 | 21 | }; 22 | 23 | #endif // CSETTING_H 24 | -------------------------------------------------------------------------------- /vision/faceinfotomysql.cpp: -------------------------------------------------------------------------------- 1 | #include "faceinfotomysql.h" 2 | 3 | faceInfoToMysql::faceInfoToMysql() 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /vision/faceinfotomysql.h: -------------------------------------------------------------------------------- 1 | #ifndef FACEINFOTOMYSQL_H 2 | #define FACEINFOTOMYSQL_H 3 | 4 | class faceInfoToMysql 5 | { 6 | public: 7 | faceInfoToMysql(); 8 | }; 9 | 10 | #endif // FACEINFOTOMYSQL_H 11 | -------------------------------------------------------------------------------- /vision/fairsionCam/ReadMe: -------------------------------------------------------------------------------- 1 | the install version is 1.0.0.8,the sdk be based on g++ 4.5.3. 2 | 3 | Install step: 4 | 5 | 1.sudo chmod 777 fairsionCamera_arm_i686.bin 6 | 7 | 2.sudo ./fairsionCamera_arm_i686.bin 8 | 9 | 3.cd ./fairsionCamera/bin/ 10 | 11 | 4.sudo fairCameraDemo.sh 12 | 13 | 5.If you can't find the gige camera, you must determine if the IP address of the NIC is correct,and try the following: 14 | { 15 | 1.ifconfig 16 | 2.sudo ifconfig eth*** 169.254.1.78 17 | } 18 | 19 | 6.If you can't find the usb camera, you must install libudev-dev, try the following: 20 | { 21 | 1.sudo apt-get install libudev-dev 22 | } 23 | -------------------------------------------------------------------------------- /vision/fairsionCam/fairsionCamera_arm_i686.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ULis3h/CengLou/b1672ecb64b6af77f5856aeef700bda461ad8900/vision/fairsionCam/fairsionCamera_arm_i686.bin -------------------------------------------------------------------------------- /vision/jetpack/README.md: -------------------------------------------------------------------------------- 1 | jetpack3.0 安装包 终端 `./` 即可运行 2 | -------------------------------------------------------------------------------- /vision/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "cgetimg.h" 3 | #include "csetting.h" 4 | 5 | #define SETTING_FILE "./config/config.yml" 6 | 7 | int main(int argc,char *argv[]) 8 | { 9 | if(argc < 2) 10 | { 11 | cout<<"few argument!"<