Example: 01-Camera/03-Event-Cameras/02-Genx320/genx320_grayscale_with_tracking.py
import sensor
import time
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.B320X320)
clock = time.clock()
while True:
clock.tick()
img = sensor.snapshot()
blobs = img.find_blobs(
[(120, 130)], invert=True, pixels_threshold=10, area_threshold=100, merge=True
)
for blob in blobs:
img.draw_rectangle(blob.rect(), color=(255, 255, 255))
img.draw_cross(blob.cx(), blob.cy(), color=(0, 0, 0))
print(clock.fps())