查找AprilTag实验代码出错

想实验一个查找aprilTag的功能,代码如下:
import sensor, image, time, math

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QQVGA)
sensor.set_hmirror(1)
sensor.set_vflip(1)
sensor.skip_frames(time = 2000)
#sensor.set_auto_gain(False) # must turn this off to prevent image washout…
#sensor.set_auto_whitebal(False) # must turn this off to prevent image washout…

clock = time.clock()
while(True):
clock.tick()
img = sensor.snapshot()
for tag in img.find_apriltags(): # defaults to TAG36H11 without “families”.
img.draw_rectangle(tag.rect(), color = (255, 0, 0))
img.draw_cross(tag.cx(), tag.cy(), color = (0, 255, 0))
degress = 180 * tag.rotation() / math.pi
print(tag.id(),degress)
运行后报错:
image
将分辨率改成QQVGA错误依旧。

Hi yuanding31,

I think that your firmware is too old.

I’ve confirmed in conditions as followings,
firmware: maixpy_master_2019_07_09_10_49_51_8ff0bd9.bin
http://dl.sipeed.com/MAIX/MaixPy/release/master/

ide: maixpy_v0.3.2
http://dl.sipeed.com/MAIX/MaixPy/release/maixpy_v0.3.2/

board: MAiX Dock

Hi sig9867,
Thanks a lot for the information.
Maix bit can identigy and track the AprilTag now.
image
Thanks again.

1 Like