exponential_foreground — VIDEOSTREAM recursive op

• Data kinds: video → video

• Call: import fullseye as fs; fs.ledger.exponential_foreground(video, alpha: 'float' = 0.05, threshold: 'float' = 0.1) -> 'np.ndarray' (to call the implementation directly, import videostream; videostream.exponential_foreground(video, alpha: 'float' = 0.05, threshold: 'float' = 0.1) -> 'np.ndarray'; from the registry, opsvideostream.get("exponential_foreground"))

Usage

Foreground masks |frame − exponential background| > threshold → 0/1 (T, H, W) (video).

Runs the same exponential moving average bg += α (frame - bg) as exponential_background, and in each frame sets to 1 the difference from the updated bg, |frame - bg| > threshold. The first frame is used to initialise bg and its difference is 0, so t = 0 is all pixels 0.

• video: a (T, H, W) array or a list of 2-D frames. Integer dtypes are normalised to [0, 1] by their maximum, float is clipped. NaN/Inf gives ValueError.

• alpha: [0, 1]. The larger it is, the faster the background follows, and a stopped object disappears in about 1/α frames. With 1, bg == frame, so all pixels are always 0.

• threshold: in intensity units of [0, 1]. It is an absolute threshold common to all pixels, so noise in dark regions and noise in bright regions are cut by the same threshold.

• Returns: (T, H, W) float64 of 0 / 1.

• Failure: ValueError.

To set the threshold from per-pixel variance, running_gaussian_foreground. For motion detection without ghosts, three_frame_difference.

Detailed usage guide

• video_streaming family guide

Background guides (the physics and conventions behind this op)

• mv_cables — Cables (standards, speed, power delivery, robot cables)

• mv_frame_grabbers — Frame grabber boards (not optics, but they decide whether you can capture at all)

• mv_standards — Camera interface standards and the bodies behind them

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.

Runnable examples (verified samples that actually call this op)

• video_streaming — py -3.11 examples/video_streaming.py

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

temporal_median_window · moving_average_window · background_subtraction_window · frame_difference_causal · exponential_background · running_mean_std · optical_flow_magnitude_stream · motion_history_image

Same category (recursive)

frame_difference_causal · exponential_background · running_mean_std


*Provenance: videostream.py — VIDEOSTREAM 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.