Code covered by the BSD License  

Highlights from
imstream

  • imseq IMSEQ Open an image sequence as if it were a video stream.
  • imstream IMSTREAM Open an image or video stream for reading a frame at a time
  • View all files
Be the first to rate this file! 15 Downloads (last 30 days) File Size: 4.66 KB File ID: #33119

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 (2011b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
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.

Tag Activity for this File
Tag Applied By Date/Time
image Oliver Woodford 04 Oct 2011 15:46:50
video Oliver Woodford 04 Oct 2011 15:46:50
stream Oliver Woodford 04 Oct 2011 15:46:50
wrapper Oliver Woodford 04 Oct 2011 15:46:50
image processing Oliver Woodford 04 Oct 2011 15:46:50
frames Oliver Woodford 04 Oct 2011 15:46:50
data import Oliver Woodford 04 Oct 2011 15:46:50
image sequence Oliver Woodford 04 Oct 2011 15:46:50
oop per isakson 05 Oct 2011 11:56:11

Contact us at files@mathworks.com