displayarray.display

Display any array, webcam, or video file.

display is a function that displays these in their own windows.

display(*vids, callbacks: Union[Dict[Any, Union[Callable[[numpy.ndarray], Optional[numpy.ndarray]], List[Callable[[numpy.ndarray], Optional[numpy.ndarray]]]]], List[Callable[[numpy.ndarray], Optional[numpy.ndarray]]], Callable[[numpy.ndarray], Optional[numpy.ndarray]], None] = None, window_names=None, blocking=False, fps_limit=inf, size=(-1, -1), silent=False)[source]

Display all the arrays, cameras, and videos passed in.

callbacks can be a dictionary linking functions to videos, or a list of function or functions operating on the video

data before displaying.

Window names end up becoming the title of the windows

breakpoint_display(*args, **kwargs)[source]

Display all the arrays, cameras, and videos passed in. Stops code execution until the window is closed.

read_updates(*args, **kwargs)[source]

Read back all frame updates and yield a list of frames. List is empty if no frames were read.

Windows

class SubscriberWindows(window_names: Iterable[str] = ('displayarray',), video_sources: Iterable[Union[str, int]] = (0,), callbacks: Optional[List[Callable[[numpy.ndarray], Any]]] = None, silent: bool = False)[source]

Windows that subscribe to updates to cameras, videos, and arrays.

add_callback(callback)[source]

Add a callback for this class to apply to videos.

add_source(name)[source]

Add another source for this class to display.

add_window(name)[source]

Add another window for this class to display sources with. The name will be the title.

block()[source]

Update the window continuously while blocking the outer program.

end()[source]

Close all threads. Should be used with non-blocking mode.

handle_keys(key_input: int)[source]

Capture key input for the escape function and passing to key control subscriber threads.

handle_mouse(event, x, y, flags, param)[source]

Capture mouse input for mouse control subscriber threads.

loop()[source]

Continually update window frame. OpenCV only allows this in the main thread.

update(arr: numpy.ndarray = None, id: str = None)[source]

Update window frames once. Optionally add a new input and input id.

update_frames()[source]

Update the windows with the newest data for all frames.

wait_for_init()[source]

Update window frames in a loop until they’re actually updated. Useful for waiting for cameras to init.