[Solved] UnitV unable to find april-tags



  • I can detect april-tags with the StickV, but not with the UnitV AI camera. For the UnitV I use the same code, but without the LCD calls. Here's the code:

    import sensor
    import image  
    import math
    
    print("start script")
    
    sensor.reset()
    sensor.set_pixformat(sensor.RGB565)
    sensor.set_framesize(sensor.QQVGA) # 160 x 120 pixel
    sensor.run(1) 
    sensor.skip_frames(30)
    
    print("start loop...")
    
    while True: 
        img=sensor.snapshot()
        tags = img.find_apriltags() # defaults to TAG36H11 without “families”.   
        if len(tags) > 0:
            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)
    

    I have uploaded the latest firmware. What can be the reason that no april-tags are detected?



  • In addition to the code, here are some screenshots:

    M5StickV with the above code:
    M5StickV
    As you can see, the april tags are detected correctly (output in the serial terminal)

    UnitV with the same code:
    UnitV
    No tags are detected...

    Same firmware, same MaixPy version, same code... But a different behavior...



  • OK, I found the cause: The image from the camera was mirrored. So the tag could not be detected. I found the error when I tried to detect QR codes:

    UnitV QRcode failure

    Then I added the following line of code to mirror the image:

    sensor.set_vflip(1)
    

    After that, the QR code was detected correctly:

    UnitV QRcode correctly

    Now, also april tags are working:

    UnitV april tag correctly



  • Nice one, what firmware are you using for the UnitV?



  • @kylebuttress Same as for the M5StickV
    M5StickV_Firmware_v5.1.2.kfpkg
    and
    maixpy_v0.5.0_98_gbd7c7ab_m5stickv.bin

    downloaded here:
    https://dl.sipeed.com/MAIX/MaixPy/release/master



  • @hague thanks for the info that's a newer version than I have cheers