To get a good signal it is easiest to get rid of most if not all visible light. We'll look at IR pass filters that make our IR LED ring light stand out more from the background.

Filters

To filter all visible light I ordered a couple of IR pass camera filters. The filters are as follows (descriptions from manual):

  • 720nm for indoor and weak light use
  • 760nm for cloudy outdoor at nightfall and brightness indoor
  • 850nm for indoor and weak cloudy outdoor light
  • 950nm for outdoor and strong light, such as summer time.
Neewer IR pass filters along with Rapsberry Pi Roscolux #2007 Storaro Blue filter

I could not find much of actual specs on these filters. They should cut all wave lengths under the specified value. Meaning they should pass infrared light. There is a source describing these filters as "Dirt cheap". The cheapness may be evident in a slightly uneven finish. But since we will threshold everything in post processing, some very faint spots do not matter.

Blue square

In addition to proper filters I will test the blue square that comes with the camera.

This is a part of a strip of Roscolux #2007 Storaro Blue filter. The transmission chart shows this filter will pass both blue and infrared light. While it is great that most visible light is blocked, for this project we also want to get rid of blue light. So on paper the Neewer IR pass filters are a better fit for this use case. You can find more info on the Blue square filter on the Raspberrypi.org site.

Scene

The scene is close to a window allowing sunlight to enter the room. The sun seems to kick out light far into the IR spectrum. Far beyond the highest filter of 950nm. So I'm expecting background light for all filters.

The IR LEDs I'm using are specified as 850nm. This wavelength is well in the sensitivity range of the camera. A "drawback" on 850nm IR LEDs is that a faint glow can be seen with the human eye. Which in some cases might be a downside, but for this setup a futuristic glow is a plus.

I can't find a spectral response chart for these IR LEDs, but I'm expecting them to put out light between 800 and 900nm. That would mean that the 720nm, 760nm should work very well. The 850nm filter will block about half the IR LEDs output. And the 950nm filter should block all light from our powered light source.

Setup

All materials for this test.

The test will use the Raspberry Pi 4 along with the NoIR camera and IR ring described in earlier posts.

The IR ring, filter and camera are all mounted in a piece of foam. Makeshift, but strong enough for these tests.

IR Ring, camera IR pass filter and Raspberry Pi Camera V2 setup

Capture

The images a captured with raspistill.

The full command is:

DATE=$(date +"%Y-%m-%d_%H:%M:%S")
raspistill --vflip \
  --hflip \
  --timeout 3 \
  --mode 6 \
  --annotate "${TEXT}" \
  --annotateex +160+160 \
  -o $DATE.jpg

Note that this uses sensor mode 6, capturing part of the view. I could not easily get a grayscale image using luminance from raspistill, so the output image is in RGB.

White balance and the rest are kept on auto. There is a slight delay for everything to balance before taking the still.

The results:

Unfiltered without IR light source
Unfiltered image
Blue square filter
720nm pass filter
760nm pass filter
850nm pass filter
950nm pass filter
950nm pass filter without IR light source

The test images show that all the IR filters (including the blue square) limit background noise. But it is hard to evaluate the differences between the different filters in RGB. So let's look at just the luminance value by converting the images to grayscale:

for file in *.jpg
do
  base=${file%.jpg}
  convert $file -colorspace Gray "${base}_gray.jpg"
done

Here are the same images converted to grayscale (using image editor):

Unfiltered without IR light source (gray)
Unfiltered image (gray)
Blue square filter (gray)
720nm pass filter (gray)
760nm pass filter (gray)
850nm pass filter (gray)
950nm pass filter (gray)
950nm pass filter without IR light source (gray)

Remarkably there aren't big difference between the different IR filters results. The special camera filters don't seem to perform much better than the provided blue square.

By a small margin the 850 and 950nm filters are the winners, blocking out more background noise.

850nm or 950nm

So, for the marker recognition we'll use either the 850nm or 950nm filters.