Export MCAP camera frames to PNG with robot coordinate axis overlays
Project description
mcap2shadowimg
将 MCAP 文件中的相机视频帧导出为 PNG,并可在图像上叠加机器人坐标轴。
安装
pip install mcap2shadowimg
环境要求:Python 3.10 ~ 3.12,macOS / Linux / Windows。
快速开始
单个 MCAP 文件:
mcap2shadowimg --input /path/to/bag.mcap --output ./output
批量处理(目录下多个 .mcap):
mcap2shadowimg --input /path/to/mcap_dir --output ./output
每个 MCAP 会在输出目录下按文件名创建子目录,例如:
output/
my_bag/
camera2/
1778813410223851000.png
...
常用参数
| 参数 | 默认值 | 说明 |
|---|---|---|
--input |
必填 | .mcap 文件路径,或包含多个 .mcap 的目录 |
--output |
./output |
PNG 输出目录 |
--cameras |
2 |
要导出的相机编号,逗号分隔 |
--overlay-robots |
robot1,robot2 |
绘制坐标轴的机器人 id |
-v, --verbose |
关闭 | 输出详细日志 |
示例:
# 导出 camera0 和 camera2
mcap2shadowimg --input bag.mcap --output ./output --cameras 0,2
# 指定叠加的机器人
mcap2shadowimg --input bag.mcap --output ./output --overlay-robots robot1,robot2
# 开启详细日志
mcap2shadowimg --input bag.mcap --output ./output -v
输出说明
- 默认只导出 camera2
- PNG 文件名为 MCAP 的
log_time(纳秒时间戳) - 若某帧缺少标定或机器人位姿,仍会保存原图,只是不绘制坐标轴
常见问题
导出较慢?
默认仅导出 camera2,通常比导出全部相机快很多。可用 --cameras 指定需要的相机。
图像上没有坐标轴?
可能该帧缺少 camera_info 或 robot_info 数据,程序仍会保存原图。
重新导出前清理旧文件:
rm -rf output/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcap2shadowimg-0.2.0.tar.gz.
File metadata
- Download URL: mcap2shadowimg-0.2.0.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76ff98ad851efb1c2c8a4bb59ee870d2492a60382f4a3522d5da4d8a5d136838
|
|
| MD5 |
fb84e9df7a36ed025a1581b198f95d92
|
|
| BLAKE2b-256 |
0cddbbe0a2cfddb24c4ddf54ee761a6680a43ed94514fd68a362f5fcec752476
|
File details
Details for the file mcap2shadowimg-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcap2shadowimg-0.2.0-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24de48c69cc147fe2f42d1d0dfc07ba35a651382e6ff03bdbe9cbb9fcfbc3ea5
|
|
| MD5 |
ff21d9dfa11452b30df76ec56224db9e
|
|
| BLAKE2b-256 |
07ef85f56be33d2c198fbecae958f8768d9abcf7d1e0d90fad633721a1449993
|