当前位置:网站首页>STM32-遥感数据处理
STM32-遥感数据处理
2022-08-04 01:55:00 【ValentineHP】
一. 简介
在上篇文章中,以及知道如何采集遥感数据了,可是采集到的数据是0-4096范围内的,实际上,下边界不为0,上边界也不为4096。为了方便后续的处理,本文将采集到的遥感数据归一到0-100范围内。
二. 遥感数据校准
这个部分是必要的,可以确定真实情况下上下边界的数据。其具体做法为,连续采集一些边界数据,求和,取平均就可以了。具体做法如下。当采集到的数据靠近我们认为的边界时,就认为是有效数据,否则丢弃,其他四个边界的做法也是如此。
/*XL方向校准*/
void Rocker1CalibrationXL(void)
{
uint8_t i;
uint32_t valueSum = 0;
for(i = 0 ;i < 400; )
{
uint16_t value = getX1Value();
if(value > 0xf600)
{
valueSum += value;
i++;
}
}
XOffSetL = valueSum / 400;
}
三. 数据归一化
这部分也是关键的一步。其具体做法分为如下几个步骤:
- 获取原始数据
- 计算原始数据到对应两边界直接的距离(也就是相减)
- 将计算得到的结果扩大100倍,然后除以两边界的差值
- 左 边加(100-右边) 除以二,得到最终结果
具体代码实现如下
XValue = getX1Value(); //获取X方向遥感数值
if(XValue > XOffSetL)
XtempL = 0; /*小于左边界,直接复制为0*/
else
XtempL = XOffSetL - XValue ;
if(XValue < XOffSetR)
XtempR = 0; /*大于右边界,直接复制为0*/
else
XtempR = XValue - XOffSetR;
uint32_t XtL = XtempL * 100;
uint32_t XtR = XtempR * 100;
XtL = XtL / (XOffSetL - XOffSetR);
XtR = XtR / (XOffSetL - XOffSetR);
X = (XtL + (100 - XtR)) / 2; /*结果为遥感到左边界的距离,0 - 100*/
至此就完成啦。
还有关注微信公众号 FPGA之旅
边栏推荐
- Flask框架初学-05-命令管理Manager及数据库的使用
- FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
- 多线程 之 JUC 学习篇章一 创建多线程的步骤
- 简单排序(暑假每日一题 14)
- 云开发校园微社区微信小程序源码/二手交易/兼职交友微信小程序开源源码
- 实例038:矩阵对角线之和
- LDO investigation
- Priority_queue element as a pointer, the overloaded operators
- sql有关问题,小时粒度,找到前一个小时内的数据
- 企业虚拟偶像产生了实质性的价值效益
猜你喜欢

2022 China Computing Power Conference released the excellent results of "Innovation Pioneer"

循环绕过问题

Installation and configuration of nodejs+npm

html select tag assignment database query result

Quickly build a website with static files

C program compilation and predefined detailed explanation

splice随机添加和删除的写法

实例040:逆序列表

Use nodejs switch version (no need to uninstall and reinstall)

DDTL:远距离的域迁移学习
随机推荐
Continuing to invest in product research and development, Dingdong Maicai wins in supply chain investment
Qt中对象树的机制介绍以及底层实现,各种结果分析:(以及自己写容易犯错的点)
天地图坐标系转高德坐标系 WGS84转GCJ02
Flask Framework Beginner-06-Add, Delete, Modify and Check the Database
sql有关问题,小时粒度,找到前一个小时内的数据
priority_queue元素为指针时,重载运算符失效
Example 039: Inserting elements into an ordered list
FeatureNotFound( bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested:
安全至上:落地DevSecOps最佳实践你不得不知道的工具
工程制图复习题
APP电商如何快速分润分账?
企业虚拟偶像产生了实质性的价值效益
Day13 Postman的使用
Use nodejs switch version (no need to uninstall and reinstall)
appium软件自动化测试框架
Continuing to invest in product research and development, Dingdong Maicai wins in supply chain investment
Engineering drawing review questions (with answers)
第13章 网络安全漏洞防护技术原理与应用
数组_滑动窗口 | leecode刷题笔记
阿里云技术专家邓青琳:云上跨可用区容灾和异地多活最佳实践