displayarray

Display any array, webcam, or video file.

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

Display

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=240, size=(-1, -1))[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.

Frames

read_updates(*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, fps_limit=inf, size=(-1, -1), end_callback: Callable[[], bool] = <function <lambda>>, blocking=True)[source]

Read back all updates from the requested videos.

Example usage: >>> from examples.videos import test_video >>> f = 0 >>> for f, r in enumerate(read_updates(test_video, end_callback=lambda :f==2)): … print(f”Frame:{f}. Array:{r}”)

Effects

class Crop(output_size=(64, 64, 3), center=None)[source]

A callback class that will return the input array cropped to the output size. N-dimensional.

property center

Get the center.

enable_mouse_control()[source]

Move the mouse to move where the crop is from on the original image.

property output_size

Get the output size.

class Barrel(use_bleed=False, barrel_power=1, pincushion_power=1, zoom=1, center=None)[source]

A barrel lens distortion callback.

property barrel_power

Guarded barrel power. Avoids divide by zero conditions.

property center

Guarded get center. Limits to within input.

enable_mouse_control(crop_size=None)[source]

Enable the default mouse controls.

Move the mouse to center the image scroll to increase/decrease barrel ctrl+scroll to increase/decrease zoom

property zoom

Guarded zoom. Avoids divide by zero conditions.

class SelectChannels(selected_channels: Iterable[int] = None)[source]

Select channels to display from an array with too many colors.

Parameters

selected_channels – the list of channels to display.

enable_mouse_control()[source]

Enable mouse control.

Alt+Scroll to increase/decrease channel 2. Shift+Scroll to increase/decrease channel 1. Ctrl+scroll to increase/decrease channel 0.