ThermApp "Wild"


Download


FAQ

What is ThermApp?
It is a thermal imaging camera for Android devices, available from therm-app.com.

What is ThermApp Wild?
In order to use the ThermApp camera, you need an Android App that can talk to the camera, like the default ThermApp Basic.
Opgal have made the SDK available to developers, so I decided to write my own app, which I'm informally calling "ThermApp Wild" (for "wildlife").

Why write your own App?
I found the basic app lacking in some ways that seemed simple to address. Also, I wanted features customized to my own use for wildlife detection, often in the cold (thus "glove mode"). For more information, see my blog: infrared-birding.blogspot.com.

Why isn't it polished or on Google Play?
Since this is just a side activity for personal use, I didn't want to deal with unnecessary distractions, like appearance (getting an app to "look good" is an annoyingly time-consuming aspect of app development), tech support, etc. But I don't mind sharing the app, or even the source code, as long as you accept it "as is".

Are there other apps available??
If you don't already know about it, check out also Bill's ThermApp Plus, currently available for Beta testing.


Quick Guide


Lossless PNG


Hotspot Detection

The current hotspot-detection algorithm divides the frame into tiles of 16x16 pixels.
The max temperature of each tile is recorded, unless it is at the edge of the frame[1].
A tile is hot if it is in the top 10% of the temperature range.

A hot frame is reported when all of the following conditions are satisfied:
  1. The hot tiles all occur within a 2x2 block (i.e., there are at most 4 hot tiles, and they're all confined to one area);
  2. The lowest hot tile temperature is 10% warmer than the highest non-hot tile -- excluding a 1-tile buffer around the hot block.
  3. The reported temperature spread is at least 2.5C.
  4. 2 successive frames satisfy the above conditions.
All of the numbers in bold are default parameters that can be configured in the preferences menu.

Rationale

The idea behind this algorithm is to detect a relatively small (localized) object that is significantly warmer than the surroundings. Excluding edge temperatures (condition [1] above) handles the case when, e.g., moving from a large region of cool background to a large region of warm background, there could be a frame where only a small piece of the large warm region is present at a corner or edge of the frame. Waiting two successive frames is also meant to filter out similar false positives.

The tile-based approach is also chosen for performance reasons (it is more probabilitic in nature than, say, a histogram-based approach). Because I'm coding entirely in Java, it turns out that for the 25Hz version I can only afford to iterate the full temperature frame once.


TODO list

Roughly in priority order:
  - min/max manual temperature adjustment.
  - hotspot-based max temperature setting.
  - new color palettes.
  - interpolate background delta from two background images.
Wish list:
  - non-linear color mapping (probably what the current "night vision"
    mode does, except in color).
  - take video.
At this point I'm not likely to implemented these because a Java-based implementation will likely be too slow for the 25Hz version (though still acceptable with the 9Hz version), and I'm too lazy to figure out how to work with the NDK. Also, Bill has already done it in his ThermApp Plus.


Release Notes

2016-04-08:
 - min/max locking (but no adjustment afterwards).
 - "tile"-mode hotspot detection replaces histogram-based ones.
 - when a hotspot is detected, the image is rendered in an inset window.
 - switch to using a signed release.apk instead of a debug.apk.
 - saved images prefixed with "tw" instead of "ta".

2015-10-08:
 - ported to ThermApp SDK 2.0.1 with Lollipop support.

2015-02-19:
 - hotspot detection.
 - option to rotate display (0,90,180,270).
 - saved jpg reflects device orientation.
 - option to disable saving lossless PNG.
 - Note: button behaviors have changed.

2015-02-02:
 - apparently fixed bad pixels in background that sometimes happens when
   it is too cold.
 - save both png and jpg.

2015-01-??:
 - initial version: saves lossless PNG in portrait orientation.

Suan Hsi Yong -- Up to homepage