As the volume and diversity of products being shipped by the same production line have increased, so has the need to ensure that the products have the correct components and are within measurement tolerances. Deep learning and machine vision applications can perform presence or absence verification, gauge a product's dimensions, and look for surface defects or contaminants.
Presence/Absence
Checking for a missing component can be done in several different ways, the simplest being using a histogram tool or blob tool. 8-bit grayscale images are represented as an array that has values between zero and 255.
A histogram can be generated by taking a statistical analysis of a region of pixels. In some cases, the presence or absence of a feature can be determined by evaluating the average pixel intensity; in other cases, more complex analysis is required.
Blob tool starts with a filter that takes values that are "above" or "below" a threshold and assigns them a value of 0 or 255. This process is known as binarization. Next, the blob tool connects all of the dark pixels (or bright pixels) into a cluster known as a blob. Analysis of a blob is done to determine its dimensions, area, perimeter, to name a few. Post-processing is common, such as filling in bright (or dark) holes, ignoring blobs that touch an ROI's border, etc. Below is an example of if the binarization threshold is set to 100.
Presence/absence is sometimes be determined by counting the number of blobs or setting a maximum/minimum threshold of the blob's area.
It's also not uncommon to use pattern matching techniques to determine the presence or absence of a feature.
Measurement/Gauging
For product measurement and gauging applications, we provide vision solutions that can capture critical product dimensions within micron-level tolerances. High contrast lighting is an essential precursor in these applications, and measurements typically are calculated using the distance between 2 edge tools. A calibration process translates pixel dimensional measurements to real-world measurements.
Depending on the edge tool's pixel width and its algorithm's sophistication, an edge's location can be calculated to 5 - 10 sub-pixel levels. Generally, an edge tool works by averaging the pixels across its width and then looks for transitions from light-to-dark or dark-to-light. The sharper the transition, the higher the projection score. Tolerances in an edge tool dictate the minimum projection score required for localization to be considered an edge.
Accuracy for such measurements depends on the contrast of the inspected image, so typically, an extra safety margin of 5x to 10x of the measurement accuracy for resolution is required. For example, if the measurement accuracy needs to be +/- 1 mm, then the needed resolution is 5 - 10 pixels per millimeter.