Image in modal.

Optical filters’ ability to enhance contrast and performance in machine vision systems is often underestimated. Their applications range from increasing the contrast between different objects imaged by a monochrome camera, to eliminating glare, to providing more control over the brightness of images without changing exposure time or f/#. This article will cover key filter types and application examples of how they can boost the performance of your imaging system.

Key Filter Types

Understanding the advantages and limitations of the main different types of filters is essential for choosing the right ones for your application. While there is a wide variety of filter types, almost all of them can be divided into two main categories: colored glass filters and coated interference filters.

Colored Glass Filters

Colored glass filters made from doped glass materials are very common in machine vision. The doping selectively changes their absorption and transmission properties for different wavelengths. The dopants vary based on which wavelengths are considered for transmission, and the manufacturing process is nearly identical to standard optical glass manufacturing. They have several key benefits: relatively low cost compared to the next filter type covered, and they do not experience any shift in their wavelength spectra when used at an angle, like when used with wide-angle lenses.

However, they do have several disadvantages. Colored glass filters typically feature wide cut-on and cut-off wavebands, meaning that they transition between blocking and passing wavelengths less sharply or accurately as coated interference filters, and they do not reach quite as high transmission as interference filters. Figure 1 illustrates the transmission spectra for several common colored glass filters. Note that they have relatively wide cut-on wavebands and shallow slopes.

Figure 1: Transmission curves for common colored glass filter types. Source: Edmund Optics

Coated Interference Filters

Coated interference filters typically benefit from sharper spectral transitions, higher transmissions, and better blocking than colored glass filters. Dielectric coating layers of alternating high and low refractive indices are added to glass substrates to create these interference filters. The dielectric layers manipulate which wavelengths are passed or blocked by creating wavelength-dependent constructive and destructive interference, providing much sharper cut-off and cut-on bands compared to colored glass filters. Figure 2 shows the transmission curves for a variety of different coated interference filters, which have much sharper spectral transitions than the colored glass filters shown in Figure 1.

Figure 2: Transmission curves for common coated interference filter types. Source: Edmund Optics

Filters designed to have a high amount of blocking (or optical density) for unwanted wavelengths and steep slopes (or sharp transitions from blocking to transmitting wavelengths) are needed for highly-precise applications. Typical machine vision applications do not need this level of precision and using filters with an optical density of 4 or greater would unnecessarily add cost without really impacting system performance.

Also, hard-coated filters achieve such precise transmission and rejection bands because of how they utilize optical interference, but that use of optical interference introduces challenges when used in machine vision systems. Every interference filter is designed for a specific angle of incidence (AOI), which is usually 0° unless specifically stated otherwise. When incorporated into machine vision systems, these filters are typically connected to the front of the lens, where the filter is accepting light coming from many angles determined by the lens’ angular field of view (AFOV). These non-0° angles lead to an unwanted effect known as blue shift, especially when using a wide-angle lens with a short focal length. As the AFOV increases while using an interference filter, the optical path length through the filter layers increases, causing the cut-on and cut-off wavelengths to decrease, hence the name “blue shift” (Figure 3). So a wide-angle 4.5mm focal length lens will have significantly more blue shift than a narrow-angle 50mm focal length lens.

Figure 3: This example of blue shift shows a bandpass filter used at both a 0 ˚ and 15˚ AOI. Not only did the curve shift towards a lower center wavelength, but the cut-on and cut-off transitions became less steep. Source: Edmund Optics

 

Therefore, blue shift will cause different wavelengths to pass through at the edges of the image compared to the center. In many cases, interference filters can still provide better overall filtering control over a colored glass filter, but system designers should be aware of this potential pitfall of using an interference filter with a wide-angle lens.

Infrared Cut-Off Filters

Infrared (IR) cut-off filters are used in both monochrome and color cameras and can be either colored glass filters or coated interference filters. Most machine vision cameras use silicon sensors that respond to wavelengths up to approximately 1µm, so any IR light below 1µm from overhead lights or other sources can lead to stray light and decreased performance. In color cameras, unwanted IR light will create false colors that can degrade overall color reproduction. Because of this, many color imaging cameras have IR-cut filters built into them. In monochrome cameras, unwanted IR light will lower the contrast of the overall image but not degrade performance quite as much, so IR-cut filters are generally not built-in like they are in color cameras.

Applications of Machine Vision Filtering

Enhancing contrast of the objects being inspected is key for most machine vision applications, and optical filters provide a simple way to enhance image contrast and block unwanted illumination. This is done in a wide variety of ways and the filter type used is dependent on the specific use case.

Colored Glass Filter Example

The gel capsule inspection application shown in Figures 4 and 5 is a great demonstration of a colored glass filter use case. A sorting system is attempting to differentiate green capsules from red capsules so they can each be moved to their respective locations (Figure 4).

Figure 4: Four liquid gel capsules of different colors need to be sorted. Image Source: Edmund Optics

 

Imaging the capsules using a monochrome camera (left side of Figure 5) provides a contrast between the green and red capsules of only 8.7%, which is below the minimum advisable contrast of 20%. Minor fluctuations in ambient light, even individuals walking past the system, could decrease the already low contrast value of 8.7% enough so that the capsules are not correctly sorted. There are several potential ways to address this issue: a bulky and expensive light baffling system can be built to completely enclose the entire system, the entire illumination layout of the system can be reworked, or a single filter can be added to boost the contrast between differently-colored pills. In this case, the simplest and most cost-effective solution is to use a green colored glass filter. As shown in the right side of Figure 5, the contrast improves from 8.7% to 86.5%: an increase of nearly a factor of 10.

Figure 5: Capsules being viewed with a monochromatic camera only have a contrast of 8.7% (left), while a monochromatic camera and green filter result in a much higher contrast of 86.5% (right). Images Source: Edmund Optics

Neutral Density Filters

Neutral density filters are helpful in certain situations where it is beneficial to have additional control over the brightness of an image without changing the exposure time or adjusting the f/#. There are two main types of neutral density filters (absorbing and reflecting), but they both do the same thing: uniformly lowering the light transmitted through the lens and onto the sensor. For applications like welding, a machine vision system can be overloaded regardless of the exposure time, but neutral density filters can provide the needed drop in throughput without needing to vary the f/# (which would impact system resolution). Specialty neutral density filters, like apodizing filters, can also help eliminate hotspots in the center of images resulting from harsh reflections from an object. The optical density of an apodizing filter decreases with radial distance away from the filter’s center.

Polarizing Filters

Polarizing filters are another type of filter commonly used in machine vision applications. They allow for improved imaging of specular objects. For the best results using polarizing filters, both the illumination source and the lens must have polarizers on them. These filter on the illumination source is referred to as the polarizer and the filter on the lens is referred to as the analyzer. Figure 6 shows an example of how polarization filters can reduce glare and make it much easier to image specular objects.

Figure 6: Images taken of a specular object with no polarizing filters (a) showing high glare and with polarization filters (b) which reduce glare. Image Source: Edmund Optics

In Figure 6a, a CCD imager is being inspected using brightfield illumination and no polarizing filters, and Figure bb shows the same illumination setup with a polarizer on the light source and an analyzer on the lens. Augmenting the system with polarizers clearly provides superior performance because the harsh reflections are absorbed by the filter on the lens. To achieve maximum blocking of unwanted glare, the polarization axis of the polarizer must be perpendicular to the polarization angle of the polarizer on the lens, assuming both are linear polarizing filters. Otherwise, some of the harshly reflected light will still pass through into the system, resulting in some glare.

Optical filters’ manipulation of contrast is an often underestimated superpower for machine vision systems. Adding the right filters to your application could result in outsized performance benefits compared to upgrading the lenses, cameras, or illumination sources themselves. While this article introduced key concepts and some of the main applications of filters in machine vision, talk to your optical component supplier for more guidance on how optical filtering can get you the most out of your specific machine vision systems.