openmv识别到数字后出现的白框怎么找到框的四角x,y坐标,用那些函数实现?
-
-
如果你说的是模板匹配,那么它是rect类
https://docs.singtown.com/micropython/zh/latest/openmvcam/library/omv.image.html#image.rect
-
@kidswong999 就是那个矩形框是的代码是draw-rectangle(r),r是识别的数字模板,怎么返回识别到框出这个数字白框的四角坐标和中心坐标
-
while(True): clock.tick() img = sensor.snapshot() for r in img.find_rects(threshold = 10000): img.draw_rectangle(r.rect(), color = (255, 0, 0)) print("x:", r.x()) print("y:", r.y()) print("w:", r.w()) print("h:", r.h()) print("cx:", r.x()+r.w()/2) print("cy:", r.y()+r.h()/2)