logo

openmv识别到数字后出现的白框怎么找到框的四角x,y坐标,用那些函数实现?

2023-03-20 13:46
J
_4p3d

:smiling_face_with_open_mouth_cold_sweat: :smiling_face_with_open_mouth_cold_sweat: :smiling_face_with_open_mouth_cold_sweat: :smiling_face_with_open_mouth_cold_sweat: :smiling_face_with_open_mouth_cold_sweat: :smiling_face_with_open_mouth_cold_sweat: :smiling_face_with_open_mouth_cold_sweat: :smiling_face_with_open_mouth_cold_sweat:

2023-03-22 18:13
I
网红小智智 星瞳科技

如果你说的是模板匹配,那么它是rect类

https://docs.singtown.com/micropython/zh/latest/openmvcam/library/omv.image.html#image.rect

2023-03-24 10:14
J
_4p3d

@kidswong999 就是那个矩形框是的代码是draw-rectangle(r),r是识别的数字模板,怎么返回识别到框出这个数字白框的四角坐标和中心坐标:frowning_face: :frowning_face: :frowning_face: :frowning_face: :frowning_face: :frowning_face:

2023-03-27 14:38
I
网红小智智 星瞳科技
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)