导航

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

    xagi

    @xagi

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

    xagi 关注

    xagi 发布的帖子

    • 为什么优盘J里的main.导不进IDE

      0_1616236726588_屏幕截图 2021-03-20 183831.png

      发布在 OpenMV Cam
      X
      xagi
    • 为什么识别红色物块,绿色物块都很好,但是蓝色就识别不出来
      # Multi Color Blob Tracking Example
      #
      # This example shows off multi color blob tracking using the OpenMV Cam.
      
      import sensor, image, time, math
      
      # Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max)
      # The below thresholds track in general red/green things. You may wish to tune them...
      thresholds = [(30, 100, 15, 127, 15, 127), # generic_red_thresholds
                    (30, 100, -64, -8, -32, 32), # generic_green_thresholds
                    (0, 15, 0, 40, -80, -20)] # generic_blue_thresholds
      # You may pass up to 16 thresholds above. However, it's not really possible to segment any
      # scene with 16 thresholds before color thresholds start to overlap heavily.
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      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()
      
      # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are
      # returned by "find_blobs" below. Change "pixels_threshold" and "area_threshold" if you change the
      # camera resolution. Don't set "merge=True" becuase that will merge blobs which we don't want here.
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
          for blob in img.find_blobs(thresholds, pixels_threshold=1000, area_threshold=1000):
              # These values depend on the blob not being circular - otherwise they will be shaky.
              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))
              # These values are stable all the time.
              img.draw_rectangle(blob.rect())
              img.draw_cross(blob.cx(), blob.cy())
              # Note - the blob rotation is unique to 0-180 only.
              img.draw_keypoints([(blob.cx(), blob.cy(), int(math.degrees(blob.rotation())))], size=20)
          #print(clock.fps())
              print(blob.code())
      
      发布在 OpenMV Cam
      X
      xagi