Stores a limited number of images from a video (or any other source)
Makes it easy to do N-frame-differencing, for example, by easily being
able to get the current (middle) frame, plus the first and last frames of
the buffer. With an ImageBuffer of size N, as images are added,
eventually the buffer fills, and older items are dropped off the end.
This is convenient for streaming input sources, as the user can simply
keep adding images to this buffer, and internally, the most recent N will
be kept available.
|
|
|
|
|
__len__(self)
This is a fixed-sized ring buffer, so length is always the number of
images that can be stored in the buffer (as initialized with Nframes) |
source code
|
|
|
|
|
|
|
getCount(self)
Note that getCount() differs from __len__() in that this method
returns the number of image actually stored in the ImageBuffer, while
__len__() returns the size of the buffer, defined as the number of
images the buffer is allowed to store. |
source code
|
|
|
|
|
|
|
|
|
|
|
add(self,
image)
add an image to the buffer, will kick out the oldest of the buffer is
full |
source code
|
|
|
fillBuffer(self,
v)
If buffer is empty, you can use this function to spool off the first
N frames of a video or list of images to initialize/fill the buffer. |
source code
|
|
|
asStackBW(self,
size=None)
Outputs an image buffer as a 3D numpy array ("stack") of
grayscale images. |
source code
|
|
|
asMontage(self,
layout,
tile_size=None,
**kwargs) |
source code
|
|
|
|