Example: 01-Camera/05-Thermal-Cameras/01-FLIR-Lepton/lepton_hotspot_grayscale_color_tracking_lcd.py
import sensor
import time
import display
threshold_list = [(220, 255)]
print("Resetting Lepton...")
sensor.reset()
print(
"Lepton Res (%dx%d)"
% (
sensor.ioctl(sensor.IOCTL_LEPTON_GET_WIDTH),
sensor.ioctl(sensor.IOCTL_LEPTON_GET_HEIGHT),
)
)
print(
"Radiometry Available: "
+ ("Yes" if sensor.ioctl(sensor.IOCTL_LEPTON_GET_RADIOMETRY) else "No")
)
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.LCD)
sensor.skip_frames(time=5000)
clock = time.clock()
lcd = display.SPIDisplay()
while True:
clock.tick()
img = sensor.snapshot()
for blob in img.find_blobs(
threshold_list, pixels_threshold=200, area_threshold=200, merge=True
):
img.draw_rectangle(blob.rect(), color=127)
img.draw_cross(blob.cx(), blob.cy(), color=127)
lcd.write(img)
print(clock.fps())