A case so IR (night vision) works on the H7+

Circuit boards are very good at conducting infrared light. I think this causes the IR light to leak into the back of the camera sensor, washing out night vision images. This has previously been discussed on the forums. The solution was electrical tape, which was not working for me and was problematic in texas heat because the tape got melty.

I modified the existing open-source case and added a set of blinders, available as a Sketchup file. for forum IR blinders.skp - Google Drive

To make the blinders work, a little rectangle of tinfoil was placed into each blinder, making sure to cover the inside of the blinder that is closest to the camera board (sides toward the center of the board). So the tinfoil would stick, Elmer’s school glue stick or school glue is spread inside the blinder with a toothpick. Then, the foil inserted folded up to fit. Once inserted, the clean side of the toothpick was used to smooth the foil into the blinder, gently going over and over until the foil was perfectly smoothed and glued to the inside of the blinder.

To prevent foil edges from contacting the board, a q-tip was dipped in cheap acrylic craft paint (white liquid Elmer’s school glue would work, too.) The craft paint was daubed onto the lower and upper edges of the blinders, sealing the tinfoil in place, and creating a soft polymer lip to contact the board.

it took about 15 minutes to insert each set of blinders but now we have instantly functioning night vision by placing the H7+ into the blinder case. The case fits a bit tight, to block light, so it takes a couple of gentle insertions and removals of the H7+ board to wear the 3D printed plastic a bit and make it a quick change out.

We printed using Raise3D E2s and Geetech PETG and Geeetech PLA.

The model has an overhang for gluing a square of sponge. We used a carwashing sponge. It has a slit in it, to hold the USB cord so it won’t come loose or get pulled out during testing.

Here is a Sketchup file of the blinders. It is 1000X larger than the real size, because Sketchup is very bad at handling small details. Please resize inside your slicer software prior to printing.

I write a reminder inside each case to check that the tinfoil isn’t exposed and is safely covered with craft paint. I don’t want to short the board because there is metal contacting a component!

1 Like

Cool post, @Gazaah . Do you have before/after IR comparison pictures?

Thanks for the great writeup!

A bunch of my data is in *.bin files which are… hard to work with and share, so my nice videos won’t share usefully unless I unpack my H7 and run the bin file off it which is not straightforward.

So instead, here’s some not as good initial images where I had the wrong f-stop lens so it didn’t let enough light in!

This is before - think. The whole thing was washed out, so this is a good representation.

Here is after the blinders but with too little light reaching the camera chip due to the high f-stop on the lens. When using a low f-stop lens the image has no graininess and looks really good. You can see a house gecko wandering among debris.

You can convert the bin files by using the the ide tools to convert the file to any format. We have full ffmpeg support to turn the bin file into anything.

See the video converter under tools.

Thanks! At what distance was the gecko, did you use any optics or waveguide to maximise the illumination?

Once we used a low F-stop lens, we got clear images between macro and 2 meters with the built-in IR LEDs. We used an Edmunds 8mm f1.9 Green Lens and got great photos. We didn’t always focus them properly but the lighting was adequate just from the H7 for our blob detection. The farther away we went the more grain we got, so once we were a couple meters away we had a fair amount of grain to contend with, mucking up our background removal. We were using a fairly close-up application, but you can see the light falloff from our distance test photos, as well as the shadows caused by the blinders in these photos.

Here are some distance tests with dark versus reflective backgrounds.

18 inches dark vs reflective background


24 inches dark vs reflective background

36 inches dark versus reflective background

I pulled open my student worker’s code, here were the lighting settings for our IR photos

#–White Balance
Red = 61.0 # Red balance setting for white balance.
Green = 59.0 # Green balance setting for white balance.
Blue = 60.0 # Blue balance setting for white balance.
#—Contrast and Brightness
Contrast = 3 # Constrast setting. Goes by whole numbers from -3 to 3. This makes the image clearer in more exposed conditions.
Brightness = 0 # Brightness setting. Goes by whole numbers from -3 to 3. Change this only when the image either is too bright or not bright enough for your conditions!

sensor.set_auto_whitebal(False, rgb_gain_db = (Red, Green, Blue))

Thanks! You might consider using wave guides (Waveguide / optical fiber for onboard LEDs - #4 by darrask) to direct the light better, as well as adaptive histogram equalisation ( image.histeq) to improve local contrast.