Rapid Application
Development for Machine
Vision – A New Approach
Introduction
Converging technologies, such as the PCI-bus and Intel MMX, have created so much band-width and computing power that automation and test engineers and scientists are beginning to consider PC-based vision a standard measurement tool. Because of the newly available bandwidth and computing power, traditional temperature, pressure, and signal measure-ment professionals are now expanding their capabilities to include image processing and machine vision. In the past, vision software solutions were relegated to a small number of vision experts or “craftsmen.” National Instruments has created IMAQ™ Vision Builder to make vision simpler for experienced measurement professionals looking to embrace vision as a new measurement tool. Vision Builder addresses the primary challenge a new vision developer has when beginning a vision application, namely:
How do I use vision software to solve my application?
In addition, Vision Builder appeals to experienced vision developers because it addresses their greatest challenge:
How can I reduce development time and cost?
As measurements have expanded to include images, vision software has become a critical measurement technology. This paper outlines a new development approach for new and experienced vision developers. Using National Instruments application software, vision library software, and interactive vision software, developers now have a rapid application development (RAD) environment for vision.
The Limitations of Current Vision Development Approaches
For many vision applications it is not always known just by reviewing an image of a sample if there is a simple vision software solution. Building a vision application often involves clever, time-consuming experimentation with a test image and a database of reference images. In the past, most vision engineers developed their own test programs using a library of image processing functions and application software. The result was that much of their development time was devoted to writing prototype code to test different vision processing strategies under varying illumination conditions.
In addition, today there is no development framework that ensures maximum reuse of code for the vision development process. Typically the code for common development tasks is partially duplicated for each new vision application or by different groups within the same organization.
Common Vision Software Development Tasks
• Calibrate the camera, lens, and lighting systems • Manage a database of test images
• Develop a vision algorithm prototype • Develop an operator interface
A Rapid Application Development Environment for Vision
The new National Instruments interactive vision software environment – IMAQ Vision Builder, combined with the IMAQ Vision software library and an application development environment, such as LabVIEW™, LabWindows/CVI, or Microsoft Visual Basic – is the foundation for a new approach to vision software development. These following steps out-line a new approach that significantly reduces the time and cost involved in developing a vision application.
Step 1. Developers begin by first prototyping and testing the vision strategy in Vision Builder. Vision Builder has an intuitive interface and logically named functions so measurement professionals who are new to vision can rapidly learn to use vision functions to solve applications. Clear examples lead new vision developers through a tutorial, which quickly builds their vision expertise.
Step 2. The result of an interactive development session is a Vision Builder Script that can be tested against a database of test images. In an industrial manufacturing applica-tion, this database of images should include flawed and good components. It is important to test the vision strategy with various good and bad parts. In addition, it is important to test the strategy with images that have been acquired under varied lighting conditions because illumination of the scene can vary with the time of day in an industrial application. Once a Vision Builder Script has been created, you can step through each vision function, immediately see the resulting image, and change the control parameters interactively.
Step 3. Vision Builder can then generate a “Builder File” which is a detailed listing of the vision function calls and control parameters. The Builder File is used to guide the development of a vision application in LabVIEW, LabWindows/CVI, Microsoft Visual Basic, or Visual C/C++.
Figure 1. IMAQ Vision Builder generates a Builder File to assist you in developing vision applications in LabVIEW, BridgeVIEW, LabWindows/CVI, and ActiveX programming environments such as Microsoft Visual Basic and Visual C/C++.
Rapid Prototype Rapid Application Development IMAQ Vision Builder Builder File IMAQ Vision Software and Application Software
Overall, an interactive vision tool such as Vision Builder is a key component to rapidly developing an application. With IMAQ Vision Builder, you can:
• Interactively test different vision functions with no programming
• Test a series of vision functions by changing an image processing control parameter and immediately visualizing the resulting image
• Interactively learn how vision functions work
• Test your vision software strategy against a database of test images
• Create a vision recipe or Builder File for use with application development environ-ments such as LabVIEW, BridgeVIEW, LabWindows/CVI, Microsoft Visual Basic, and Visual C/C++
• Prototype gray-scale, color, and binary solutions • Acquire images from analog and digital cameras
• Manage large numbers of images with an image browser
Benefits for New Vision Developers
Most machine vision beginners are overwhelmed because there are so many slick algo-rithms to select from that the question usually is where to begin. With Vision Builder you can test an image processing function or series of functions and see the result of each step without programming. Interactively solve image enhancement, counting, sizing, gauging and measurement, color, and feature-finding applications for inspection, medical, and sci-entific applications. With Vision Builder, measurement professionals who are new to vision can learn how to solve vision applications rapidly, through interactive experimenta-tion with a suite of example applicaexperimenta-tions.
Benefits for Experienced Vision Developers
Experienced vision developers under pressure to reduce cost and time to market can use Vision Builder to accelerate vision software development. With Vision Builder you can interactively develop applications using hundreds of image processing functions. Then use IMAQ Vision Builder to output a vision Builder File. The Builder File guides you in devel-oping custom vision applications in several application development environments. The software functions are standard vision functions from National Instruments IMAQ Vision machine vision and image processing software.
Machine Vision and Imaging Processing Applications
Machine vision refers to applications in which the PC automatically makes a decision based on visual input from a camera. Machine vision is a term typically used in industrial manu-facturing, where applications range from culling blemished oranges from a conveyor belt to saving lives by inspecting to ensure that the correct drug capsule has been placed in the package before the product is shipped to the pharmacy. The term “image processing” is most often used in science, microscopy, and laboratory automation applications. Image processing typically means smoothing, filtering, and enhancing an image. Vision Builder
Gauging – A Typical Machine Vision Application
Gauging refers to measuring critical distances in image pixels. Components such as elec-tronic connectors and leads can be inspected with vision software. Vision software can quickly and consistently measure certain features on a component and determine whether the part meets tolerance specifications. Gauging applications use vision techniques such as “edge detection” and “caliper tools” to measure distances. Gauging measurements can be made off line by using a sample of the manufactured parts or can be made on line during the manufacturing process. A RAD environment is beneficial for both off-line and on-line applications.
Counting and Sizing Objects – A Typical Image Processing Application
Often in laboratory automation or microscopy applications it is necessary to quantify the number of cells and the size of objects in an image. The National Instruments RAD envi-ronment for vision and Vision Builder includes functions for processing the image to count and size objects such as cells. Additional information such as the location, perimeter, length, and width can be easily calculated. Counting and sizing applications use vision tech-niques such as “blob analysis” and “morphology.”
Vision Software Implementation Cost Comparison
Many developers, in the past, undertook the cost of building their own vision software with-out the use of rapid application development tools. Today, developers typically use off-the-shelf vision libraries and image acquisition driver software; but the vision develop-ment strategy is many times developed by experidevelop-mentation or by trial and error. The following table outlines the specific vision development tasks required to develop a typical gauging application in a manufacturing setting. It is important to realize that these tasks are for just the vision software development and do not include estimates for material handling, motion control, and lighting equipment designs. An estimate of the time required to imple-ment each vision software task using a library of machine vision or image processing software is included, compared with the time it takes to implement the same task using a RAD tool such as Vision Builder, the IMAQ Vision software library, and LabVIEW. The important point here is to identify the relative time and cost savings when using RAD approach for vision.
Note The software development time estimates shown in the following table are based on a specific application. Development times for your specific application will vary from the estimates. However, the comparison shows the potential cost and time savings that result from using a RAD approach.
Table 1. Vision Software Implementation Cost for a Gauging Application
Vision Software Development Task Development Hours
Vision Library RAD Environment:
IMAQ Vision Builder, IMAQ Vision, and
LabVIEW
Create System Calibration Code – quantify camera, lens, and lighting system in case parameters drift
16 2
Start with built-in calibration example Capture and Manage Test Images – acquire test image database
that includes images with typical lighting conditions and images with defects and no defects
16 4
Use built-in image acquisition tools and image browser for managing images Develop Gauging Strategy – create vision strategy using an image
of manufactured component that is out of tolerance
40 6
Start with gauging example
Test and Modify – use the image database to test and possibly tweak the vision software strategy
16 4
Use batch- processing mode for testing large image databases Integrate Vision Software with Image Acquisition and other I/O –
incorporate triggering and data acquisition with vision software 30
This could vary significantly based on the complexity of the triggering and I/O options
16
Vision Builder generates a Builder File with vision recipe for easy integration into LabVIEW, LabWindows/CVI, Visual Basic, and Visual C/C++ Modify Vision Software After Manufacturing Line Test – modify
vision software if necessary
20 8
Significant time savings if vision software strategy needs to be modified
Develop Operator Interface 24 8
Reduce operator interface development time by using LabVIEW or other GUI development tool Document Vision Software Strategy – document the vision
strategy for future support considerations
16 4
Vision Builder documents the vision
Custom software development can be implemented internally, or through third-party system integrators or consultants. For comparison, the following rates are used:
In-house software development rate $50/hour Third-party development rate $100/hour
This example demonstrates that you can potentially develop a vision application 4.2 times faster (178 hours vs. 42 hours) using a RAD approach. For this simple gauging application, the potentially time savings is 136 hours. The cost savings of an in-house development using a RAD approach compared to a third-party custom development approach could be as much as $15,700. These savings are for a single vision application. If you plan on imple-menting four or more different vision applications in the next year the cost savings could be greater than $60,000.
Adding New Inspection Features
Vision software development is not a one-time cost, but an on-going effort. As new require-ments emerge, they must be quickly and easily added to your vision system. Using RAD tools such as Vision Builder and IMAQ Vision makes it easier to update your vision system to add new inspection tasks to find new unforeseen product defects and less costly for the in-house or third-party developer.
Training Costs
Training on vision software development tools is another expense that many companies overlook. Many companies are looking for a standard vision environment that they can use throughout the world, in many different manufacturing or laboratory settings. Vision devel-opment software requires more than just software develdevel-opment tools if it is to be used throughout an enterprise and among several facilities. It also requires documentation, stan-dard training classes, technical support, and local experts who can answer questions when problems arise. National Instruments application software and its vision software – IMAQ Vision software and Vision Builder – include all of these services.
Development Option Development Time Development Cost
In-house development using vision library 178 hours $8,900 Third-party development using vision library 178 hours $17,800 In-house development using RAD approach 42 hours $2,100 Third-party development using RAD approach 42 hours $4,200
Summary
A rapid application development (RAD) approach for machine vision software develop-ment can save you and your company significant amount of developdevelop-ment time and money. A key time-saving development tool in this RAD approach is an interactive development tool such as Vision Builder. Vision Builder shortcuts your overall development time by combining the time-consuming vision software strategy test-and-experiment phase with the vision application development phase. Plus, Vision Builder is unique because it offers mea-surement professionals who are new to vision software development a way to quickly learn how vision functions are used to solve applications. For experienced vision developers, it offers the capability of saving hours and hours of development time in finding and devel-oping a vision solution.