pytweezer.analysis.image_stats module

Compute summary statistics of each image and publish them.

Input:

One image stream.

Output:

A data message (no array) carrying mean, std, stderr, min, max, sum and the pixel count n, published on <name> (the Data hub). Intended for the image viewer’s data sidebar.

Properties:
  • imagestreams: ([str]) input image streams.

stderr is the standard error of the mean, std / sqrt(n). Statistics are computed in float64 so integer camera frames do not overflow or lose precision.

class pytweezer.analysis.image_stats.ImageStats(name)[source]

Bases: ImageAnalysis

process(head, data)[source]

Transform one received message.

Parameters:
  • head – the message header dict.

  • data – the payload (numpy array for images/data).

Returns:

(head, data) to republish, or None to drop the message. The default is a pass-through.