Multiframe image files in VisionX consisted of a set of
"frames" which are delimited by begin frame
(VX_FRAME) and end frame (VX_EFRAME) elements and contain at
least one image (see VXmakeimage(3)). An image consists of
two consecutive data elements, a bounding box followed by a
conforming pixel data element. VXsbufimage and
VXrbufimage manage a set of n consecutive
image frames in memory.
Spatiotemporal and other filtering operations often
require that a number of image frames be accessible a the
same time. VXsbufimage creates a buffer of n image
structures (where n is a program specified constant) an
reads the first (n-1) frames from the specified file. Note,
each frame must contain at least one image. The image
structure is initialized for the first image found in the
frame (and the whole frame list is available as the .list
element of the image structure). VXsbufimage returns a
pointer to the image structure buffer that it creates.
VXrbufimage deletes the oldest frame in the image
buffer, moves all remaining images to one later in the
buffer and then reads the next image frame into the vacated
first element of the image buffer. If VXrbufimage is unable
to read another image frame it returns zero, otherwise it
returns 1.
The usage of VXsbufimage and VXrbufimage are best
illustrated by an example. Consider that we wish to perform
an operation on a sequence of images that is a function of n
consecutive image frames. This may be realized by the
following program structure:
VisXimage_t *iset;
VisXfile_t *ifile, ofile;
int n;
ifile = VXopen(<name>, 0); /* open input file */
ofile = VXopen(<name1>, 1); /* open output file */
|