导航

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

    qtw_dr

    @qtw_dr

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

    qtw_dr 关注

    qtw_dr 发布的帖子

    • RE: 请问能否解释以下这段测距的代码

      @yuan 那么请问这个输出数据的单位是mm吗

      发布在 OpenMV Cam
      Q
      qtw_dr
    • 请问能否解释以下这段测距的代码

      import sensor, image, time

      yellow_threshold = ( 56, 83, 5, 57, 63, 80)

      sensor.reset() # Initialize the camera sensor.
      sensor.set_pixformat(sensor.RGB565) # use RGB565.
      sensor.set_framesize(sensor.QQVGA) # use QQVGA for speed.
      sensor.skip_frames(10) # Let new settings take affect.
      sensor.set_auto_whitebal(False) # turn this off.
      clock = time.clock() # Tracks FPS.

      K=5000#the value should be measured

      while(True):
      clock.tick() # Track elapsed milliseconds between snapshots().
      img = sensor.snapshot() # Take a picture and return the image.

      blobs = img.find_blobs([yellow_threshold])
      if len(blobs) == 1:#为什么列表的长度是1?
          b = blobs[0]
          img.draw_rectangle(b[0:4]) # rect
          img.draw_cross(b[5], b[6]) # cx, cy
          Lm = (b[2]+b[3])/2
          length = K/Lm
          print(length)
      发布在 OpenMV Cam
      Q
      qtw_dr