整理代码

This commit is contained in:
xinyang
2019-08-15 14:43:19 +08:00
parent f85e78f95a
commit 2720646356
4 changed files with 11 additions and 8 deletions

View File

@@ -1,5 +1,7 @@
# 上海交通大学 RoboMaster 2019赛季 视觉代码 # 上海交通大学 RoboMaster 2019赛季 视觉代码
本代码是上海交通大学RoboMaster2019赛季步兵车辆的视觉部分其中主要功能包含**自瞄****能量机关****陀螺识别 **。哨兵仅仅取用其中的**自瞄**和**陀螺识别**部分。 本代码是上海交通大学RoboMaster2019赛季步兵车辆的视觉部分其中主要功能包含**自瞄****能量机关****陀螺识别 **。哨兵仅仅取用其中的**自瞄**和**陀螺识别**部分。
本代码统一使用640×480大小的图像进行处理
作者:自瞄(唐欣阳,卫志坤),能量机关(孙加桐,罗嘉鸣)。 作者:自瞄(唐欣阳,卫志坤),能量机关(孙加桐,罗嘉鸣)。

View File

@@ -6,6 +6,7 @@
/* |____/ \___/ |_| \___/ |_| \_\_| |_| \____| \_/ */ /* |____/ \___/ |_| \___/ |_| \_\_| |_| \____| \_/ */
/* */ /* */
/**********************************************************************/ /**********************************************************************/
// 本代码统一使用640×480大小的图像进行处理
#include <iostream> #include <iostream>
#include <thread> #include <thread>

View File

@@ -9,7 +9,7 @@
#include <systime.h> #include <systime.h>
#include <serial.h> #include <serial.h>
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
// 单片机端回传数据结构体
struct McuData { struct McuData {
float curr_yaw; float curr_yaw;
float curr_pitch; float curr_pitch;
@@ -22,15 +22,15 @@ struct McuData {
}; };
extern McuData mcu_data; extern McuData mcu_data;
// 串口接收函数
void uartReceive(Serial *pSerial); void uartReceive(Serial *pSerial);
// 相机断线重连函数
bool checkReconnect(bool is_camera_connect); bool checkReconnect(bool is_camera_connect);
// 视频保存函数
void saveVideos(const cv::Mat &src); void saveVideos(const cv::Mat &src);
// 原始图像显示函数
void showOrigin(const cv::Mat &src); void showOrigin(const cv::Mat &src);
// 图像裁剪函数
void extract(cv::Mat &src); void extract(cv::Mat &src);
double getPointLength(const cv::Point2f &p); double getPointLength(const cv::Point2f &p);

View File

@@ -95,8 +95,8 @@ void saveVideos(const cv::Mat &gimbal_src) {
void showOrigin(const cv::Mat &src) { void showOrigin(const cv::Mat &src) {
if (!src.empty()) { if (!src.empty()) {
imshow("origin", src); imshow("origin", src);
cv::waitKey(1);
} else return; } else return;
cv::waitKey(1);
} }
void extract(cv::Mat &src) {//图像预处理将视频切成640×480的大小 void extract(cv::Mat &src) {//图像预处理将视频切成640×480的大小