morphology op• Data kinds: image → image
• Call: fullseye.apply(img, "runlength_smear", 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):
▸ runlength_smear: knob a sweep (docs site)
Sweeping knob b (0.1 / 0.5 / 0.9, the other knob at its default):
▸ runlength_smear: knob b sweep (docs site)
On other images (synthetic scene / photo / coins. Top row: inputs, bottom row: their outputs. Knobs at default):
▸ runlength_smear: 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).*
Run-length smoothing (RLSA). Fills the gaps between characters within a line and merges the characters into "line" blocks.
A basic building block of page layout analysis (which parts are lines, which are columns). a sweeps the length of the gaps to fill over 3,5,9,15,25,41,65 pixels (a line along the direction given by b), and b selects the direction and the
combination: b <= 0.5 is horizontal only, 0.5 < b <= 0.75 is vertical only, b > 0.75 is the smaller of horizontal and vertical (= the 2-pass AND combination of classic RLSA. Only places filled in both directions remain, so not just lines but column blocks emerge).
★Partly overlaps the existing gclose. gclose can select a horizontal-line structuring element via b, so horizontal RLSA can be written with it in principle. What this op adds is 2 things ——
(1) the gap can be swept up to 65 pixels rather than 3–9 (at the upper limit of _k lines do not join up;
the spacing between characters is 10–30 pixels for 96 px glyphs), (2) the AND combination of 2 directions cannot be written as a closing with a single structuring element. For one direction only, gclose is faster.
It applies directly to greyscale images (no internal binarisation). Since it is a grey-level closing, it works in the direction of filling dark gaps —— use it on images with bright characters on a dark background. For the reverse, pass the image through invert first. Border handling is scipy.ndimage's default reflect. An empty frame (constant image) is returned unchanged (there are no gaps to fill). The value range stays as in the input, within [0,1], and there is no per-image normalisation (values are comparable across images).
• gallery2d_morphology 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.
runlength_smear 0.35 0.50
▸ Load this pipeline · Load & run
• gallery2d_morphology — py -3.11 examples/gallery2d_morphology.py
image as input)identity · gaussian · mean_box · bilateral · unsharp · median · min_filter · max_filter
morphology)gerode · gdilate · gopen · gclose · tophat · bothat · morph_grad · persistence_map
*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.