mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
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.
22 lines
698 B
Python
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))
|