User manual

Table Of Contents
Small Vision System User Manual 66
5.9 Window Drawing Classes
svsWindow
Window class for drawing 2D images
svsDebugWin
Window class for printing output
The window drawing classes output 2D stereo imagery to the display. The display window relies on
the FLTK cross-platform windowing system (
www.fltk.org), and provides basic graphical object drawing
in addition to image display. The
svsDebugWin class is for text output, useful when debugging
programs.
It is also possible to output 3D information, especially point clouds formed from the 3D stereo
reconstruction functions. This display relies on the OpenGL window capabilities of FLTK. For more
information, see the example code in
samples/svsglwin.cpp.
5.9.1 Class svsWindow
This class outputs 2D images to a display window. It can output monochrome, color, and false-color
disparity images. In addition, there is an overlay facility for drawing graphical objects superimposed on
the image.
svsWindow objects will downsize the displayed images to fit within their borders, using factors of 2.
For example, a 640x480 image displayed in a 320x200 window will be decimated horizontally by 2 (to 320
columns), and vertically by 4 (to 120 rows). Images smaller than the display window are not upsampled;
they are simply displayed in their normal size in the upper-left corner of the window.
Graphical overlays for the window can be drawn using FLTK drawing functions on the window, e.g.,
lines, circles, etc.
svsWindow subclasses the FLTK Fl_Window class.
svsWindow(int x, int y, int w, int h)
~svsWindow()
Constructor and destructor. The constructor creates a new svsWindow object, displayed at position
x,y of any enclosing FLTK object, and with width w and height h. Typically w and h are multiples of
160x120.
The window will not be visible until
show() is called on it.
DrawImage(svsStereoImage *si, int which = svsLEFT,
void *ovArg = NULL);
ClearImage()
Main drawing function. Draws a component of the stereo image object si. The argument which
specifies which component is drawn, according to the following table.
svsLEFT, svsRIGHT
Left and right monochrome images
svsLEFTCOLOR, svsRIGHTCOLOR
Left and right color images
svsDISPARITY
Disparity image (displays in green false color)
The optional last argument is passed to any assigned overlay drawing function (see
svsDrawOverlay below).
To clear an image from the window, and reset it to black, use
ClearImage().
virtual DrawOverlay(svsImageParams *ip, void *ovArg);
DrawOverlayFn(void (*fn)(svsWindow *, svsImageParams *, void *ovArg))