Download SRI Small Vision System

Transcript
Small Vision System User Manual
6.7
74
File and Memory Acquisition
The file and memory acquisition classes are subclasses of svsAcquireImages. This classes are
used to input stereo images from files, or from arrays in memory, and present them for processing. Users
who have their own stereo devices, and acquire images into memory, can use these classes to perform
stereo processing with the SVS libraries.
While images are not streamed from files in the same way as from a video source, the function calls
are similar. After opening the file, the GetImage() function is called to retrieve the stored image. A
single image file set is repeatedly opened and read in by successive calls to GetImage().
A file sequence consists of file sets whose basenames end in a 3-digit number. Opening a file set that
is part of a sequence causes the rest of the sequence to be loaded on successive calls to GetImage().
6.7.1
File Image Object
svsFileImages()
~svsFileImages()
Constructor and destructor for the file acquisition object.
6.7.2
Getting Images from Files
bool Open(char *basename)
svsStereoImage *GetImage(int ms)
bool Close()
The Open() function opens a file set and reads it into the object; see Section 2.2.2 for information
about file sets. The file set can include calibration parameters that describe the rectification of the images.
The image is automatically read in on the call to open; it isn’t necessary to call GetImage(). To reread the file images, or to read the next image in a sequence, call GetImage().
The file is closed with the Close() function.
6.7.3
Stored Image Object
svsStoredImages()
~svsStoredImages()
Constructor and destructor for the file acquisition object.
6.7.4
Setting Images from Memory
bool Load(int width, int height,
unsigned char *lim, unsigned char *rim,
unsigned char *cim = NULL, unsigned char *cimr = NULL,
bool rect = false, bool copy = false);
The Load() function sets images from memory into the acquisition object, after which they can be
read out (and optionally rectified) using GetImage(). The left and right monochrome images must be
loaded; the color images are optional. If the images are already rectified, set rect to true.
Normally, user images are passed into the acquisition object as pointers; GetImage() will output
these pointers unless rectification is performed. If rectification is performed, then the object manages and
outputs its own buffers, which the user should not delete.
User images can also be copied into the object’s buffers, if copy is set to true. Here, the object
manages all buffers, and the user program should not destroy them.