Distinguishing Same-Color Nuts and Stones Using the SWIR035AU Camera

Author:Attostek    ·    Release Date :06/13/2026    ·    Category :Industrial Inspection

Application Background and Detection Principle

Application Background

In nut processing and grain sorting, stones and other inorganic contaminants can accidentally mix with food materials during harvesting, drying, and transportation.

Traditional manual inspection and visible-light vision systems mainly rely on differences in color and brightness to identify foreign objects. However, when stones have a similar appearance and color to the nuts, particularly dark-colored nuts mixed with dark stones, visible-light imaging may struggle to distinguish them reliably.

Short-wave infrared (SWIR) imaging offers an alternative approach by detecting differences in the spectral reflectance characteristics of different materials.

This experiment evaluates the ability of the AttosTek SWIR035AU camera to distinguish nuts from similarly colored stones and compares the imaging results under different illumination and optical filtering conditions.

Imaging Principle

Organic materials such as nuts and inorganic materials such as stones exhibit different reflectance characteristics in the SWIR wavelength range.

In this experiment, imaging was performed around 1300 nm. Under the tested conditions, stones generally produced lower grayscale values and appeared darker in SWIR images, while nuts produced higher grayscale values and appeared brighter.

The resulting intensity differences make it possible to distinguish the two materials even when their visible colors are similar.

Image contrast is also affected by illumination spectrum, lighting angle, exposure time, lens transmission, filter bandwidth, surface roughness, and sample moisture content. Therefore, this experiment compares different illumination and filtering configurations under controlled imaging conditions.

Experimental Setup and Conditions

The experiment used the following equipment and materials:

Equipment / ComponentModel / Specification
SWIR CameraAttosTek SWIR035AU
Visible-Light CameraAttosTek VIS028CU3.2-NC
Illumination Source1300 nm infrared light source
Optical Filter1300 nm infrared filter
Test SamplesSeveral nuts and similarly colored small stones

Experimental Procedure

Step 1. Sample Preparation

Nuts and stones were mixed and placed within the central field of view of the SWIR035AU camera. Samples with different sizes and surface orientations were included to observe material-related imaging differences.

Step 2. Camera Adjustment

The camera focus and aperture were manually adjusted to obtain clear images of the samples.

Step 3. Exposure Setting

An appropriate exposure time was selected using manual or automatic exposure mode.

Step 4. Image Acquisition

Images were captured under three SWIR imaging configurations:

  • Direct SWIR imaging without additional illumination or optical filtering.
  • SWIR imaging with a 1300 nm infrared light source.
  • SWIR imaging with both a 1300 nm infrared light source and a 1300 nm optical filter.

Visible-light images were also captured for comparison.

Step 5. Image Comparison

The resulting images were compared to evaluate the grayscale differences between nuts and stones under the different imaging conditions.

Experimental Results and Analysis

4.1 Qualitative Imaging Comparison

Four imaging configurations were used to compare the appearance of nuts and stones.

Condition 1: Visible-Light Imaging

可见光相机拍摄同色坚果和石子

Images captured using the VIS028CU3.2-NC visible-light camera show that nuts and stones with similar colors have limited visual differences. Stones mixed with nuts can therefore be difficult to identify based on appearance alone.

Condition 2: SWIR Imaging Under Natural Light

Swir033au短波红外相机拍摄同色坚果和石子
Swir033au短波红外相机拍摄同色坚果和石子

When captured using the SWIR035AU camera, nuts and stones show more noticeable grayscale differences than in visible-light images.Stones appear darker due to their relatively lower SWIR reflectance, while nuts appear brighter.

Condition 3: SWIR Imaging with 1300 nm Illumination

Swir033au短波红外相机在1300nm滤光片和光源补光下拍摄同色坚果和石子

After adding a 1300 nm infrared light source, the overall image brightness increases and the grayscale separation between nuts and stones becomes more pronounced. The additional illumination improves the visibility of darker stone regions against brighter nut regions.

Condition 4: SWIR Imaging with a 1300 nm Light Source and Optical Filter

Swir033au短波红外相机在1300nm光源补光下拍摄同色坚果和石子

When a 1300 nm optical filter is used together with the infrared light source, the image shows the strongest visual separation between nuts and stones among the tested configurations.Stones appear darker, while nuts remain relatively bright.

4.2 Quantitative Contrast Analysis

To evaluate the grayscale separation between nuts and stones, the normalized grayscale difference was calculated using the following formula:

Contrast = (I_nuts − I_stones) / 255.

Where:

  • (I_nuts) represents the average grayscale value of the nuts.
  • (I_stones}}) represents the average grayscale value of the stones.
  • 255 represents the full grayscale range of an 8-bit image.

The measured results are shown below:

Imaging ConditionNut GrayscaleStone GrayscaleNormalized Grayscale Difference
Direct SWIR035AU Imaging130.993.80.15
With 1300 nm Illumination135.289.20.18
With 1300 nm Illumination and Optical Filter116.567.90.19

The results show that the normalized grayscale difference increases from 0.15 under direct SWIR imaging to 0.18 with 1300 nm illumination.

When both the 1300 nm light source and optical filter are used, the value reaches 0.19, the highest among the three tested configurations.

These results indicate that additional infrared illumination and optical filtering can improve the grayscale separation between nuts and stones, making foreign objects easier to distinguish in SWIR images.

Conclusion

This experiment demonstrates the ability of the AttosTek SWIR035AU short-wave infrared camera to distinguish nuts from similarly colored stones under the tested imaging conditions.

While visible-light imaging provides limited visual contrast between the samples, SWIR imaging reveals differences in their grayscale responses, allowing the two materials to be distinguished more clearly.

Among the tested configurations, combining a 1300 nm infrared light source with a 1300 nm optical filter produces the highest normalized grayscale difference, increasing the value from 0.15 to 0.19 compared with direct SWIR imaging.

The results demonstrate the potential of the SWIR035AU camera for foreign material detection in nut processing and food sorting applications.

Looking for an SWIR camera for food inspection and foreign object detection?
Contact AttosTek to learn more about the SWIR035AU camera and its potential applications in industrial inspection.

Quick Consultation
Do you need more information about this solution?
Contact US
Share To:

latest articles

My experiment involves two cameras capturing images of the same object at the same time. Can your software handle this?

Yes. We can offer two solutions: Option 1: Use the software to connect and open multiple cameras at the same time, achieving synchronized multi-camera imaging, and you can save all the images to the same path. Option 2: Use another software that supports running two instances simultaneously, each performing multi-camera imaging, and you can save the images to different paths.
View details

How do you check if a camera is dropping frames?

If you're using trigger mode, you can directly compare the number of triggers to the final frame count of the camera. If you're using video mode, you can check for frame drops by looking at the continuity of the frame numbers.
View details

What’s the difference between optocoupler-isolated and non-isolated signals?

Optocoupler isolation will optimize the input trigger signal, while non-isolated signals won't. If the trigger signal quality is poor (has glitches), it might trigger falsely. If the trigger signal quality is good, it's recommended to use non-isolated signals, as its input rise delay (TDR) is only 0.02µs.
View details