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

*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.*
Sweeping knob a (0.1 / 0.5 / 0.9, the other knob at its default):
▸ f2_shock_diffuse: knob a sweep (docs site)
Sweeping knob b (0.1 / 0.5 / 0.9, the other knob at its default):
▸ f2_shock_diffuse: knob b sweep (docs site)
On other images (synthetic scene / photo / coins. Top row: inputs, bottom row: their outputs. Knobs at default):
▸ f2_shock_diffuse: 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).*
Regularised shock filter: diffuse, then shock, repeated (Alvarez-Mazorra).
`f2_shock` is the pure Osher-Rudin shock — *contraction only*. It takes the
sign of the Laplacian of the raw image, so every noise bump is a zero crossing
and becomes its own shock: on a blurred edge with sigma 0.02 noise it raises
the flat-area noise from 0.020 to 0.050 (2.5x) and pushes the edge step to
0.539 — past the true step of 0.500, which is the noise being promoted to
structure rather than the edge being recovered.
The remedy is to alternate the two flows: expand (a Gaussian diffusion)
and contract (the shock), taking both the sign *and* the dilation/erosion
from the smoothed copy, so the contraction can only act on structure the
diffusion left standing.
`a sets the number of diffuse/shock pairs (1..10); b` sets the diffusion
width sigma (0.4..2.0) and is the trade-off knob. Measured on that same
blurred noisy edge (input: step 0.112, flat noise 0.0201):
b = 0.00 (sigma 0.40) step 0.407 noise 0.0245 (x1.2)
b = 0.10 (sigma 0.56) step 0.272 noise 0.0091 (x0.45 - noise falls)
b = 0.25 (sigma 0.80) step 0.218 noise 0.0054
b = 0.50 (sigma 1.20) step 0.187 noise 0.0032
b = 1.00 (sigma 2.00) step 0.099 noise 0.0016
So `b` near 0 keeps most of the sharpening with almost none of the noise
amplification; from `b` about 0.1 upward the filter removes noise while
still more than doubling the input's edge step.
Applicability. (1) It sharpens what is already there — it cannot recover
detail the blur destroyed, and the step never reaches the true 0.500 here.
(2) Every iteration is a morphological max/min, so thin bright lines thicken
and thin dark lines are eaten; count the iterations you can afford.
(3) With `b` large the diffusion dominates and the result approaches a plain
Gaussian blur — check that the step is still above the input's.
• gallery2d_edges family guide
• 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.
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.
f2_shock_diffuse 0.40 0.50
▸ Load this pipeline · Load & run
• gallery2d_edges — py -3.11 examples/gallery2d_edges.py
image as input)identity · gaussian · mean_box · bilateral · unsharp · median · min_filter · max_filter
edges)sobel_mag · prewitt_mag · roberts_mag · dog · edge_transition_width · grad_dir · log · corner_response
*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.