Книга: OpenMV Development Workshop
Назад: 9.1 Machine Vision
Дальше: 9.3 Face Detection

9.2 Finding Objects

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.

o9-1


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.

o9-2


Назад: 9.1 Machine Vision
Дальше: 9.3 Face Detection

Kirajes
Здесь можно Suninat 50mg (Сунитиниб) - Сунинат (Sunitinib) - аналог Сутент купить. Лекарство назначают больным, страдающим от онкологии желудка, кишечника, поджелудочной железы, полипов толстой кишки, новообразований в почке и прочих злокачественных опухолей, связанных с желудочно-кишечным трактом. сутент купить +в москве