Routine description 12-AMG8833_overlay AMG8833 overlay
import sensor, image, time, fir
ALT_OVERLAY = False
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)
fir.init(type=fir.FIR_AMG8833)
extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565)
clock = time.clock()
while (True):
clock.tick()
img = sensor.snapshot()
ta, ir, to_min, to_max = fir.read_ir()
if not ALT_OVERLAY:
fir.draw_ir(img, ir)
else:
extra_fb.clear()
fir.draw_ir(extra_fb, ir, alpha=256)
img.blend(extra_fb, alpha=128)
img.draw_string(8, 0, "Ta: %0.2f C" % ta, color = (255, 0, 0), mono_space = False)
img.draw_string(8, 8, "To min: %0.2f C" % to_min, color = (255, 0, 0), mono_space = False)
img.draw_string(8, 16, "To max: %0.2f C"% to_max, color = (255, 0, 0), mono_space = False)
img.compress(quality=90)
print(clock.fps())