In this blog post, we will explore examples of using NIR (near infrared) imaging for food inspection. Nowadays, we often hear terms such as SWIR (short-wave infrared) cameras, InGaAs sensors, or hyper- or multi-spectral imaging. These are all specialized equipment and techniques to acquire images at different wavelengths across the electromagnetic spectrum.
For our experiments, we decided to use a universal multispectral ring light set at 940 nm (the longest wavelength available) and a standard monochromatic camera fitted with an IR filter to block environmental light. We mainly considered two factors: how light of different wavelengths interacts with various materials and surfaces, and the sensitivity of the imaging apparatus (camera) to these wavelengths.
Light at 940 nm falls at the border between NIR and SWIR. It has longer wavelengths than visible light and interacts differently with materials.
Standard cameras with CMOS sensors have reduced sensitivity to light at longer wavelengths than visible light but are much more widely used and available. Despite the drawback, we achieved satisfactory results, particularly in two domains: increased contrast between objects and penetration through materials, enabling us to “see through” certain layers.
I. Increased Contrast
IR illumination can enhance the contrast between different objects or features, making it easier to distinguish between them or detect subtle defects or variations that are not detectable under visible light. This is particularly true at longer wavelengths, but we see a significant increase in contrast even at the NIR spectrum. The longer wavelengths of NIR light compared to visible light penetrate materials more deeply, resulting in significantly enhanced contrast between objects or features, depending on the material composition and surface texture.
Foreign Object Detection
In our first example, we see loose green tea leaves mixed with small stones (Figures 1 and 2). Under visible light, they appear almost identical. At 940 nm, due to their different compositions, their contrast is significantly enhanced, making it easy to distinguish between them. Here, we used the PEKAT VISION Detector and Classifier module and trained two classes: tea leaves and stones. In practice, we could create only one class for stones and set the evaluation criteria to label any incoming image containing stones as NG (not good), disregarding tea leaves. If these were moving on a conveyor belt, PEKAT VISION would flag the stone for removal, ensuring no stones get into the final packaging.
Freshness Inspection
In our second example, we focused on the freshness of fruits, specifically blueberries, exploiting the fact that overripe blueberries have a different composition and interact differently with light at longer wavelengths (absorbing more light and appearing darker). The PEKAT VISION Detector and Classifier module, with two classes – “OK” and “NOK” – helped easily identify the overripe berries.
Below, you can see an image of berries that look indistinguishable under visible light, yet show an overripe berry much darker under light at 940 nm. Even with only a few training images, PEKAT VISION provided accurate results every time and proved its usefulness in automating product sorting.
While working with berries, we noticed that some developed surface mold at either end. It was not very apparent under visible light but was easily detectable under NIR light with our setup, using the PEKAT VISION Detector module trained on a few images where mold was annotated. The results were compelling.
II. Penetration through Material
The second characteristic of light at longer wavelengths that we would like to highlight is its ability to penetrate some materials more effectively than visible light, allowing us to „see-through“ certain layers or materials. For example, using NIR illumination and our setup (a grayscale camera with an IR filter) helped us „see through“ printed text on coffee capsules and focus on the underlying features and defects. Even though the printed layer was not fully transparent, it was significantly less saturated, allowing us to see a small punched-through hole more easily. For the actual inspection, we used the PEKAT VISION Surface Detector module.
Other Considerations
NIR imaging offers further advantages for quality inspection. It is less prone to causing glare and reflections compared to visible light, which can be particularly useful when inspecting highly reflective or glossy surfaces where reflections may obscure details or create false positives. Below, we compare a pill blister seen under white light and using NIR illumination. The expiration date appears much more readable under NIR illumination, enabling machine vision software to read these characters.
Conclusion
Overall, NIR illumination can be beneficial in applications where traditional lighting methods are insufficient for detecting specific defects, providing a valuable tool for enhancing inspection capabilities and improving overall product quality.
What these experiment has shown us is that even using a standard grayscale camera and a universal multispectral light set at 940 nm, we are able to utilize some of the advantages of imaging under longer wavelengths.
Used Equipment
For our experiments we used a Datalogic E 182 monochrome camera with CMOS sensor fitted with an IR filter, PEKAT VISION software version 3.16, and a DCM Sistemes AMS2520A multispectral and multisector ring light. Using its integrated iBlueDrive Control Manager, we set the light at 940 nm for all our experiments.
If you’d like to check the suitability of PEKAT VISION for your specific needs, please contact us or request a free demo or feasibility study.