Module src.streaming.io.window_writer

Module for writing to a window

Classes

class WindowWriter (name: str)

Writes output to a opencv window, contains methods for starting and stopping the stream and a method for writing an image to the window.

Args

name
The title of the window.

Static methods

def key_pressed(key: str) ‑> NoneType

Detects keypress on the open window

Args

key
The key to check if have been pressed during this frame.

Methods

def begin(self) ‑> NoneType

Opens resizeable window with given name

def end(self) ‑> NoneType

Destroys the opened window and stops writing output.

def write(self, img: numpy.ndarray) ‑> NoneType

Displays frame in window

Takes provided image and converts it from RGB to BGR before showing in window

Args

img
The image buffer as an numpy ndarray.