Vision systems can automate tasks such as part measurement and inspection quickly, accurately, and with high repeatability, helping manufacturers improve product quality and productivity. Vision systems generate valuable monitoring data at every step of the manufacturing process, which also helps control engineers expand process diagnostic capabilities. Non-contact measurement is faster. The most common application of machine vision in quality control is measurement. Bryan Boatner, Marketing Manager for Cognex's In-Sight series of vision sensors, says that the unique part-measuring accuracy of vision systems, reaching up to one-thousandth of an inch, makes them suitable for many applications that previously required contact measurement methods. He states, "Manufacturers adopt vision-based measurement for many reasons. Speed is a major one. Contact measurement struggles to keep up with high-throughput production lines; therefore, traditional measurements are typically performed during product sampling." In contrast, machine vision systems can keep pace with these production lines, performing thousands of measurements per minute, and can be embedded in production line systems for 100% monitoring. "By eliminating physical contact, vision-based measurements can 'avoid damage to parts and reduce maintenance such as wear and scratches on mechanical measurement surfaces. Ultimately, vision systems can measure parts that cannot be measured using contact methods,'" Boatner said. Arnaud Lina, head of the imaging software group at Matrox Imaging, agreed: "Machine vision offers many new possibilities for physical metrology, such as the precise measurement of objects." Ben Dawson, director of integrated product development strategy at Dalsa's Digital Imaging Group, outlined some key points that help in setting up machine vision measurement systems and other applications. [align=center] Figure 1: Some simple tools—such as a ruler, a beam splitter, and a 2x telephoto lens—can help speed up the setup of machine vision, says Ken Brey of DMCinc. [/align] Diagnostic Functionality Boatner said: "Beyond measurement, machine vision provides an effective data acquisition tool for diagnostics, allowing for process measurement and analysis of data trends. Vision systems can provide real-time images for monitoring operations and can also archive digital images time-stamped for later retrieval." Boatner gives an example: on a canning line, as a camera passes a bottle, it can capture an image of each bottle and compare it to a series of standard parameters, checking for fullness, cap, seal, label, appearance, and degree of deformation. When a parameter exceeds the standard, a signal is sent indicating that the bottle needs to be moved to the waste storage room. Furthermore, this can be configured to store images of defective bottles in a database for analysis. Engineers can observe the images for root cause analysis instead of resampling from the waste storage room to find the source of the defect. Archiving defective images for later use can serve as a diagnostic tool, aiding in troubleshooting and reducing downtime. [align=center] Figure 2: A mirror spectrometer is positioned at 45 degrees to mimic a diffuse coaxial light source (DOAL). It can be used in conjunction with a ring light source or an integrated camera light source, with the camera perpendicular to the part to ensure image quality. [align] Optimal Approaches Boatner says vision products are increasingly categorized into three main types: vision sensors (generally standalone, low-power inspection devices), PC-based vision systems (powered and flexibly programmable using simple graphical programming languages), and expert sensors (low-power technologies for specific automation problems). All three categories of vision products include cameras, processors, image analysis software, light sources, and network interconnectivity. Ken Brey, Technical Director at DMC Systems Integration, suggests that sharing methods and techniques for machine vision technology helps end users understand what should and shouldn't be done. Based on the above, we can list several optimal approaches: many components are interdependent, so this list is not strictly ordered. For example, powerful software can compensate for the inadequacy of suboptimal light sources; proper lens use can reduce hardware power consumption. Assembly Tools: Every vision system setup area or lab should have a range of spare parts, lenses, and other components, along with simple machine vision cameras, light sources, and mounting options. Engineers can choose from these materials to build a vision system. Brey says a reasonable set of raw materials costs approximately $300. System accessories: A plastic ruler, approximately $2, can be used to measure the field of view for both front and rear light sources. Positioned at a 45-degree angle and focused on the center (not the edge), it can measure depth of field (e.g., a 15mm ruler distance divided by 1.41 gives the depth of field). For high magnification applications, use a simple $40 Ronchi grating to check for optical system distortion. Change the lens and adjust the camera position at the minimum field of view. There's no need to buy more cameras than actually needed, but it will take time to mathematically convert the results. System accessories: A set of color filters, approximately $150, can reduce the influence of ambient light; filtering out common wavelengths in light waves from different materials increases contrast. System accessories: A focal length extender, approximately $95, allows you to simulate a longer focal length lens by using a 2x focal length extender, such as transforming a 50mm focal length to a 100mm focal length or a 35mm focal length to a 70mm focal length. However, this method of use requires an exposure time four times longer than using a telephoto lens with a corresponding f-stop. Brey says this is a drawback of the extender. If exposure time is disregarded, the focal length extender can be incorporated into the system because it provides a shorter optical distance in tight spaces and reduces the overall cost of the optical system. System accessories include a mirror beam splitter (valued at $50), which can be used with a ring light source or an integrated camera light source, ensuring the camera and light source are perpendicular to the part. At a 45-degree angle, by reflecting half the light and transmitting the other half, a diffuse coaxial light source (DOAL; as shown) can be simulated. For diffuse reflection, the camera can be adjusted so that the central aperture surrounds the part being measured, thus eliminating measurement errors. In robotics applications, such as around an engine assembly, it allows for robot teaching at each measurement point. It can also increase accuracy for remote measurements. The diffuse coaxial light source (DOAL) can reduce reflections and glare, eliminate bright spots and foreign objects, and, for example, eliminate clumps on painted surfaces by providing edge contrast. Application Considerations: Know What You're Testing: Understand the difference between good and bad parts or products. The more precise the specification, the easier it is to solve problems. More importantly, selecting edge products for inspection reduces judgment errors. Application Considerations: Vision System Performance: Before selecting a vision sensor, first determine the application scope of the system to ensure sufficient performance margins in terms of speed, accuracy, and acquisition requirements. This is because users, already familiar with the capabilities of machine vision, want to accomplish as many vision-related tasks as possible, while also considering future needs for increased throughput, production of new products, and modification of existing products. Application Considerations: Camera Performance and Resolution: The camera must have sufficient pixels to analyze even the smallest points. For electrical measurements, such as pinhole defect measurement, a minimum point size of at least 3×3 pixels is desirable. Excellent machine vision software can perform edge-to-edge distance measurements at a scale of 1/10 of a pixel, or even better. This can significantly improve resolution for certain types of measurements. Application Considerations: Hardware: Image acquisition hardware (i.e., the "image acquisition card") must have low noise and low jitter for stable measurements. Application Considerations, Software: Ensure that vision-based measurements provide a clear definition of measurement tolerances. For example, there are multiple methods to measure perpendicularity, so you must first ensure that this vision solution can perform the required tests. Application Considerations, Repeatability: Any sensing operation, including vision sensing, requires repeated measurements to ensure reliable inspection as many times as possible. To test repeatability, place a part under the vision system, “perform at least five measurements, and do not change the part’s position, light source, or other variables during the measurements. Based on this, you can plot the repeatability of the measurements and ensure that any changes in the results are within the allowable tolerances,” Boatner said. Consider Additional Features Before Purchasing: Don’t just look at the price without considering the potential additional features that the purchase will bring. Investing in a vision system with robust software support can save money because it reduces the need for more expensive light sources, optics, or part clamping devices. Use Pre-Sales Demonstrations for Actual Parts Before Purchasing: Have the vision system vendor give a pre-sales demonstration, demonstrating and validating a range of products or parts, from good to bad. Lens selection to avoid distortion: Standard machine vision lenses have optical distortion, negative distortion, or barrel distortion, and perspective distortion can occur when measuring at different distances from the lens. While these distortions can be partially corrected by the machine vision system, a better solution is to use low-distortion lenses or telecentric lenses. Dawson suggests "seeking help from the vendor." Lens selection, field of view, resolution: Choose a lens based on the required field of view and the resolution for the smallest point of interest. Dawson says that the limiting component for resolution is the camera, not the lens. Light source, avoid reflections: Provide a light source that enhances the measurement and suppresses human influence; unnecessary reflections are human influences. For example, backlighting can be used to illuminate parts like stamped metal sheets, while parallel light sources can be used to highlight their edges. Correct light source selection requires experience and trial and error. Again, you can seek help from the vision system vendor. Light source, contrast: Lina says that because testing accuracy is affected by contrast and noise, it's best to acquire images under optimal conditions. Light source, contrast, color: Remember that the light source is crucial for producing easily observable contrast and obtaining a high-quality image. When considering light sources, both the type and color of the light source must be taken into account. Light Source, Depth of Field: Boatner states that it's crucial to ensure the light source meets depth of field and field-of-view requirements. [align=center] Figure 3: Machine vision software has become less complex, as illustrated by this program from Banner Engineering, where it can perform operations with a simple click when checking letters and distances via vision sensors. [/align] Installation: In typical measurement applications, a camera is mounted above or to the side of the part, capturing images for measurement as the part enters the field of view. Measurement software is then used for graphical analysis, calculating the distances between different points in the image. Based on these calculations, the vision system determines whether the part's precision is within tolerance limits. If it is, the vision system sends a non-compliance signal to a logic device (such as a programmable logic controller, PLC), which can then drive a mechanical mechanism to remove the non-compliant product from the production line. Software, Automatic Setup: Select a measurement tool that can automatically set up a measurement template (measurement area map). For example, if geometric pattern recognition is used to determine the part's position and orientation, the system can automatically adjust the measurement area based on the results of these recognitions. Software, Geometry-Based: Relies on basic geometric operations rather than complex mathematics. By employing a measurement toolkit with a multi-repeating coordinate system, you can easily derive new features from existing features using geometric methods. Software, Camera Positioning and Calibration: Calibrate! Choose a software package that works in a real-world coordinate system and then position the camera to avoid major distortions and perspective. Extract the features to be measured from the source image (distorted) and then measure them in the space where the correction operation is performed. This way, measuring distorted images will not degrade the accuracy level. Software, Ease of Use: Choose machine vision software that is easy to set up and use, corrects optical or perspective distortions, and provides sub-pixel accuracy; even at measurement resolutions as high as 1/25 of a pixel or higher, software setup and distortion correction can be completed in minutes. Software, Feature-Based: The method for measuring images should be feature-based, a technique for extracting geometric features from grayscale pixel values. Lina says: This algorithm can simulate how measurements are performed in the real world, and it is robust enough to handle variations in brightness. Software, Field of View: To optimize operation, the field of view should surround the feature being measured as closely as possible. Software, Measurement Tools: Pre-configured software toolkits simplify the setup of machine vision applications, including measurement. Measurement tools work by measuring the distances between edges in an image. In an image composed of grayscale pixels, the edges are where the grayscale values change abruptly. These changes can be from dark to light or from light to dark. In addition to calculating the distances between edges, measurement tools also measure the angles between edges and the size and position of holes on a part. [align=center] Figure 4: Just as machine vision can determine position, some software, including Cognex, can also measure distances; for example, Cognex can measure the center distance between two holes. [/align] Software, Setup/Programming: Boatner notes, "Some vision software platforms are easier to use than others." This is because these platforms provide point-and-click controls without requiring users to use high-level programming languages for setup. Vision-based measurement software includes: ■ Edge Detection: Ignoring changes in the background, it locates edges in an image and calculates the angle and magnitude of the edges. ■ Calipers: Provides high-speed, sub-pixel-level measurement of part feature widths. ■ Blob Analysis: Offers high repeatability, measuring part feature areas, dimensions, and centroids. ■ Scale Calibration: Converts camera pixels into real-world engineering units. ■ Nonlinear Calibration: Optimizes system accuracy, correcting distortions caused by the lens and projected light. It also allows for the use of smaller, more manageable correction templates in wide-field-of-view applications. Setting Measurement Thresholds Through Simple Statistics: Repeatedly changing measurement limits and evaluating results is very time-consuming, and even after all the changes and evaluations are complete, the measurement limits are not necessarily optimal. Only after all the time has been wasted can you determine if it worked, and even then, you can't be entirely certain. To save time, Brey says: ■ Set up your vision system to output standard values, based on which the product pass threshold is set. ■ Process the collected images and then organize the output values into a spreadsheet. ■ Separate the inspection data for passing and failing parts. ■ Calculate the standard deviation of these two sets of data. ■ Generate a bar chart. The histograms of these two sets of data must not overlap. If they do, a more suitable standard value must be found. ■ Calculate the average of the non-conforming groups and select a critical value such that the portion above the critical value reaches 3Sigma (99.73%). The non-conforming rate is determined by the Sigma level of the conforming groups. ■ If there is no critical value that can reach the 3Sigma level for both the conforming and non-conforming groups, then a new standard value must be found. Setup and optimization of the inspection scheme: Using stored images to improve the optimization of the inspection: Vision engineers spend several hours optimizing the inspection scheme. Costs include capital, parts, and the time to execute the inspection process. Waiting for a rare defect is necessary; however, spending time waiting or creating defects is wasteful. Furthermore, validating the effectiveness of these changes is time-consuming. Therefore: ■ Arrange the cameras and light sources optimally. Ensure all objects of interest are visible and have optimal contrast. ■ Correct the system to ensure it is focused. ■ Collect a dozen, sometimes hundreds, of images of different parts. Generate a small working sample set of 10 to 20 images, including a few images of acceptable parts and several images of various non-conforming conditions. Completing this task may require collecting billions of images. ■ Generate an inspection plan and optimize it until all images in the working sample set can be correctly evaluated. ■ Inspect all images in the larger sample set. Optimize the inspection plan until there are no "false acceptances" of non-conforming samples and the non-conforming rate is acceptable. Then, ■ apply this inspection plan to the system. Continue collecting all images. Any problematic images are added to the working sample set, and the inspection plan is further optimized offline, reducing waiting time at the workstation.