User manual
Small Vision System User Manual 18
2.2 Storing, Saving, and Loading Stereo Data
smallv provides a basic facility for loading and saving stereo data streams. The file load and store
functions are part of the SVS library, and their source code is included. smallv exercises these
functions, and provides a memory buffer for storing live stereo video. In smallv, the buffer always holds
the left and right input stereo images.
2.2.1 Stereo Stream Storage
smallv has an internal buffer capable of holding 30 stereo pairs (frames) at a 640x480 frame size.
The buffer will hold more frames at smaller sizes, fewer frames at larger sizes. The buffer can be filled
from a previously-saved file, or from live video input. The buffer can also be written out to a file, and
used as the source for stereo processing in smallv. The current frame is indicated in input information
area.
When the input source is the buffer, the acquisition mode controls (Continuous, Single,
Freeze) control the processing of the buffer frames (Section 2.1.8). The frame control can also be used
to go to an individual frame when in Single acquisition mode.
The Record button controls the input of live video into the buffer. Clear clears the buffer and
resets it to frame 0. Activating the Record button starts the input of live video frames into the buffer.
The source must be set to Video; either Continuous or Single mode may be used. Frames are
stored sequentially until the buffer is full. Pressing Record again will also turn off acquisition..
As an example, to capture a short video sequence and replay it, perform the following steps.
1. Start acquiring live video in continuous mode.
2. Clear the buffer (Clear button).
3. Start buffer storage (Record button).
4. After a short period, stop buffer storage (Record button).
5. Change from Video to Buffer source.
At this point, the short segment that is in the buffer will be replayed as a short continuous loop. The
buffer, or individual images, can be saved to a file.
The buffer does not save color information, although in future versions of SVS we plan to add this
capability.
2.2.2 Loading and Storing Files
The SVS libraries work with two different file types for image storage.
• BMP format. Each BMP file contains a single 8-bit grayscale image, or an RGB 24-bit color
image. The color coding for the 8-bit BMP file is 256 shades of gray, with 0 being black and
255 white. By convention, a stereo pair is saved as two files with the linked names XXX-
L.BMP (left image) and XXX-R.BMP (right image). The corresponding color file is saved as
XXX-C.BMP. Stereo disparity information is saved as an 8-bit BMP file XXX-S.BMP.
• SSI format. This is an internal SRI format for storing image sequences. An arbitrary number
of stereo pairs are saved in a single file, with header information describing the image size and
number of images. Images are 8-bit grayscale; there is no color information.
Images and image sequences are loaded into and stored from the buffer using the File menu. To
load stereo frames, use the Load menu item to bring up a file choice dialog. You may pick either SSI or
BMP files to load. Choosing either BMP file of a pair automatically loads the other. In addition, if a
color file is present, it is also loaded.
To save the buffer to a file, use the Store Buffer menu item. This saves the buffer as an SSI file.
Alternatively, to save the current frame as two BMP files, use the Store Current menu item. If stereo
processing is active, then the stereo disparity image is saved also as a BMP file; this is the only method to
save a disparity image from the Smallv application. Color information, if present, is saved as a 24-bit
BMP file.










