README:去掉已回滚的预处理段落,补上标定测试与新的标定路径

- 删除 spectro_prep.py / geometry.json 相关说明(该功能已 revert)

- 文件表加入 test_wavelength_calibration.py

- 测试命令与环境变量示例改用 calibration_exports/
This commit is contained in:
starcells committed 2026-11-14 14:55:34 +08:00
1 parent ccc7c62569
commit 858135f17e
1 file changed
+4 -12
+4 -12
View File
@@ -12,13 +12,12 @@ Raspberry Pi HQ Camera(IMX477)RAW 光谱工具集:录制、回放、寻峰
| `hq_spectrum.py` | 核心库 + 实时播放器:PC1B 解码、CFA 分离、ROI、降维、预览、交互窗口 |
| `hq_record.py` | 把相机 RAW 流录成 `recordings/<时间戳>/{frames.bin,frames.jsonl,meta.json}` |
| `hq_average.py` | 多帧平均成一条新录制(降噪) |
| `spectro_core.py` | **共享核心**:模块加载、标定解析、几何(裁剪/反斜切)、基线/噪声/寻峰/拟合/双峰分解、CSV/JSON 输出 |
| `spectro_prep.py` | 预处理:定 ROI、测谱线倾角、反斜切,产出 `geometry.json` + 预览图 |
| `spectro_core.py` | **共享核心**:模块加载、标定解析、基线/噪声/寻峰/拟合/双峰分解、CSV/JSON 输出 |
| `peak_finder.py` | 寻峰与峰信息导出:峰形图、峰形数据、像素坐标、RAW 像素块;`--pick` 交互选峰 |
| `wavelength_calibration.py` | 用汞灯谱线标定 像素→波长,产出 `calibration_exports/` |
| `wavelength_player.py` | 带已存标定的回放(波长轴、瀑布图) |
| `PEAK_FINDER.md` / `WAVELENGTH_PLAYER.md` | 两个工具的详细说明 |
| `test_peak_finder.py` / `test_wavelength_player.py` | 单元测试(含真实录制的端到端用例) |
| `test_peak_finder.py` / `test_wavelength_calibration.py` / `test_wavelength_player.py` | 单元测试(含真实录制的端到端用例) |
| `calibration_exports/` | 汞灯标定的输出目录(**本地生成,不入库**):`calibration.json`、残差、逐像素波长表 |
## 依赖
@@ -47,13 +46,6 @@ python3 wavelength_player.py --input recordings/hq_20261101_114417 \
--calibration calibration_exports/hq_20261101_114417_f0000/calibration.json
```
预处理(裁剪 + 测倾斜 + 反斜切),其它工具用 `--roi <geometry.json>` 复用:
```bash
python spectro_prep.py --input recordings/hq_20261101_114417
python peak_finder.py --input recordings/hq_20261101_114417 --roi geometry/hq_20261101_114417/geometry.json
```
寻峰并导出(`--calibration` 只是**应用**已有的标定,不给就只输出像素坐标):
```bash
@@ -81,14 +73,14 @@ python wavelength_calibration.py --peaks peak_exports/hq_20261101_114417_f0000/p
## 测试
```bash
python -m unittest test_peak_finder test_wavelength_player -v
python -m unittest test_peak_finder test_wavelength_calibration test_wavelength_player -v
```
端到端用例需要录制与标定;录制不在脚本附近时用环境变量指过去,否则自动跳过:
```powershell
$env:PEAK_FINDER_TEST_RECORDING = "C:\Users\peng0\Dev\Light\recordings\hq_20261101_114417"
$env:PEAK_FINDER_TEST_CALIBRATION = "wavelength_calibration\calibration.json"
$env:PEAK_FINDER_TEST_CALIBRATION = "calibration_exports\hq_20261101_114417_f0000\calibration.json"
```
## 仓库里不放什么