Code: Select all
extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565)
extra_fb.replace(img)
Code: Select all
extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565)
extra_fb.replace(img)
Code: Select all
img = sensor.snapshot()
new_fb = img.binary([white_threshold], copy=True, to_bitmap=True)
print(new_fb.compress_for_ide(), end="")
time.sleep(0.2)
Code: Select all
import sensor, image, time
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
white_threshold = (60, 100, -128, 127, -128, 127)
while True:
clock.tick()
img = sensor.snapshot()
new_fb = img.binary([white_threshold], to_bitmap=True, copy=True)
print(new_fb.compressed(), end="")
time.sleep(200)
for r in new_fb.find_rects(threshold = 5000):
img.draw_circle(r.x()+r.w()//2, r.y()+r.h()//2, r.w()//2, color = (0, 255, 0))
print("FPS %f" % clock.fps())
Code: Select all
while True:
clock.tick()
img = sensor.snapshot()
new_fb = img.binary([white_threshold], to_bitmap=True, copy=True)
print(new_fb.compressed_for_ide(), end="")
time.sleep(200)
print("FPS %f" % clock.fps())
Code: Select all
import sensor, image, time
sensor.reset()
sensor.set_pixformat(sensor.RGB565) # grayscale is faster (160x120 max on OpenMV-M7)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565)
white_threshold = (20, 100, -45, 127, -13, 127)
while True:
clock.tick()
img = sensor.snapshot()
extra_fb.replace(img)
extra_fb.binary([white_threshold])
print(extra_fb.compressed_for_ide(), end="")
time.sleep(200)
print("FPS %f" % clock.fps())
Users browsing this forum: Jhett and 6 guests