I. What are Filters?
Filters are optical devices used to select specific radiation bands. One commonality among filters is that none of them can make astronomical imaging brighter because all filters absorb certain wavelengths, making objects appear darker.
II. Two Major Types of Filters
There are various types of filters in machine vision used to improve or alter the image of inspected objects. Understanding the different technologies behind various filter types is crucial to grasp their advantages and limitations. While there are many types of filters, they can generally be divided into two major categories: colored glass filters and coated interference filters.
1. Colored Glass Filters
Colored glass filters are very common in machine vision and are created by doping glass with elements that selectively alter their absorption and transmission spectra. The dopants vary based on the wavelengths considered for transmission, and the manufacturing process is almost identical to standard optical glass production. Colored glass filters have several advantages; they are relatively inexpensive compared to interference filters, and importantly, they do not exhibit any wavelength transmission shifts when used with wide-angle lenses or at specific angles.
However, colored glass filters typically have wide bandpass cuts, lack sharp or precise curves like coated interference filters, and do not have as high transmission as interference filters. The diagram below shows the transmission curves of several common colored glass filters. Note the wide bandpass and relatively shallow slopes describing their transmission functions.
Infrared (IR) cut-off filters can be either colored glass filters or coated filters useful for monochrome and color cameras. Since most machine vision cameras’ silicon sensors respond to wavelengths up to about 1µm, any IR light incident on the sensor from overhead fluorescent lights or other unwanted sources can lead to inaccurate sensor readings.
In color cameras, infrared light can create a false color on the sensor, reducing overall color reproduction capabilities. For this reason, many color imaging cameras come with IR cut-off filters. In monochrome cameras, the presence of IR light can reduce overall image contrast, though, unlike color cameras, IR cut-off filters are typically not built-in. There are also many other types of colored glass filters, such as daylight blue filters used for color balancing when using multi-color light sources and color sensors.
2. Coated Interference Filters
Coated filters generally offer sharper transitions and cuts, higher transmissions, and better blocking compared to colored glass filters. These include hard-coated fluorescence filters, dichroic filters, and polarizing filters. Each coated filter undergoes a unique manufacturing process to ensure proper performance. Wavelength-selective filters are made by depositing dielectric layers on alternating specific substrates with high and low refractive indices. The substrate’s surface quality and uniformity establish the filter’s baseline optical quality while setting wavelength limits for the substrate material’s transmission drop.
Compared to colored glass filters, dielectric layers generate detailed spectral structures by producing constructive and destructive interferences across a range of wavelengths, providing sharper cut-offs and bands. There are many types of hard-coated filters like bandpass, longpass, shortpass, and notch filters, each with specific blocking and transmission ranges. Longpass filters are designed to block shorter wavelengths and pass longer ones, while shortpass filters do the opposite—blocking longer wavelengths and passing shorter ones. Bandpass filters pass a range of wavelengths while blocking longer and shorter wavelengths outside the passband. On the other hand, notch filters block a range of wavelengths while passing longer and shorter wavelengths. The transmission curve shapes for these filter types are shown in the diagram below.
Filters designed for deep blocking (high optical density) and steep slopes (sharp transitions from blocking to transmission) are reused in applications where precise light control is critical. Most machine vision applications do not require this level of precision. Any filter with an optical density (OD) of 4 or greater is more precise than necessary and adds unnecessary costs. Since hard-coated filters utilize optical interference to achieve precise transmission and suppression bands, using them in machine vision applications can be challenging. All interference filters are designed for specific angles of incidence (AOI), typically 0° unless otherwise specified.
When used in machine vision, these filters are typically placed in front of lenses. Doing so allows the filters to accept light at angles specified by the lens’s angular field of view (AFOV). Particularly with short focal length (large AFOV) lenses, the light transmitted through the filter often exhibits an undesired effect called blue shift. For instance, the blue shift for a 4.5 mm wide-angle focal length lens will be much larger than that for a 50 mm narrow-angle focal length lens. As the AOI increases on interference filters, the optical path length through the filter increases, resulting in reduced cutoff wavelengths and cut-off wavelength steepness. The functionality of interference filters is based on the propagation distance of light incident on the filter, as shown in the diagram below. At the correct AOI, the light waves incident on the filter experience destructive interference, preventing them from passing through the filter. From different angles, destructive interference is not as effective.
Blueshift is illustrated in the example below, showing a bandpass filter used at a 15-degree AOI. Note not only the shift towards lower center wavelengths but also the shallower slope. The dashed curve represents the ideal when the filter is used at a 0-degree AOI.
Therefore, filters exhibit different behaviors in images by transmitting different wavelength ranges at different field points. The farther from the center, the more pronounced the blue shift. In most cases, interference filters still offer better filtering control than colored glass filters, but potential pitfalls should be noted when using interference filters with wide-angle lenses.
III. Application of Filters in Machine Vision
Enhancing the contrast of features of interest in inspected objects is crucial in designing machine vision systems. Filtering provides a simple way to enhance image contrast while blocking unwanted illumination. Filters can enhance contrast in various ways, depending on the application. Some common filters used in machine vision include colored glass, interference, neutral density (ND), and polarizing filters.
1. Colored Glass Filters
Colored glass bandpass filters are some of the simplest filters available that can significantly improve image quality. These filters work well in narrowing down the spectral bands visible to the visual system and are often cheaper than similar interference filters. Colored glass filters work best when used to mask colors on the opposite side of a color wheel (e.g., warm colors filtering out cool colors), as shown below.
Consider the example shown in the diagram below, where gel capsules are being inspected, with two red capsules on either side of a pair of green capsules, under white backlighting.
This is a sorting application where the pills need to be separated by color to reach their respective locations. Imaging the capsules with a monochrome camera, the contrast between the green and red capsules is only 8.7%, below the minimum recommended contrast of 20%. In this specific example, slight fluctuations in ambient light, like someone passing by the system, can reduce the already low 8.7% contrast to a level where the system can no longer operate reliably. There are several solutions to this problem: building a large, expensive light-blocking system to fully enclose the inspection system, redesigning the entire lighting scheme of the system, or adding a filter to enhance the contrast between the green and red capsules. In this case, the simplest and most cost-effective solution is to use a green glass filter to increase the contrast between the two different-colored capsules. As shown below, the contrast increases from 8.7% to 86.5%, almost tenfold.
2. Neutral Density Filters
Neutral density filters are used in certain applications where additional control over the brightness of the image without changing exposure time or adjusting f/# is advantageous. While there are two main types of neutral density filters (absorptive and reflective), their impact on the image is the same, uniformly reducing the light transmitted through the lens and reaching the sensor. For applications like welding where the imaging sensor may overload regardless of exposure time, neutral density filters can provide the necessary throughput reduction without the need to change the f/# (which may affect the system’s resolution). Special neutral density filters, like graduated filters, help deal with hotspots in the image caused by intense reflections from objects, with light density decreasing radially from the center of the filter.
3. Polarizing Filters
Polarizing filters are another common type of filter used in machine vision applications, particularly for better imaging of specular objects. To use polarizing filters correctly, both the light source and the lens must have polarizing filters. These filters are referred to as the polarizer and analyzer, respectively. The diagram below demonstrates how polarizing filters work when observing specular reflective objects.
In the image (a), a bright-field illumination is used to inspect a CCD imager, while in image (b), the same illumination setup is used with a polarizer on the light source and an analyzer on the lens. As shown in image (b), using a polarizer significantly enhances system performance because the lens filter absorbs intense reflections. To ensure maximum suppression of unwanted glare, the polarization axis of the polarizer must be at a 90° angle to the polarizer on the lens. Otherwise, the lens will still transmit some light from intense reflections into the system, leading to glare.