logo

img.draw_rectangle(b[0:4]) 中的b[0:4]是什么意思

2019-07-28 16:49
R
黄小婷
        for b in blob:       

            img.draw_rectangle(b[0:4]) # rect

            img.draw_cross(b[5], b[6]) # cx, cy

            x = b.cx()

            y = b.cy()

            data = bytearray([x,y])

            uart.write(data)

请问这段代码中 img.draw_rectangle(b[0:4]) 中的b[0:4]是什么意思;以及这里的在区域blob迭代的b究竟代表了什么?一个个像素点吗?但是这样的话之后的画十字与矩形又是用之前的区域框画的吗?

        if blob.elongation() > 0.5:
            img.draw_edges(blob.min_corners(), color=(255,0,0))
            img.draw_line(blob.major_axis_line(), color=(0,255,0))
            img.draw_line(blob.minor_axis_line(), color=(0,0,255))

请问这段代码的作用是什么?去函数库里找并未找到相关的(blob.major_axis_line()与(blob.minor_axis_line()

非常感谢!

2019-07-29 16:37
I
网红小智智 星瞳科技

https://book.openmv.cc/image/blob.html#blob%E8%89%B2%E5%9D%97%E5%AF%B9%E8%B1%A1

I
网红小智智 星瞳科技

每个问题单独发帖子

2019-08-06 12:24
7
chew

0到3的元素。。。。。。。。。。。