frame_mean#

Reference FrameProcessor that emits per-frame mean intensity.

class mesofield.processors.frame_mean.FrameMean[source]#

Bases: FrameProcessor

compute(img, idx, ts)[source]#

Subclass hook: return one scalar (or None) per frame.

Called on every frame the attached camera emits. Implementations should be fast — anything heavy will starve the camera buffer. Return None to skip emitting a sample for this frame.

Parameters:
  • img (Any) – Frame from the camera (typically a 2-D ndarray).

  • idx (Any) – Frame index assigned by the camera (monotonic).

  • ts (Any) – Device timestamp for the frame.

Returns:

A single float to be pushed to the data queue / plot, or None to skip this frame.

Return type:

float | None