ImageCollection.disp#

ImageCollection.disp(animate: bool = False, fps: float | None = None, title: str | None = None, loop: bool = False, **kwargs) None#

Display images from the source interactively.

Parameters:
  • animate (bool, optional) – if True, play as timed animation; if False (default), step through one frame at a time

  • fps (float, optional) – playback rate in frames per second, used when animate=True, defaults to None. If not None animate mode is assumed.

  • title (str or None, optional) – window title; defaults to the topic attribute of each frame when present

  • loop (bool, optional) – restart when the source is exhausted (finite sources only), defaults to False

  • kwargs – additional keyword arguments passed to Image.disp for each frame, e.g. grid=True

Display images from the source. For example:

VideoFile("traffic_sequence.mpg").disp(fps=10)

will display an animation of the video at 10 frames per second.

By default, the display is

Keys — step-through mode (animate=False):

  • [space] — next frame

  • [1-9] / [0] — jump 1–9 or 10 frames (finite sources only)

  • [l] / [c] / [d] — jump 50 / 100 / 500 frames (finite sources only)

  • [q] / [x] — quit

Keys — animate mode (animate=True):

  • [space] — pause / resume

  • [+] / [=] — increase playback speed

  • [-] / [_] — decrease playback speed

  • [q] / [x] — quit

Note

Jump keys and loop are only available for finite sources that implement __len__. For live streams such as VideoCamera or RosTopic those controls are disabled automatically.

Seealso:

ImageSequence