exponential_foreground — VIDEOSTREAM recursive op

• 数据种类:video → video

• 调用: import fullseye as fs; fs.ledger.exponential_foreground(video, alpha: 'float' = 0.05, threshold: 'float' = 0.1) -> 'np.ndarray'(要直接调用实现,import videostream; videostream.exponential_foreground(video, alpha: 'float' = 0.05, threshold: 'float' = 0.1) -> 'np.ndarray';从台账取用则 opsvideostream.get("exponential_foreground"))

用法

前景掩码 |frame − 指数背景| > threshold → 0/1 (T, H, W)(video)。

运行与 exponential_background 相同的指数移动平均 bg += α (frame - bg), 在每一帧把与更新后的 bg 之差 |frame - bg| > threshold 置为 1。第一帧用于初始化 bg,差为 0,因此 t = 0 全部像素为 0。

• video: (T, H, W) 数组或 2-D 帧的 list。整数 dtype 按最大值归一化到 [0, 1],float 做裁剪。NaN/Inf 抛出 ValueError。

• alpha: [0, 1]。越大背景跟随越快,停下的物体约 1/α 帧后消失。为 1 时 bg == frame,始终全部像素为 0。

• threshold: [0, 1] 的强度单位。是全像素共用的绝对阈值,因此暗部的噪声与亮部的噪声用同一阈值切分。

• 返回值: (T, H, W) float64 的 0 / 1。

• 失败: ValueError。

若想按逐像素方差确定阈值,用 running_gaussian_foreground。若要无鬼影的运动检测,用 three_frame_difference。

详细使用指南

• video_streaming 族使用指南

背景知识指南(该算子背后的物理与约定)

• mv_cables — 线缆(规格、速度、供电、机器人线缆)

• mv_frame_grabbers — 图像采集卡(不属于光学系统,却决定能否采到图像)

• mv_standards — 相机接口规格与标准组织

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

• 算法的正典(作者、年份)与用途见上面的族使用指南。

可运行的示例(实际调用该算子并已验证的样例)

• video_streaming — py -3.11 examples/video_streaming.py

类型可衔接的下一个算子(可接受 video 作为输入)

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

同类别(recursive)

frame_difference_causal · exponential_background · running_mean_std


*Provenance: videostream.py — VIDEOSTREAM 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

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