Explication de la routine 27-Lepton-> lepton_hotspot_grayscale_color_tracking_lcd Écran LCD de suivi des couleurs en niveaux de gris du point d'accès
import sensor, image, time, math, lcd
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.init()
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.display(img)
print(clock.fps())