Files
Catalyst-MDVS/README.md

78 lines
1.9 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.

# MindVision相机驱动的装甲板检测系统
本项目是基于MindVision相机SDK的装甲板检测系统工业相机替代原有的OpenCV相机接口。
## 项目结构
- `MindVisionCamera.h/cpp` - MindVision相机驱动实现
- `main.cpp` - 主程序入口已修改为使用MindVision相机
- 其他 `.cpp/.h` 文件 - 原有的图像处理、装甲板检测、卡尔曼滤波等功能模块
## 环境准备
此项目需要在WSL Ubuntu环境中编译和运行因为MindVision SDK位于WSL系统中。
### 1. 确保MindVision SDK已安装
在WSL Ubuntu中确认SDK路径
```bash
ls -la /home/lld/mdv/include/CameraApi.h
ls -la /home/lld/mdv/lib/x86/
```
### 2. 安装必要的依赖
```bash
sudo apt update
sudo apt install build-essential cmake libopencv-dev
```
## 编译项目
### 方法1使用构建脚本
```bash
cd /home/lld/code/mdvs
chmod +x build.sh
./build.sh
```
### 方法2手动编译
```bash
cd /home/lld/code/mdvs
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
```
## 运行程序
```bash
./build/armor_detector_mdv
```
## 配置说明
- 相机ID可在main函数中修改 `cam_id` 变量
- 默认分辨率640x480帧率30fps
- 支持颜色切换(红色/蓝色)
- 支持TTL通信默认关闭
## 注意事项
1. 此项目使用MindVision相机SDK直接驱动相机可以获得更好的性能和相机控制能力
2. 曝光、白平衡等参数可在`MindVisionCamera.cpp`中的`set_camera_parameters()`函数中调整
3. 如果遇到编译错误请检查MindVision SDK的库文件名是否正确可能是`libMVSDK.so``libMVSDK.a`
## 键盘控制
- 按 'q' 键退出程序
- 按其他键继续运行
## 故障排除
如果相机无法打开:
1. 检查相机是否正确连接
2. 确认MindVision相机驱动是否正确安装
3. 验证相机ID是否正确
4. 检查权限可能需要将用户添加到video组