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.

Infrared electromagnetic spectrum and its wavelengths compared to visible light spectrum
Infrared electromagnetic spectrum and its wavelengths compared to the visible spectrum (not to scale)

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.

Stone in tea detected using NIR and PEKAT VISION software
Figure 1: Using NIR Imaging to increase the contrast between tea leaves and stones highlighted here with red color by the PEKAT VISION Detector and Classifier module

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.

Tea leaves and stones randomly scattered and seen under visible light, NIR, and correctly classified in PEKAT VISION
Figure 2: Tea leaves and stones randomly scattered and seen under visible light, NIR, and correctly classified in PEKAT VISION

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.

Inspection of the freshness of blueberries with NIR and PEKAT VISON software
Figure 3: Classification (Bad/OK) in PEKAT VISION

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.

Blueberries seen under different light and classified with PEKAT VISION
Figure 4: Blueberries seen under different light and classified with PEKAT VISION

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.

Mold on blueberries seen under visible light and NIR
Figure 5: Mold on blueberries seen under visible light and NIR

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.

NIR imaging helps here identify defects on coffee capsules
Figure 6: NIR imaging helps identify defects on coffee capsules

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.

Part of pill blister with expiration date seen under visible light and using NIR
Figure 7: Part of pill blister with expiration date seen under visible light and using NIR

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.

Spojte se s námi

Potřebujete více informací? Dejte nám vědět, odpovíme vám na jakékoli dotazy.
PEKAT VISION is now part of Datalogic Group