Parameter Management¶
This tutorial covers reading, editing, and validating OpenPTV YAML parameter
files using the openptv-params skill — no GUI required.
Setup¶
Dataset Layout¶
All parameters live in a single YAML file in the dataset root:
The script finds the YAML automatically when you pass the dataset directory.
Workflow¶
1. Validate first¶
Before running any calibration or tracking, check for known configuration mistakes:
Typical output for a correctly configured dataset:
Output when the most common bug is present:
2. Inspect the parameters¶
# Full YAML
uv run python $PP show <dataset>
# Just one section
uv run python $PP show <dataset> --section ptv
uv run python $PP show <dataset> --section sequence
uv run python $PP show <dataset> --section track
3. Fix a parameter¶
The original file is backed up to <file>.parbak before every write.
Values are auto-coerced: 1 → int, 1.46 → float, true/false → bool.
4. Compare two datasets¶
Output:
Common Parameters and Their Meaning¶
| Key | Description |
|---|---|
ptv.mmp_n1 |
refractive index of medium 1 (air, should be ~1.0) |
ptv.mmp_n2 |
refractive index of medium 2 (glass, should be ~1.46) |
ptv.mmp_n3 |
refractive index of medium 3 (water, should be ~1.33) |
ptv.imx / ptv.imy |
image width / height in pixels |
ptv.pix_x / ptv.pix_y |
pixel size in mm |
sequence.first / sequence.last |
frame range to process |
cal_ori.fixp_name |
path to 3D calibration body file |
The Refractive Index Bug¶
The most common mistake in OpenPTV datasets: n2 (the glass slot) is set
to the water value and n3 (the water slot) is set to the glass value.
This looks correct because both values are present, but the internal ray-trace
puts them in the wrong layer order.
Wrong:
Correct:
Fix in one command:
uv run python $PP set <dataset> ptv.mmp_n2 1.46
uv run python $PP set <dataset> ptv.mmp_n3 1.33
uv run python $PP validate <dataset>
Launching the GUI¶
Pass the active YAML file directly so the GUI knows which run to activate on startup — this is the recommended invocation:
You can also pass the experiment directory; the GUI will activate the first YAML it finds (alphabetical order):
YAML discovery rules applied at startup:
| Situation | Behaviour |
|---|---|
Legacy parameters*/ dirs, no YAMLs |
Converted to parameters_<name>.yaml once; dirs ignored afterward |
| YAMLs exist alongside dirs | Dirs ignored; only YAML files used |
| No dirs, YAMLs exist | YAMLs used directly |
| Neither dirs nor YAMLs | Error — create at least one parameters_<name>.yaml first |
When a YAML path is given on the command line, that run becomes active regardless of alphabetical order. When a directory is given, the first YAML (sorted) is activated.
Restoring a Backup¶
If you set a wrong value: