
import pyb, sensor, image, math
sensor.reset()
sensor.set_framesize(sensor.QVGA)
sensor.set_pixformat(sensor.GRAYSCALE)
low_threshold = (0, 50)
while(True):
for i in range(100):
img = sensor.snapshot()
img.binary([low_threshold])获取中间的,直接find_blobs就行。https://singtown.com/learn/49993/