openmv/usr/examples/fir.py
Kwabena W. Agyeman a74dd50eaf Improved IR code.
Return min and max from read_ir now. Also, made drawing functions take
IR values.

Example scripts have been updated to work with the new module code.
2016-03-24 19:52:00 -04:00

22 lines
698 B
Python

# Thermopile Shield Demo
#
# Note: To run this example you will need a Thermopile Shield for your OpenMV Cam.
#
# The Thermopile Shield allows your OpenMV Cam to see heat!
import sensor, image, time, fir
sensor.reset() # Initialize the camera sensor.
sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others)
fir.init() # Initialize the thermal sensor
clock = time.clock() # Tracks FPS.
while(True):
clock.tick()
ta, ir, min_temp, max_temp = fir.read_ir()
fir.display_ir(sensor.snapshot(), ir)
print("FPS: %f - Ambient Temp: %f C - Min Temp %f C - Max Temp %f C" % \
(clock.fps(), ta, min_temp, max_temp))