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:
The following table summarizes options of a DDW widget:
The following table shows the rate of frames per second obtained from a performance testing:
Image size: 512x512. CPU: AMD Athlon 700mhz. Graphic card: savage AGP/16mb.
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:
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.
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. |