openmv/usr/examples/blob_detection.py
2014-03-19 01:44:47 +02:00

16 lines
361 B
Python

import sensor, imlib, time
clock = time.clock()
while (True):
# take snapshot
image = sensor.snapshot()
# detect blobs
imlib.threshold(image, (255, 127, 127), 48)
clock.tick()
imlib.median(image, 3)
blobs = imlib.count_blobs(image)
image = sensor.snapshot()
for r in blobs:
imlib.draw_rectangle(image, r)
break