Finding objects means we find objects based on their shape/mode. OpenMV provides library to find several object forms such as line, circle, rectangle, QRCode, BarCode. Further information, you can read this library on .
In this section, we try to find objects with circle form. Write this complete program on OpenMV IDE.
import sensor sensor.reset() sensor.set_pixformat(sensor.RGB565) # grayscale sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) while(True): img = sensor.snapshot().lens_corr(1.8) for c in img.find_circles(threshold = 2000, x_margin = 10, y_margin = 10, r_margin = 10): img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0)) print(c)
Save this program as findcircles.py.
Now you run this program. Shot camera to a circle object. It's should detect this object and then draw a circle.
If you shot a specific area that are many circle objects so OpenMV will draw many objects. Sometimes it's wrong due to camera noise.