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
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.
-
property
-
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.
-
property