šŸ¤–Have you ever tried Chat.M5Stack.com before asking??šŸ˜Ž
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    [Solved] UnitV unable to find april-tags

    Scheduled Pinned Locked Moved Units
    7 Posts 3 Posters 14.9k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • hagueH Offline
      hague
      last edited by hague

      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?

      1 Reply Last reply Reply Quote 0
      • hagueH Offline
        hague
        last edited by

        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...

        1 Reply Last reply Reply Quote 0
        • hagueH Offline
          hague
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • K Offline
            kylebuttress
            last edited by

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

            hagueH 1 Reply Last reply Reply Quote 0
            • hagueH Offline
              hague @kylebuttress
              last edited by

              @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

              K 1 Reply Last reply Reply Quote 0
              • K Offline
                kylebuttress @hague
                last edited by

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

                1 Reply Last reply Reply Quote 0
                • M Offline
                  maicongoe
                  last edited by

                  @hague good to see! Could you tell me how fast it can run? FPS and at resolution? Thanks!

                  1 Reply Last reply Reply Quote 0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better šŸ’—

                  Register Login
                  • First post
                    Last post