snap-picture-by-pc-camera-skill — 电脑摄像头拍照技能
概述
调用电脑(PC)的USB/内置摄像头拍照,保存为带时间戳的图片文件。
用法
python scripts/snap_picture.py
参数
| 参数 | 默认值 | 说明 |
|---|---|---|
--camera-id |
0 | 摄像头设备索引 |
--output-dir |
test_output/snap-picture-by-pc-camera-skill | 输出目录 |
输出
result.json 结构:
{
"status": "OK",
"message": "拍照完成",
"snap_time": "2026-06-02 18:15:00",
"img_path": "C:\\Users\\admin\\.openclaw\\workspace\\test_output\\snap-picture-by-pc-camera-skill\\snap_20260602_181500.jpg",
"img_name": "snap_20260602_181500.jpg",
"img_size_bytes": 123456,
"img_width": 1280,
"img_height": 720,
"camera_device": "USB Camera",
"file_info": {
"path": "...",
"name": "...",
"size_bytes": 123456,
"width": 1280,
"height": 720
}
}
依赖
- opencv-python (cv2)