Skip to content

Choosing the parameters in the GUI

Most fields can stay as they are. This page says which ones you must set, which method to pick, and which extra options are worth switching on for your data. Rest the mouse on any field in the GUI to see what it does, its default and its YAML key; every field is also listed in the GUI parameter reference with the same text.

The numbers quoted here come from the benchmark and the real recordings in Particle trackers and the tracking parameters guide.

Try it before you save: Preview

Preview on a few frames (Tracking parameters, under Try it) runs the first frames of the sequence with the values shown in the dialog, without saving them, and reports the particles per camera, the 3D points per frame, the share of points that continue into the next frame and the size of their steps. It works in .preview/ inside the experiment folder; your results, YAML and run log are not touched.

Only what a change affects runs again: a tracking value reruns tracking, a matching criterion reruns matching and tracking, anything about the images or particle recognition reruns everything. The same from the command line:

openptv preview parameters_Run1.yaml --frames 5     # --fresh reruns everything

The same in a notebook

uv run --extra viz marimo run src/openptv2/gui/parameters_nb.py -- --yaml path/to/parameters_Run1.yaml

The detection, correspondence and tracking methods with their options, the search box, Preview and Save, drawn from the same declarations and saved by the same rules as the dialogs. Main and Calibration parameters other than these stay in the dialogs or the YAML.

Where a value comes from

One rule, for the GUI and the batch command alike:

  • The YAML file is the truth. What it says is what a run uses.
  • Values that depend on your rig or data are never assumed: image and pixel size, refractive indices, thresholds and particle sizes, the observation volume and matching criteria, the frame range and image names, and the search box. A run that misses one stops and names it, for example Missing required track parameters: track.dacc. What an empty dialog shows for them is only a starting value; it counts once you press OK and it is in the YAML.
  • Every other key has one default, the one the dialog and the reference show.
  • A value of the wrong kind (imx: wide) stops the load and names the key.

The order of work

  1. Main parameters → General: number of cameras, calibration files, refractive indices. Splitter cameras: tick Split images into 4? (see Splitter cameras). No calibration yet: calibrate first, in the calibration window (see Calibration parameters).
  2. Main parameters → Particle recognition: grey thresholds and particle size, checked on the images (Detection shows what is found). This decides more than any tracking option.
  3. Main parameters → Observation Volume and Criteria: the depth range of the lit volume and the epipolar band.
  4. Main parameters → Sequence: the method (usually Standard) and a short frame range first. Run Sequence.
  5. Tracking parameters → Suggest from my data: it measures the points of step 4 and picks the tracker and the overlapping-particle options for you, with the reasons.
  6. Set the search box (how far a particle moves per frame), run Tracking, look at the trajectories, then process the whole recording.

Main parameters

Main parameters, General

Main parameters, Particle recognition

Set the grey threshold of each camera just above the background noise, and the smallest and largest particle size so that noise specks and reflections are dropped. High pass filter is on for most images; Negative images for dark particles on a bright background.

Main parameters, Observation Volume

The volume is where matching looks for particles along each epipolar line: cover the lit volume with a small margin. Too large: more ghost points and slower; too small: particles near the edges are lost.

Main parameters, Criteria for correspondences

The epipolar band (eps0) is the one to check here: a few times the calibration's reprojection error. The size and brightness ratios near 0 accept any candidate; raise them only if particle images are alike in all cameras and you see ghosts. Shared-blob second pass and Light check are for overlapping particles (see below).

Detection and correspondence

Main parameters, Sequence, Standard

The Sequence tab has two pickers: how particles are found in the images (detection) and how the cameras' particles are matched into 3D points (correspondence).

Your images Detection
Tracer particles, bright on dark (most experiments), including splitter cameras Standard
Faint bubbles or glare points (helium-filled soap bubbles at large distance) Bubbles
A moving object or wall you want masked out Contour mask, or Remove background (rembg) (needs openptv2[rembg])
Particles already found (an earlier run, another program) Keep the particles already in the store

Correspondence is Standard (epipolar matching with your calibration) unless you installed a plugin that matches another way. A method with options of its own shows them under the description. Bubbles:

Main parameters, Sequence, Bubbles

The tracker

Your data Tracker Why (measured)
Real or noisy data, any density Two-phase (default) the most accurate (velocity error 1.3 to 7 times lower than the others) and the fastest
Exact data: a simulation, no noise, no overlapping particles Fast 3D keeps every point (yield 0.995); two-phase's ghost rules drop 3 to 6 % of them
You must reproduce a result of the old OpenPTV Trackcorr the legacy algorithm; slower and less accurate on noisy data

Suggest from my data makes this choice from your points (it tells exact from noisy data by the noise of the tracks against their step):

Tracking parameters after Suggest from my data

What else to set for each tracker

The search box is shared, but the trackers use different parts of it. The dialog says which, under the box.

Two-phase Fast 3D Trackcorr
x/y/z min and max only the largest one, as the search radius yes yes
Largest turn, largest velocity change not used only with Limit by largest turn and velocity change yes
Direction Forward + backward (better tracks) either either
Its own options defaults are right for most data; see below for overlapping particles Post-process on; Corrective passes 1 for longer tracks Post-process on; Corrective passes 1 for longer tracks

The search box. About 3 times the typical step of a particle per frame, or the largest real step (Suggest from my data prints the typical step). Too small loses fast particles; too large gives more candidates and, in dense data, more wrong links.

Two-phase:

Tracking parameters, Two-phase, Linking

  • Image cost weight: keep 1 with a good calibration, lower it (0 to 0.5) with a poor one.
  • Largest gap: 2 bridges one missing frame; 3 when particles often drop out for a frame or two.

Fast 3D:

Tracking parameters, Fast 3D

  • Limit by largest turn and velocity change: off by default. If you switch it on, take the velocity change loose, from a first run: a tight one loses true links (link recall 0.887 at 0.4 mm/frame on the benchmark, 0.999 at 6).
  • Epipolar penalty: its measured effect is tiny; keep 0.

Tracking parameters, Fast 3D, Corrective pass

  • Corrective passes (Fast 3D and Trackcorr): after tracking, each track end is predicted into the next frame and unused detections there are matched again. Longer tracks; 1 pass is usually enough.

Trackcorr:

Tracking parameters, Trackcorr

Set the largest turn and velocity change too; it uses all eight limits.

Ghost points and confirmation (Two-phase)

Tracking parameters, Two-phase, Ghost points and confirmation

The defaults suit sparse, noisy data. Change one only for a reason:

Field Change it when
Ghost limit to start a track (0.2) 0.15 if more than 45 % of the points are seen by only 3 cameras, 0.3 if fewer than 20 %
Track length before doubtful points (3) 6 when accuracy matters more than the number of points
Ghost probability from the blobs have no usable brightness: ray distance and cameras only
Confirmation tolerance (auto) dense or frame-skipped data: 0.3
Confirm track ends (on) keep it on
Brightness change limit (off) frame-skipped or slow-camera data (steps of 0.2 mm or more): 0.5

A few expert settings have no field; they are listed under Set only in the YAML.

Overlapping particles (merged blobs)

When two particles overlap in a camera image, the detector sees one blob. Matching uses every blob once, so one of the two particles loses that camera and is often not found at all, and the one that keeps it gets a shifted position. This happens with dense seeding, large particles or long exposure.

Do I need to deal with it? Press Suggest from my data after a sequence run. It reports the shared-blob flag: the share of points with one camera view much brighter than their other views, the sign of a blob holding two particles.

Shared-blob flag What to do What it brings What it costs
below 8 % nothing the extras change nothing on clean data –
8 to 10 % optional a few percent lower velocity error 3-4 times the tracking time
10 % or more Two-phase + Correct points in shared blobs; add the Shared-blob second pass (Main parameters → Criteria) velocity error -13 to -40 % on the benchmark; on real recordings with 15 %, twice the tracks of 200+ frames and 15 % smoother correction: 3-4 times the tracking time; pass: +10-30 % matching time

Tracking parameters, Two-phase, Overlapping particles

  • Correct points in shared blobs (Two-phase): re-estimates the points that touch a shared blob from their tracks and links again. The option that matters most.
  • Shared-blob second pass (Main parameters → Criteria): matches the shared blobs once more, so the hidden particle is found too: more points and longer tracks. Its new points are noisier, so use it together with the correction, and on its own only for sparse seeding.
  • Light check (Main parameters → Criteria): drops points seen by all cameras but one when the missing camera shows no light there (a ghost). Meant to go with the second pass; it removes 8 to 10 % of the points on real recordings, some of them real.
  • Merged-blob rounds (Two-phase): the full merged-blob loop, slower. The correction gives most of its gain; try 1 or 2 rounds only for crowded data after the correction.

Fast 3D and Trackcorr have no merged-blob options: the loop was tried with Fast 3D and made the velocity error worse (0.167 to 0.199).

The neighbours' motion (spatial consensus, Two-phase)

Tracking parameters, Two-phase, Spatial consensus

Off for most data. For smooth flows with many particles where tracks still jump between particles, set Use the neighbours' motion to After linking: a link is dropped when it does not move like its neighbours. Add Before linking with a gate of 6 to 8 times the noise of the 3D positions; a gate near the noise drops the right candidates too. Details: spatial consensus.

Calibration parameters

Opened with Edit calibration parameters in the calibration window, or by right-clicking the run in the main window. Each button of the calibration window reads one tab:

Button in the calibration window Tab it reads
Load images/parameters Images Data
Detection Calibration Data Detection (thresholds and dot sizes)
Manual orient., Orient. with file, Raw orientation Manual pre-orientation (the ids of the 4 dots you click)
Sortgrid Calibration Data Detection → Sortgrid search radius
Fine tuning Calibration Orientation Param. (which camera terms to fit)
Orientation from dumbbell Dumbbell calibration parameters, frames from Main parameters → Sequence
Tracer self-cal, Orientation with particles Shaking calibration parameters

Calibration parameters, Images Data

The point file of the target has one line per dot: id x y z in mm. Split calibration image into 4? is the calibration's splitter switch (see Splitter cameras).

Calibration parameters, Calibration Data Detection

The image and pixel sizes are shared with the whole run (ptv: section). The thresholds and dot sizes are separate from those for particles, because the target's dots are larger and brighter. Check them with Detection: every dot of the target crossed, nothing else.

Sortgrid search radius (sortgrid.radius) is for the calibration target only; the particle images have their own settings in Main and Tracking parameters. It is how far a detected dot may be from the projected position of its known point. After each Sortgrid the status line gives, per camera, the points matched, how far apart the dots are and how many dots were used twice:

  • About 3 times the error of the current camera guess: about 15 px while the guess is rough (after Manual orient.), then 8-10 px once Fine tuning has run.
  • Below half the dot spacing. Above it, a known point whose dot was missed takes a neighbouring dot: on test_data/test_splitter (dots 33-38 px apart) 20 px already used dots twice.
  • Not too small: with a converged calibration of test_data/test_cavity, 5 px kept 31 of the 43 points of camera 1, 10 px all 43.

0 or a missing key means 10 px (calibration best practices).

Calibration parameters, Manual pre-orientation

P1 to P4 are the ids, from the point file, of the four dots you click in each camera in Manual orient., in that order. Pick dots far apart, not on one line, and visible in every camera.

Which camera terms to fit

Calibration parameters, Calibration Orientation Param.

The camera's position and angles are always fitted. Each box adds terms; add them in this order, run Fine tuning after each, and keep a term only if the residuals drop clearly:

  1. cc, xh, yh (focal length and principal point). They need a target that spans depth (a 3D target or several planes); from one flat plane, the focal length trades off with the distance.
  2. k1, k2 (radial distortion): residuals that grow towards the image edges.
  3. k3, p1, p2: only if the residuals still show a pattern, with many dots across the image.
  4. interf (window tilt): a camera looking through a flat window or a splitter that may be tilted, whose residuals stay high. On a real splitter rig it took one camera from 2.4 to 1.1 px.

Keep scale and shear off for digital cameras; they are for old analog cameras.

Plane file names (under Combine preprocessed planes) lists the planes to combine.

Calibrate with different Z and Combine preprocessed planes are the multi-plane calibration (a flat target moved to known depths): the first saves the matched points of each plane, the second fits all planes together (plate calibration).

Dumbbell and tracer particles

Calibration parameters, Dumbbell

Orientation from dumbbell uses the frames of Main parameters → Sequence in which every camera sees exactly two dots. Set dumbbell scale to the true distance between the two balls (it gives the calibration its scale). dumbbell epsilon drops frames whose length is off by more than that (0 keeps all). Fixed camera stays as it is (0 picks the one that saw the dumbbell most often). Step size is used only by the standalone dumbbell tool (dumbbell recipe).

Calibration parameters, Shaking

Tracer self-cal refines the cameras with tracked particles of a sequence and tracking run, in the frames given here. It reports the ray miss distance (RCM) before and after, and keeps the new cameras only when it drops. A lower RCM alone does not prove better cameras: on real recordings it lowered the RCM a little (43 to 40 um) while the tracking did not change, and still moved one camera by about 1 mm; tracers alone cannot fix the scale. Compare your tracks before and after (tracer self-calibration, scale bias).

Splitter cameras

One sensor with four views (an image splitter):

  • Main parameters → General: tick Split images into 4? and set the view order (top-left, top-right, bottom-left, bottom-right). Only the image names of camera 1 are used.
  • Calibration parameters: tick Split calibration image into 4? (also in the calibration window). Calibration uses the same view order.
  • Both dialogs say so when the two switches disagree. That is right only if one side already has a separate image per view.
  • Detection and correspondence stay Standard. Try it on test_data/test_splitter.

Regenerating this page's pictures and the reference

uv run python scripts/gui_screenshots.py   # docs/images/gui/*.png, off-screen
uv run python scripts/gui_reference.py     # docs/gui-parameter-reference.md