Learn R Programming

Rvision (version 0.6.0)

Queue-class: An S4 Class Containing a Queue of Images

Description

A Queue object contains a self-filling, asynchronous queue of images retrieved from a Video or Stream object. Retrieving an image from a video or camera stream is generally fast but it still comes with a time penalty that can become significant when processing large numbers of images and/or videos. A Queue object can help save some of that lost time by reading and storing images from a video or stream in parallel of the main R thread, for instance while other operations are being performed by R on previously read images. These pre-loaded frames are, therefore, immediately available when needed, effectively eliminating the wait time between two frame reads (as long as the queue reads and stores new frames faster than R can process them).

Usage

Queue

Arguments

Format

An object of class C++Class of length 1.

Slots

dim,ncol,nrow

Functions returning the dimensions of the frames in the queue.

length

Function returning the number of frames in the queue.

capacity

Function returning the maximum number of frames that the queue can hold at any one time.

frame

Function returning the index of the frame to be read next.

full,empty

Function returning the state of the queue (full or empty or neither).

readNext

Function to access the next frame in the queue.

reset

Function to empty the queue and start collecting new frames.