Install
openclaw skills install @qujingyang28/box-pointcloud-collectorIntel RealSense D455 箱体点云数据采集工具。用于采集箱体的 RGB 彩色图和深度图数据集,支持手动/自动采集模式。触发场景:(1) 采集箱体/物体点云数据 (2) 创建深度学习训练数据集 (3) Bin Picking 项目数据准备 (4) 相机标定数据采集。支持 Intel RealSense D455 相机。
openclaw skills install @qujingyang28/box-pointcloud-collector使用 Intel RealSense D455 相机采集箱体 RGB-D 数据集。
python scripts/collect_v2.py
| 按键 | 功能 |
|---|---|
| S | 保存 1 张(RGB + Depth) |
| A | 自动保存 10 张(每 5 秒 1 张) |
| Q | 退出并打开数据目录 |
box_dataset/
└── box_YYYYMMDD_HHMMSS/
├── camera_intrinsic.json # 相机内参
├── dataset_config.json # 数据集配置
├── capture_stats.json # 采集统计
└── raw_data/
├── 000001_Color.png # RGB 彩色图
├── 000001_Depth.raw # 深度图 (uint16)
└── ...
| 文件 | 格式 | 说明 |
|---|---|---|
XXX_Color.png | PNG 8位 RGB | 彩色图像 |
XXX_Depth.raw | uint16 raw | 深度数据 (640×480×2 bytes) |
camera_intrinsic.json | JSON | 相机内参 (fx, fy, cx, cy) |
import numpy as np
depth = np.fromfile("000001_Depth.raw", dtype=np.uint16)
depth = depth.reshape(480, 640)
depth_m = depth / 1000.0 # 转换为米
import json
with open("camera_intrinsic.json") as f:
intr = json.load(f)
def pixel_to_3d(u, v, depth_m):
X = (u - intr['ppx']) * depth_m / intr['fx']
Y = (v - intr['ppy']) * depth_m / intr['fy']
Z = depth_m
return X, Y, Z
pip install pyrealsense2 opencv-python numpy
作者:Robot_Qu
版本:v2.0