导航

    • 登录
    • 搜索
    • 版块
    • 产品
    • 教程
    • 论坛
    • 淘宝
    1. 主页
    2. wnhp
    W
    • 举报资料
    • 资料
    • 关注
    • 粉丝
    • 屏蔽
    • 帖子
    • 楼层
    • 最佳
    • 群组

    wnhp

    @wnhp

    0
    声望
    2
    楼层
    296
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录

    wnhp 关注

    wnhp 发布的帖子

    • 调用多颜色识别例程时,视野中两个颜色,blob.code()输出应该为3,实际输出为1 2,why?

      😞

      发布在 OpenMV Cam
      W
      wnhp
    • 多颜色识别时,有黄色和蓝色时,print(blob.code())输出不应该是6嘛?但输出是2 4,请问这是为什么?
      
      import sensor, image, time, math
      
      thresholds = [(70, 30, 25, 61, 32, -22), # generic_red_thresholds -> index is 0 so code == (1 << 0)
                    (31, 95, -1, 53, 71, 17), # generic_YELLOW_thresholds -> index is 1 so code == (1 << 1)
                    (75, 25, -18, 22, -21, -63)]# generic_blue_thresholds
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QQVGA)
      sensor.skip_frames(time = 2000)
      sensor.set_auto_gain(False) # must be turned off for color tracking
      sensor.set_auto_whitebal(False) # must be turned off for color tracking
      clock = time.clock()
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
          for blob in img.find_blobs(thresholds,merge=True, pixels_threshold=200, area_threshold=200): 
              img.draw_rectangle(blob.rect())
              img.draw_cross(blob.cx(), blob.cy())
              print(blob.code())
      
      

      0_1682428833499_123.png

      发布在 OpenMV Cam
      W
      wnhp