mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
16 lines
361 B
Python
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
|