ph_total_variation_flow — 2D physics op

• Data kinds: image → image

• Call: fullseye.apply(img, "ph_total_variation_flow", a=0.5, b=0.5) (the 2-D model is one image plus two scalar knobs a,b∈[0,1])

• GPU: yes (mechanical GPU path from the allow-list, CuPy). device="auto" chooses the GPU from the measured size (4,194,304 pixels) up

ph_total_variation_flow: input → output

*The figure is the actual output on a synthetic 128×128 input. Left: input, right: output. Point clouds are drawn as a top-down scatter (brightness = z), 1-D series as a line plot, volumes as the maximum-intensity projection along z, videos as the middle frame, complex images as magnitude; return values that are not pictures are shown as the values themselves.*

*The output is shown in a viridis-like pseudo-colour (dark purple = low, yellow = high) so that a field of quantities — distance, phase, orientation, depth — can be read.*

Sweeping knob a (0.1 / 0.5 / 0.9, the other knob at its default):

▸ ph_total_variation_flow: knob a sweep (docs site)

Sweeping knob b (0.1 / 0.5 / 0.9, the other knob at its default):

▸ ph_total_variation_flow: knob b sweep (docs site)

On other images (synthetic scene / photo / coins. Top row: inputs, bottom row: their outputs. Knobs at default):

▸ ph_total_variation_flow: other inputs (docs site)

*The 4th column is a colour (H,W,3) input. This op handles colour without crossing channels (it does not convolve the colour channel as a third spatial axis).*

Usage

Total-variation (Rudin-Osher-Fatemi) denoising flow (no HALCON operator, "").

Gradient descent of the ROF energy TV(I) + (lam/2)||I - I0||^2:

I_t = div(grad I / |grad I|) - lam (I - I0).

The TV term (curvature of the level sets) flattens noise while preserving sharp edges; the fidelity term keeps the result anchored to the noisy input I0 so it denoises rather than collapsing to a constant. a sets the step count (1..80 explicit steps of dt=0.008), b the fidelity weight lam in [10, 30] (b=0 smooths most, b=1 stays closest to the input).

The steps march towards the ROF minimiser, a fixed point: once the fidelity has had time to act (lam * steps * dt of a few units, reached by a ~ 0.5 at b=0) more steps no longer change the answer, so raising a never turns a denoiser into a blur. A flat region of perimeter P and area A loses about (P/A)/lam of its contrast at the fixed point, so small features fade more than large ones (the usual ROF bias); raise b for light noise.

Until 2026-11-05 lam was 0.02..0.22: its time constant 1/lam (4.5..50) was far longer than the whole run (80 * 0.008 = 0.64), so the fidelity did nothing, the op was a pure TV flow drifting to a constant, and the error against the clean image grew with a (noisy square, sigma 0.05: 0.019 at a=0.1, 0.067 at a=1, worse than the noisy input's 0.050; even a clean input lost 0.067).

The curvature term is the mean of the four forward/backward staggerings (forward gradient + backward divergence and its mirror, per axis), so the flow commutes with flipping the image. Until 2026-11-05 (adversarial review round 2) only the forward-gradient / backward-divergence pair was used, and flipping the input changed the result by up to 0.15.

Detailed usage guide

• gallery2d_physics_alife_3d family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Try it in Studio

The program below has been verified to run (same input as the figure). In Studio's help this block becomes buttons that load and run it on the spot.

ph_total_variation_flow 0.50 0.50

▸ Load this pipeline  ·  Load & run

Runnable examples (verified samples that actually call this op)

• find_ops_by_meaning — py -3.11 examples/find_ops_by_meaning.py

• gallery2d_physics_alife_3d — py -3.11 examples/gallery2d_physics_alife_3d.py

Ops the type connects to (they accept image as input)

identity · gaussian · mean_box · mean_box_wh · bilateral · kuwahara · unsharp · median

Same category (physics)

ph_perona_malik · ph_coherence_enhancing_diffusion · ph_reaction_diffusion · ph_heat_flow · ph_mean_curvature_motion


*Provenance: ops.py — 2D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.