meteor_detect/README.md
2025-03-16 21:32:43 +08:00

131 lines
3.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 流星监控系统 (Meteor Detection System)
一个基于树莓派的实时流星监测系统,使用星光级摄像头进行捕获和分析。
## 功能特点
- **实时视频捕获**:支持星光级摄像头,可动态调整参数
- **自动流星检测**:使用计算机视觉算法分析视频帧
- **GPS时间与位置同步**:提供精确的事件元数据
- **本地环形缓存存储**:持续记录最近视频
- **检测事件云端上传**:包含元数据的事件片段上传
- **远程控制接口**通过REST API和MQTT协议
- **系统健康监控**:自动恢复和故障处理
## 项目结构
```
meteor_detect/
├── src/
│ ├── camera/ # 摄像头控制与视频采集
│ │ ├── controller.rs # 摄像头控制器
│ │ ├── frame_buffer.rs # 视频帧缓冲区
│ │ └── v4l2.rs # V4L2摄像头驱动
│ ├── gps/ # GPS和时间同步
│ │ ├── controller.rs # GPS控制器
│ │ └── nmea.rs # NMEA解析器
│ ├── sensors/ # 环境传感器
│ │ ├── controller.rs # 传感器控制器
│ │ └── dht22.rs # 温湿度传感器驱动
│ ├── detection/ # 流星检测算法
│ ├── storage/ # 数据存储管理
│ ├── communication/ # 通信与远程控制
│ ├── monitoring/ # 系统监控
│ ├── config.rs # 配置管理
│ └── main.rs # 应用程序入口
├── Cargo.toml # 项目配置与依赖
├── config-example.toml # 配置文件示例
├── build.sh # 构建脚本
└── README.md # 项目文档
```
## 硬件要求
- **树莓派**3B+/4B/5 (推荐)
- **星光级摄像头**支持IMX477/IMX462传感器
- **GPS模块**支持PPS信号输出精确授时
- **可选传感器**:温湿度(DHT22)、光敏传感器
- **存储**32GB+高速microSD卡
## 软件依赖
- **Rust 1.70+** (2021 edition)
- **OpenCV 4.x**
- **V4L2** 摄像头工具
- **SQLite 3**
## 快速开始
### 安装依赖
使用我们的安装脚本一键安装所有依赖:
```bash
./build.sh setup
```
或手动安装:
```bash
# 安装Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 安装系统依赖
sudo apt update
sudo apt install -y git curl build-essential pkg-config \
libssl-dev libv4l-dev v4l-utils \
libopencv-dev libsqlite3-dev
```
### 编译项目
```bash
# 调试版本
./build.sh build
# 发布版本(优化性能)
./build.sh build-release
```
### 配置系统
```bash
# 创建默认配置
./build.sh create-config
# 编辑配置文件
nano ~/.config/meteor_detect/config.toml
```
### 运行系统
```bash
# 使用构建脚本
./build.sh run
# 或直接运行
cargo run --release
```
## 配置选项
配置文件位于`~/.config/meteor_detect/config.toml`,包含以下主要配置项:
- **摄像头参数**:分辨率、曝光、增益
- **GPS设置**端口、波特率、PPS配置
- **检测参数**:灵敏度、触发阈值
- **存储策略**:保留时间、压缩设置
- **通信选项**MQTT服务器、API配置
详细配置示例请参考`config-example.toml`文件。
## 开发指南
- 使用`cargo test`运行测试
- 使用`./build.sh clean`清理构建文件
- 查看[设计文档](docs/design.md)了解系统架构
## 许可证
MIT License