mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Tried to emulate Arduino's 11 folders... I'd perfer to have all the shield scripts in one folder... but, that might not make sense. I don't really want one script per folder however. So, I might merge some more stuff in the future. I have a grand idea here that will become evident as I work though the examples. Anyway, the current structure is not final. It will be in flux for a little while. As for Git History, folder history is the best we're going to get. Git and GitHub don't seem to deal with moves too well.
25 lines
713 B
Python
25 lines
713 B
Python
import pyb, sensor, image, math
|
|
sensor.reset()
|
|
sensor.set_framesize(sensor.QVGA)
|
|
grayscale_thres = (170, 255)
|
|
rgb565_thres = (70, 100, -128, 127, -128, 127)
|
|
while(True):
|
|
sensor.set_pixformat(sensor.GRAYSCALE)
|
|
for i in range(100):
|
|
img = sensor.snapshot()
|
|
img.binary([grayscale_thres])
|
|
img.erode(2)
|
|
for i in range(100):
|
|
img = sensor.snapshot()
|
|
img.binary([grayscale_thres])
|
|
img.dilate(2)
|
|
sensor.set_pixformat(sensor.RGB565)
|
|
for i in range(100):
|
|
img = sensor.snapshot()
|
|
img.binary([rgb565_thres])
|
|
img.erode(2)
|
|
for i in range(100):
|
|
img = sensor.snapshot()
|
|
img.binary([rgb565_thres])
|
|
img.dilate(2)
|