Package pyvision :: Package analysis :: Module Montage :: Class VideoMontage
[hide private]
[frames] | no frames]

Class VideoMontage

source code

                object --+        
                         |        
types.Video.VideoInterface --+    
                             |    
             types.Video.Video --+
                                 |
                                VideoMontage

Provides a visualization of several videos playing back in a single window. This can be very handy, for example, to show tracking results of multiple objects from a single video, or for minimizing screen real-estate when showing multiple video sources.

A video montage object is an iterator, so you "play" the montage by iterating through all the frames, just as with a standard video object.

Instance Methods [hide private]
 
__init__(self, videoDict, layout=(2, 4), tile_size=(64, 48))
The basic video class that is used to play back a movie file.
source code
 
__iter__(self)
Return an iterator for this video
source code
 
next(self)
The next method calls self.query(), so it is common to most video sources and may not need to be overridden.
source code

Inherited from types.Video.Video: __len__, query, setFrame

Inherited from types.Video.VideoInterface: grab, play, resize

Inherited from types.Video.VideoInterface (private): _pauseAndPlay

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, videoDict, layout=(2, 4), tile_size=(64, 48))
(Constructor)

source code 

The basic video class that is used to play back a movie file.

Parameters:
  • videoDict - A dictionary of videos to display in the montage. The keys are the video labels, and the values are objects adhering to the pyvision video interface. (pv.Video, pv.VideoFromImages, etc.)
  • layout - A tuple of (rows,cols) to indicate the layout of the montage. Videos will be separated by a one-pixel gutter. Videos will be drawn to the montage such that a row is filled up prior to moving to the next. The videos are drawn to the montage in the sorted order of the video keys in the dictionary.
  • tile_size - The window size to display each video in the montage. If the video frame sizes are larger than this size, it will be cropped. If you wish to resize, use the size option in the pv.Video class to have the output size of the video resized appropriately.
Overrides: object.__init__

__iter__(self)

source code 

Return an iterator for this video

Overrides: types.Video.VideoInterface.__iter__

next(self)

source code 

The next method calls self.query(), so it is common to most video sources and may not need to be overridden.

Returns:
The next frame in the sequence, or raise StopIteration if done.
Overrides: types.Video.VideoInterface.next
(inherited documentation)