Here is a short video of it in action just using 1 binary copy with just red threasholding see - YouTube
and here is the code that was running to make that video
import sensor, image, time, mjpeg
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)
red_threshold = (17, 70, 29, 73, -25, 50) # L A B
while True:
clock.tick()
img = sensor.snapshot()
extra_fb.replace(img)
extra_fb.binary([red_threshold])
extra_fb.erode(1)
for r in extra_fb.find_rects(threshold = 100):
if r.w()<25:
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())