class CamFramePipe¶
- class scTDC.CamFramePipe(device)¶
A pipe for reading camera image frames and frame meta information synchronously. Do not instantiate this class by hand. Use Camera.add_frame_pipe, instead.
- is_active()¶
Query whether the pipe is active / open.
- Returns
True if the pipe is active.
- Return type
bool
- close()¶
Close the pipe, release memory associated with the pipe
- read(timeout_ms=500)¶
Wait until the next camera frame becomes available or timeout is reached. Return meta data and, if available, image data of the next camera frame. If image data is returned, access to it is only allowed until the next time that this read function is called. Perform a copy of the image data if you need to keep it for longer. As soon as a CamFramePipe is opened and measurements are started, the pipe allocates memory for storing the frame data until this frame data is read. Not reading the pipe frequently enough can exhaust the memory.
- Parameters
timeout_ms (int, optional) – the timeout in milliseconds, defaults to 500
- Returns
Returns a tuple (meta, image_data) where meta is a dictionary containing the frame meta data, and image_data is a numpy array. If an error occurs, returns a tuple (error_code, error_message).
- Return type
(dict, numpy.ndarray) | (int, str)