导航

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

    5af6 发布的帖子

    • RE: AttributeError: 'NoneType' object has no attribute 'theta'

      @kidswong999 原来如此,谢谢!

      发布在 OpenMV Cam
      5af6
    • RE: AttributeError: 'NoneType' object has no attribute 'theta'

      报错指向最后一行代码,有的时候程序能够正常运行,可以输出最后一行代码的两个值

      发布在 OpenMV Cam
      5af6
    • AttributeError: 'NoneType' object has no attribute 'theta'
      THRESHOLD = (153, 255) # Grayscale threshold for dark things...
      
      #设置是否使用img.binary()函数进行图像分割
      BINARY_VISIBLE = True # 首先执行二进制操作,以便您可以看到正在运行的线性回归
      
      import sensor, image, time
      
      sensor.reset()
      sensor.set_pixformat(sensor.GRAYSCALE)
      sensor.set_framesize(sensor.QQVGA)
      sensor.skip_frames(time = 2000)
      clock = time.clock()
      
      while(True):
          clock.tick()
          img = sensor.snapshot().binary([THRESHOLD]) if BINARY_VISIBLE else sensor.snapshot()
          singleline_check = img.get_regression([(255,255) if BINARY_VISIBLE else THRESHOLD],robust = True)
      
          if (singleline_check): img.draw_line(singleline_check.line(), color = 127)
          print("FPS %f, mag = %s" % (clock.fps(), str(singleline_check.magnitude()) if (singleline_check) else "N/A"))
          print(singleline_check.theta(),singleline_check.rho())
      
      发布在 OpenMV Cam
      5af6