User manual

Small Vision System User Manual 22
buffer, or individual images, can be saved to a file. Under the File menu, use the commands Store
Video Buffer and Load Video Buffer. A video sequence is stored as a set of BMP files (next
subsection), in a sequence starting at 001. You cannot save stereo disparity or 3D data directly from the
video buffer. However, the current frame disparity and 3D data can be saved using the still image storage
facility, described in the next subsection.
2.2.2 Loading and Storing Files
The SVS libraries work with 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 left color image is
saved as XXX-C.BMP, and the right color image as XXX-Q.BMP. Finally, the image
parameters are stored as a text file XXX.INI.
?? Text files for disparity images. Disparity images can be saved as a text file, with one line of
text for each line of the image (e.g., a 320x240 image will have 240 lines). Each line
contains an image row of disparities, as integers. The special values 1 and 2 indicate that
the disparities were filtered out, by the texture measure (-1) or the left/right check (-2)..
?? Text files for 3D points. 3D point arrays, generated from a disparity image (Section 2.4.2),
can be saved as a text file. Each line of the file represents one point of the array. The array
has the same format as the image from which it was produced, e.g., if the input image is
320x240, then the file has 320x240 lines, in row-primary order. Each line has 3D X,Y,Z
coordinates first, as floating-point numbers, then three integers for the R,G,B values of the
pixel at that point. If the disparity at a pixel is filtered out, then the Z value is negative,
indicating a filtered value.
Still images and still image sequences are loaded using the File menu. To load stereo frames, use
the Load Images (BMP) menu item to bring up a file choice dialog. Choosing either BMP file of a
pair automatically loads the other. In addition, if a color file or parameter file (.ini) is present, it is also
loaded.
A file image sequence is a set of files with a base name XXXNNN. For example, CAL001-L.BMP is
the left image of a stereo pair in a sequence. The sequence can start with any number, but the number
must be 3 digits, and must increment sequentially for each stereo pair in the sequence. Choosing Single
from the smallv interface will load the next file in the sequence. Freeze reloads the same file
continuously, which is useful for changing stereo parameters in smallv and seeing their effects.
Continuous mode is not available when loading a sequence of still images.
Note that loading a still image file using the Load Images menu item does not load the images into
the video buffer. The only way to load images into the video buffer is with the Load Video Buffer
menu item.
To save the current stereo image to a file, use the Store Current (BMP) menu item. Color
information, if present, is saved as a 24-bit BMP file. A sequence of still images can be created by using
the correct format for the base name of the stored files, as described above.
If stereo processing is turned on and a disparity image has been produced, then it can be saved as an
8-bit BMP file (Store Disparity Image (BMP)), or as a text file (Store Disparity Image
(Text)). Since the number of bits in the disparity pixels is generally greater than 8, the BMP file only
contains the high-order bit information. The text file contains the full value for the disparity.
3D information (X,Y,Z values) can be saved to a file, if stereo processing is selected. Use the Store
3D Point Array menu item.