WiFi Access Point Mode Thermal Camera with interpolation
The AMG8833 is a sensor by Panasonic that allows to measure temperatures of a surface. The area is broken down into 64 parts as an 8x8 matrix. This sensor allows for up to 10 thermal measurements per second. In normal use cases, this is just fine and can be used as is. For this project I used the Feather HUZZAH with ESP8266 and the IR Thermal Camera FeatherWing from Adafruit. If we want to build a thermal camera, 8x8 is not a high resolution. we can use interpolation to infer data points between known data points.
The simplest type of interpolation we could use is bilinear. The algorithm for calculating bilinear interpolation can be easily found. A simple javascript implementation is as follows:
Bilinear interpolation works well, but the end result can still be a bit rough. I read about bicubic interpolation and how it is used to resize images. In the case of bicubic interpolation 16 points are used instead of 4, as the slopes on x and y are also required. I decided to try bicubic interpolation out to see if there was any improvement. I implemented a quick version based on a common matrix based algorithm. I added some quick code to handle the border. There are different ways to set values for imaginary exterior points. I wanted a quick test, so I decided to set them to zero. This will result in bad data near the border. The implementation is as follows:
Here are a few samples of the results:
Hand no interpolation:
Hand bilinear interpolation 4x:
No interpolation, selfie:
Bilinear interpolation, selfie:
Bicubic interpolation, selfie:
I am very satisfied with the results I got from the bilinear interpolation. I tried out both algorithms in Java and tested with some images and I was not able to see a noticeable difference. For an aplication like this, I’d stick to the simpler bilinear interpolation, specially since there is not much room to get 4x4 temperature data.
There are a couple of applications I can think of for this sensor, as well as reasons to pair it with the ESP8266. Some of these could be: Anonymosly counting people, baby crib overhead temperature monitoring, stove monitoring. By using the ESP8266 in AP mode, it should be easy to put in place and configure the sensor by only using a phone.