Software is object oriented
One benefit to editing a magazine is that often companies provide products for evaluation.
One benefit to editing a magazine is that often companies provide products for evaluation. Such was the case last month, when I was asked to look at the latest software package from Axtel Machine Vision (Vista, CA, USA; www.axtel.com). The company’s Machine Vision Express (MVE) software package includes a machine-vision library and three development platforms—C++ programming for complex problems, Python scripting for medium complexity, and a graphical user interface (GUI) for less complex jobs. Python scripting and the GUI output scripts are compatible with the Python Software Foundation (PSF; www.python.org).
The easiest way to develop a machine-vision application using MVE is to use the GUI. To do so, a number of steps that make up the application are created by adding several processing stages within the GUI. Each step has a pull-down menu to assign a specific library function to it; the input and output cells of each step can then be interconnected through “drag and drop” of interconnection lines.
As with any machine-vision software- development system, this GUI at first may appear complicated, but I found that after a few hours the development of a program was rather intuitive. To fully test the development environment, I decided (with help from Axtel president Peter Knoll) to develop a simple program to test for the presence of a liquid level in a bottle of Coke.
Using preloaded images in the development environment, the program first had to locate the presence of the cap of the Coke bottle. Having done this, a region of interest (ROI) was placed around the neck of the bottle where the liquid level of the Coke within the bottle should appear. Within this ROI, the software was programmed using a Canny edge detector to determine whether an edge was present within this region. If the system did find an edge, then it was assumed that the Coke bottle was filled to the correct level. If the system could not determine an edge, then it was assumed that the bottle had been incorrectly filled.
At every step of the program the user can view the image, before and after application of a specific imaging algorithm. By selecting two images and alternating those in the same frame, individual pixels start to flicker where images differ. That is a nice feature when troubleshooting programs.
As can be seen in the figure, the system first finds the image from the disk and finds that cap of the bottle within a certain ROI. After this, a relative rectangle that defines the area within the Coke bottle is set around the liquid level. After converting the color image to a gray-level representation, a Canny edge detector is performed and the line extracted. Should a line be unable to be extracted, then the bottle will be rejected. After this visual script is completed, the MVE software automatically stores it in the form of a Python script that can be executed on a PC.
This Python script contains less than 50 lines of code that describe the complete application. Smart camera developers can embed this code into their PC-based cameras to add greater functionality to their products. Axtel is offering a freely downloadable demo version of the software from its Web site.
To run the software, developers must first download Python 2.5 (also from the company Web site) and then the demo version of the MVE software. This version was used to generate the program. Initially free for an introductory period, the MVE software is based on an open source, object-oriented programming model. Code generated by the software is transportable across a number of different hardware devices including smart cameras, PCs, and distributed networks.
In the future, Axel plans to offer its own range of PC-based cameras running Windows CE that will each include a digital I/O, LAN interface, and solid-state disk. According to Axtel president Knoll, the company is currently looking for domestic and worldwide distributors for both its MVE software and its forthcoming PC-based cameras.