[HOME][CONTENTS][DOWNLOAD][PREV][NEXT]


IMAGE ACQUISITION

Developing an image acquisition system includes integration of third party software and hardware with the image display and management facilities of XBIT. The third party software packages are used for camera control, image grabbing as well as control of and communication with other associated electronic devices. XBIT is built upon a RAMIM image processing library, Tcl scripts, Tk widgets and Tcl/Tk tool kits. It significantly simplifies the tasks of integration. 

XBIT's image aquisition software components are platform dependent since many frame grabber boards are designed for use with various operating systems, among which Windows is the most polular one.  In addtion to the gimg as a general image type, XBIT provides a video widget DDW using Windows DirectDraw for real-time video image display.  Two types of image acquisition systems have been implemented: standard TWAIN application and customized imaging systems. XBIT's TWAIN application handles image acquisition from various TWAIN compliant consumer digital cameras and scanners, as well as TWAIN compliant image data sources. Non-standard imaging systems are customized to integrate various optical control devices such as tunable filters and motorized stages and sophisticated digital CCD cameras such as SensiCam (12bits, PCO Computer Optics GmbH), pluto12 (14bits and 4 channels, Pixel Vision, Inc) for advanced multispectral and hyperspectral imaging. 

Video Display.  Using Windows DirectDraw, XBIT provides a widget, DDW, for real-time image display.  A DDW widget is optimized for different video device configuration.  It uses RAMIM as an interface to an image data stream and is capable of displaying both index and RGB images.  Since a DDW uses DirectDraw to diectly access to the video memory, it updates the display window very efficiently.  A real-time image display system is formed when a DDW widget is connected to an image stream via either a RAMIM image of an image acquisition system or a video stream of DirectShow.  An image stream may be handled by a thread of the data source for updating display.  For example, when a DDW is connected to a DirectShow video stream, it creates a thread to handle the video stream in display.  Multiple video streams may be processed concurrently with multiple DDW widgets.  Video streams supproted by DirectShow include avi, qt, mpeg, asf (via internet) and etc. The following figure shows a video player made of a DDW widget.

The following table summarizes the DDW commands:
ddw pathname ?options? creates a DDW widget
pathname cget ?option? gets an option value
pathname config ?options? configurates a DDW widget
pathname ddsd returns a surface parameter in a list {width height pitch bufferBitDepth alphaBitDepth RGBBitCount RBitMask GBitMask BBitMask}
pathname ddarea tests the speed of display in an area imaging mode
pathname ddline tests the speed of display in a line scanning mode
pathname video rewinds and plays a video stream identified by the option -video
pathname video clock returns the current clock time of the video stream
pathname video continue plays the video stream from the current video clock
pathname video duration returns the duration of the video stream
pathname video height returns the height of the video image
pathname video width returns the width of the video image
pathname video pause pauses the on-going video play-back
pathname video update ?period? updates the current video stream from the current clock to the current clock + period.  A default period is 0.1 ms.
pathname video state reports the current video state: 0 for stop; 1 for play.
pathname video seconds seeks the video stream to a position identified by a specified seconds time.

The following table summarizes options of a DDW widget:
-width width of the widget in pixels
-height height of the widget in pixels
-image name of a RAMIM image
-std standard deviation for image linear strech in display
-comb RGB band combination 
-background background color
-foreground foreground color
-teststr string used in speed testing
-video file name of a DirectShow video stream (over write -image)
-vvar Tcl variable for the current video clock
-vstop script to be invoked when the video stops

The following table shows the rate of frames per second obtained from a performance testing:
Pixel Depth
Area Fill
Row Scan
BW Display
RGB Display
8 bits
258
517
150
56
16 bits
90
180
83
61
32 bits
34
45
30
30

Image size: 512x512. CPU: AMD Athlon 700mhz. Graphic card: savage AGP/16mb.
Area Fill: completely fill the image array in each frame;
Row Scan: progressively fill one row in each frame;
BW Display: black/white display of one band from a seven-band LANDSAT TM image;
RGB Display: color display of three bands from a seven-band LANDSAT TM image.

TWAIN Application.  XBIT has implemented a command twimg based on a TWAIN application protocol. The command twimg is able to open/close the TWAIN data source manager, select a data source, enable/disable a data source and receive an image from data source. The command twimg provides various functions for a user to develop a TWAIN application in Tcl scripts:
 

Twimg commands and functions 
Command Function
twimg acquire acquire image
twimg appinfo application information
twimg capability capability query
twimg close close data source manager
twimg disable disable data source
twimg dsopen data source open
twimg dsclose data source close
twimg dsinfo data source information
twimg enable enable data source
twimg get  get image
twimg info image info
twimg interactive ?options? set or unset interactive mode 
twimg open ?twainDriverName? open data source manager
twimg pending pending images in transfer
twimg select select data source
twimg status current twimg status
twimg setup data source setup

Although these twimg functions are currently a minimum TWAIN implementation, they provide higher level Tcl scripts for an XBit's TWAIN application. Any states controlled by a TWAIN application, i.e., state 1 to 5, can be set with just a single twimg command. For example, the command twimg enable will set the TWAIN application to state 5 from any previous states. A unique feature of an XBit's TWAIN application is its interactive mode in which twimg will remain in state 5 after an image is received. Thus, a user may continue selecting and downloading an image from a digital camera without reopening the data source again. 

The following two images are screen copy of an interactive twimg session started with the command "twimg enable", which sets the twimg sesion to state 5 for event processing. After the button "Scan" was pressed, the data source will notify the twimg's event handler an image is ready to transfer. After receiving the image from the data source, twimg will create a memory resident image and invoke scriptis to display the image in a view widget. The GUI of the view widget allows a user to further process the image in display and save the processed image or the raw image data to a disk file.
 

A GUI of a test TWAIN data source.
A view widget invoked from within a twimg session to display 
the image received from a TWAIN data source.

Customized Imaging Systems.  A camera system for multispectral and hyperspectral imaging may involve an integration of other devices such as tunable a filter controller, a GPS and a motorized stage, etc. If additional application-specific image processing functionalities are required, an implementation could have become very complicated and time-consuming should it be done in pure C/C++ programming. A strength of using XBIT for an imaging system development is that a grabbed image from a sensor can be treated as a regular Tk image once it is in the system's RAM. All the available image processing and presentation tools available in Tcl/Tk, XBIT and other extensions can be applied to the acquired imagery. In addition, Tcl built-in commands such as serial port I/O, sockets, registry management (Windows only), etc. can be directly used in script programming for third party software and hardware integration. Therefore, XBIT provides a cost-effective method for an imaging system development from a prototype to a final product. 

 

[HOME][CONTENTS][DOWNLOAD]1 1