导航

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

    k5wh

    @k5wh

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

    k5wh 关注

    k5wh 发布的帖子

    • 不是阈值的问题,我用的是黑色的阈值,如果是阈值的问题根本得不到这条白线,况且小车没有得到直线后一个轮子转一个轮子不转?
      THRESHOLD = (0, 50, -24,-1, -18, 6) # Grayscale threshold for dark things...
      import sensor, image, time
      from pyb import LED
      import car
      from pid import PID
      rho_pid = PID(p=0.4, i=0)
      theta_pid = PID(p=0.001, i=0)
      
      #LED(1).on()
      #LED(3).on()
      
      sensor.reset()
      sensor.set_vflip(True)
      sensor.set_hmirror(True)
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QQQVGA) # 80x60 (4,800 pixels) - O(N^2) max = 2,3040,000.
      #sensor.set_windowing([0,20,80,40])
      sensor.skip_frames(time = 2000)
      clock = time.clock()
      
      while(True):
          clock.tick()
          img = sensor.snapshot().binary([THRESHOLD])
          line = img.get_regression([(100,100,0,0,0,0)], robust = True)
          if (line):
              rho_err = abs(line.rho())-img.width()/2
              if line.theta()>90:
                  theta_err = line.theta()-180
              else:
                  theta_err = line.theta()
              img.draw_line(line.line(), color = 127)
              print(rho_err,line.magnitude(),rho_err)
              if line.magnitude()>8:
                  #if -40<b_err<40 and -30<t_err<30:
                  rho_output = rho_pid.get_pid(rho_err,1)
                  theta_output = theta_pid.get_pid(theta_err,1)
                  output = rho_output+theta_output
                  car.run(50+output, 50-output)
              else:
                  car.run(0,0)
          else:
              car.run(50,-50)
              pass
          #print(clock.fps())
      
      

      得不到线性回归后的直线

      发布在 OpenMV Cam
      K
      k5wh
    • RE: openmv升级固件后用与官网巡线小车相同的代码,但是得不出线性回归的直线。

      我认为不是阈值的问题,我用的是黑色的阈值,如果是阈值的问题根本得不到这条白线,我把阈值改成了默认的后,连二值化后的白线都没了。况且小车没有得到直线后一个轮子转一个轮子不转

      发布在 OpenMV Cam
      K
      k5wh
    • openmv升级固件后用与官网巡线小车相同的代码,但是得不出线性回归的直线。

      0_1617246855765_2c94fda0-f51a-4486-b2b6-647ce50340e1-image.png

      发布在 OpenMV Cam
      K
      k5wh
    • RE: 为什么更新固件后很多函数的形式参数不再支持浮点型只支持整型?

      想问一下,哪儿需要转int,我也发生了一样的情况,感谢

      发布在 OpenMV Cam
      K
      k5wh