imstream
by Oliver Woodford
04 Oct 2011
(Updated 12 Mar 2012)
A wrapper which abstracts videos and image file sequences, so they can be treated the same.
|
Watch this File
|
| File Information |
| Description |
If you work with streams of images which can come from either a video or a sequence of image files, then you can use this wrapper so that your code doesn't care which type of stream you are using. The syntax is similar to MATLAB's VideoReader class, with a few minor differences:
- The read method can only read in a frame at a time.
- Subscript referencing can also be used to access frames.
- The last N frames used can be cached, to improve access speeds for certain applications. N is defined by the user (default: 1).
Here is an example which processes 3 frames at a time:
ims = imstream('input.000.png', 3); % Cache last 3 frames used
n = get(ims, 'NumberOfFrames');
for a = 2:n-1
A = cat(4, ims(a-1), ims(a), ims(a+1));
% Process the frame triplet
end |
| Required Products |
MATLAB
|
| MATLAB release |
MATLAB 7.13 (R2011b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 05 Oct 2011 |
Superficial improvements |
| 28 Nov 2011 |
Bug fix to VideoIO toolbox compatible interface. |
| 12 Mar 2012 |
Remove dependency on fullpath.m, which wasn't included. |
|
Contact us