From 272064635658c5e5a28d05545a4460df962231af Mon Sep 17 00:00:00 2001 From: xinyang <895639507@qq.com> Date: Thu, 15 Aug 2019 14:43:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +++- main.cpp | 1 + others/include/additions.h | 12 ++++++------ others/src/additions.cpp | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index cbee54d..ae982b0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # 上海交通大学 RoboMaster 2019赛季 视觉代码 -本代码是上海交通大学RoboMaster2019赛季步兵车辆的视觉部分,其中主要功能包含**自瞄**,**能量机关**,**陀螺识别 **。哨兵仅仅取用其中的**自瞄**和**陀螺识别**部分。 +本代码是上海交通大学RoboMaster2019赛季步兵车辆的视觉部分,其中主要功能包含**自瞄**,**能量机关**,**陀螺识别 **。哨兵仅仅取用其中的**自瞄**和**陀螺识别**部分。 + +本代码统一使用640×480大小的图像进行处理 作者:自瞄(唐欣阳,卫志坤),能量机关(孙加桐,罗嘉鸣)。 diff --git a/main.cpp b/main.cpp index adf633f..13c9dc3 100644 --- a/main.cpp +++ b/main.cpp @@ -6,6 +6,7 @@ /* |____/ \___/ |_| \___/ |_| \_\_| |_| \____| \_/ */ /* */ /**********************************************************************/ +// 本代码统一使用640×480大小的图像进行处理 #include #include diff --git a/others/include/additions.h b/others/include/additions.h index 0b551fe..1cbaa7a 100644 --- a/others/include/additions.h +++ b/others/include/additions.h @@ -9,7 +9,7 @@ #include #include #include - +// 单片机端回传数据结构体 struct McuData { float curr_yaw; float curr_pitch; @@ -22,15 +22,15 @@ struct McuData { }; extern McuData mcu_data; - +// 串口接收函数 void uartReceive(Serial *pSerial); - +// 相机断线重连函数 bool checkReconnect(bool is_camera_connect); - +// 视频保存函数 void saveVideos(const cv::Mat &src); - +// 原始图像显示函数 void showOrigin(const cv::Mat &src); - +// 图像裁剪函数 void extract(cv::Mat &src); double getPointLength(const cv::Point2f &p); diff --git a/others/src/additions.cpp b/others/src/additions.cpp index 91956e2..d0bb008 100644 --- a/others/src/additions.cpp +++ b/others/src/additions.cpp @@ -95,8 +95,8 @@ void saveVideos(const cv::Mat &gimbal_src) { void showOrigin(const cv::Mat &src) { if (!src.empty()) { imshow("origin", src); + cv::waitKey(1); } else return; - cv::waitKey(1); } void extract(cv::Mat &src) {//图像预处理,将视频切成640×480的大小