import sensor, image, time
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
while(True):
clock.tick()
img = sensor.snapshot()
img.grayscale_to_binary(128)
print(clock.fps())
OpenMV本来也没有这个grayscale_to_binary函数,这个函数是你猜的名字。
灰度二值化
http://book.openmv.cc/example/04-Image-Filters/grayscale-binary-filter.html
彩色二值化
http://book.openmv.cc/example/04-Image-Filters/color-binary-filter.html