User manual
Small Vision System User Manual 56
5.6 Host display functions
These functions display images from the Stereo Engine in their proper format. As of SVS Version
2.0, display functions are derived from the FLTK cross-platform windowing system. All of the FLTK
functionality is available in SVS, upon loading the FLTK shared library (libfltk.so or
fltkdll.dll). Documentation on FLTK is available at www.fltk.org.
class svsWindow : public Fl_Window
Window class for display of input images or stereo results. Because svsWindow is a subclass
of Fl_Window, any FLTK drawing function can be used on it. To superimpose graphics on
the window, you would subclass the svsWindow, and define a new draw() member function
that first called svsWindow::draw(), then your own drawing functions.
svsWindow::svsWindow(int x, int y, int h, int w)
Defines a new window for display. X and y are the coordinates or the upper left-hand corner
of the window (relative to its parent window), and h and w are the height and width of the
window.
void svsWindow::DrawImage(unsigned char *im, svsSP *sp,
int type = svsNONE)
Draws the image pointed to by im into the window. The parameter set sp defines the
structure of the image. The draw function will fit the image into the window by decimation
by powers of 2 in both vertical and horizontal dimensions, independently. The type
svsNONE signals a standard 8-bit grayscale image; the type svsSTEREO is for disparity
images. Since disparity images are short ints, they must be cast to unsigned char.
double sp.gamma
The photosites in most cameras have a linear response to light, so the pixel value is a
linear function of the amount of light the photosite receives. However, a monitor
displaying this value normally has a nonlinear output, so that darker values are
perceived as too dark. Most cameras compensate by applying a nonlinear function,
γ
x ,
which boosts the low-light values of the video stream so they display properly. But some
cameras, in particular the MEGA-D, return the uncompensated linear signal. To
display the video stream from these cameras, the DrawImage function can apply a
gamma correction. The value of gamma in the sp parameter structure transforms the
linear pixel values to their gamma-corrected values for drawing. A value of 0.0 or 1.0
means no gamma correction; values between 0.0 and 1.0 apply the corresponding
correction. The standard correction is 0.45.
void ClearImage()
Clears any image in the window and replaces it with black.










