导航

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

    xlcq

    @xlcq

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

    xlcq 关注

    xlcq 发布的帖子

    • 为什么会出现reset failed和capture failed 啊
      import sensor, image, time, pyb
      from pyb import Pin
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565) # 灰度更快
      sensor.set_framesize(sensor.QQVGA)
      sensor.skip_frames(time = 2000)
      clock = time.clock()
      led1 = pyb.LED(1)
      
      while(True):
          clock.tick()
          
          img = sensor.snapshot()
      
          
          img = sensor.snapshot().lens_corr(1.8)
          
          for c in img.find_circles(threshold = 3500, x_margin = 10, y_margin = 10, r_margin = 10,r_min = 2, r_max = 100, r_step = 2):
              img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))
              print(c)
      
          for r in img.find_rects(threshold = 10000):
              img.draw_rectangle(r.rect(), color = (255, 0, 0))
      
              print(r)
      
          print("FPS %f" % clock.fps())
          print("FPS %f" % clock.fps())
          circles=img.find_circles(threshold = 3500, x_margin = 10, y_margin = 10, r_margin = 10,r_min = 2, r_max = 100, r_step = 2)
          rects=img.find_rects(threshold = 10000)
          if circles:
             led1.on()
             time.sleep(3000)
             led1.off()
             time.sleep(100)
             led1.on()
             time.sleep(3000)
             led1.off()
             time.sleep(100)
      
          if rects:
              p_out=Pin('A8',Pin.OUT_PP)
              p_out.high()
      

      0_1646223596230_{@%L307XO8TJ6NY%OH_T16N.png 0_1646223599802_9U1MCJWQN5G@@HK~X01UE}N.png

      发布在 OpenMV Cam
      X
      xlcq
    • 识别到圆形之后,小灯1闪烁,应该怎么做?

      import sensor, image, time, pyb

      sensor.reset()
      sensor.set_pixformat(sensor.RGB565) # 灰度更快
      sensor.set_framesize(sensor.QQVGA)
      sensor.skip_frames(time = 2000)
      clock = time.clock()
      led1 = pyb.LED(1)

      while(True):
      clock.tick()

      for c in img.find_circles(threshold = 3500, x_margin = 10, y_margin = 10, r_margin = 10,r_min = 2, r_max = 100, r_step = 2):
          img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))
          print(c)
      
      
      print("FPS %f" % clock.fps())
      led1.on()
      time.sleep(3000)
      led1.off()
      time.sleep(100)
      led1.on()
      time.sleep(3000)
      led1.off()
      time.sleep(100)
      发布在 OpenMV Cam
      X
      xlcq