From 56a27cdbc8c261f76b89deced477045e058b032a Mon Sep 17 00:00:00 2001 From: tangchao0503 Date: Mon, 6 Jun 2022 19:47:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'Home'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Home.md | 90 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 73 insertions(+), 17 deletions(-) diff --git a/Home.md b/Home.md index 9b1f4e3..f846a45 100644 --- a/Home.md +++ b/Home.md @@ -1,30 +1,86 @@ 1、需求分析 -FSA2 采集数据时,显示当前云量,以便用户判断当前野外光照条件是否适合采集数据; +任工想简化设置维特惯导的参数的过程; 2、功能概述 -通过rgb图像进行云点识别 + 云量计算 + 输出云分布二值图; +通过此库提供的功能,能够方便的设置维特惯导的所有参数; + 3、api说明 -Cloudage(int radius);//构造函数传入云量计算的有效半径 -void setRadius(int radius);//此函数可以修改云量计算的有效半径 +见代码中 -QImage readImage(QString imagePath);//此函数可以从磁盘读入图片 -QImage createGrayscaleImage(int width, int height);////此函数根据参数创建一个灰度图像 +4、UML图 -void getPosOfCenterpixel(int width, int height, int &widthCenter, int &heightCenter);//计算图片的中心点 -bool isValidPos(int x1, int y1, int x2, int y2);//判断像元点(x,y)是否在有效半径内 +无法上传图片; -float getcloudage1(QImage image, bool saveBinaryImg = false);//通过算法1进行云量计算 -float getcloudage2(QImage image, bool saveBinaryImg = false);//通过算法2进行云量计算 -4、使用举例 +5、使用 -QString imgPath = "D:\\PycharmProjects\\cloudage\\photo\\photo12.jpg"; +5.1 使用方法 -Cloudage* tmp = new Cloudage(443); -QImage img = tmp->readImage(imgPath); +(1)首先继承SerialPortBase类,实现串口收发功能类B; +(2)实例化WitmotionDll时,需要传入串口类B; +(3)设置参数时,直接调用参数对应的函数即可; -float cloud1 = tmp->getcloudage1(img); -float cloud2 = tmp->getcloudage2(img); -5、输出结果: \ No newline at end of file +5.2 使用示例代码 + +#include +#include + +#include "witmotiondll.h" +#include "qtserialport.h" +#include "windowsserialport.h" + +void delay_tc(uint32_t millisecond) +{ + QThread::sleep(millisecond/1000); + std::cout<<"This is delay_tc!!!!!!!!!!"<OpenSerialPort("COM15", 9600); + + WitmotionDll * tmp = new WitmotionDll(serialPort); + tmp->delayMsRegister(delay_tc); + tmp->printfRegister(printf_tc); + tmp->setDelayTimeMs(1000); + + tmp->installationOrientation(ORIENT_VERTICAL); +// tmp->algorithm(ALGROITHM9); +// tmp->setTimeZone(UTC_P12); +// tmp->SetBaudrate(WIT_BAUD_115200); +// tmp->SetReturnRate(RRATE_20HZ); + +// tmp->SetDeviceAddress(124); + +// tmp->setD0Model(DOL); +// tmp->setD0HighLevelPulseWidth(20); +// tmp->setD0Period(5); + +// RETURN_CONTENT_STRUCT content; +// content.time = true; +// content.angular_velocity = true; +// content.euler_angle = true; +// content.ground_velocity = true; +// content.quaternion = true; +// tmp->setContent(content); + + +// tmp->recordData(); + + serialPort->CloseSerialPort(); + + return a.exec(); +} +6、输出结果: \ No newline at end of file