导航

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

    btck

    @btck

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

    btck 关注

    btck 发布的帖子

    • openmv如何与飞控进行通讯,通过openmv识别颜色给飞控一个坐标点,飞控控制无人机飞行

      openmv如何与飞控进行通讯,通过openmv识别颜色给飞控一个坐标点,飞控控制无人机飞行

      发布在 OpenMV Cam
      B
      btck
    • 如何在同时识别颜色和圆形时,获得坐标,求大佬帮帮忙,新手
      import sensor, image, time
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      sensor.skip_frames(time = 3000)
      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()
      def draw_hori_line(img, x0, x1, y, color):
          for x in range(x0, x1):
              img.set_pixel(x, y, color)
      # 绘制竖直线
      def draw_vec_line(img, x, y0, y1, color):
          for y in range(y0, y1):
              img.set_pixel(x, y, color)
      
      while(True):
          clock.tick()
          img = sensor.snapshot().lens_corr(1.8)
          for c in img.find_circles(threshold = 8500, x_margin = 30, y_margin = 30, r_margin = 5,
                  r_min = 10, r_max = 11, r_step = 2):
              area = (c.x()-c.r(), c.y()-c.r(), 2*c.r(), 2*c.r())
              #area为识别到的圆的区域,即圆的外接矩形框
              statistics = img.get_statistics(roi=area)#像素颜色统计
              print(statistics)
              #(0,100,0,120,0,120)是红色的阈值,所以当区域内的众数(也就是最多的颜色),范围在这个阈值内,就说明是红色的圆。
              #l_mode(),a_mode(),b_mode()是L通道,A通道,B通道的众数。
              if 19<statistics.l_mode()<53 and -7<statistics.a_mode()<78 and -4<statistics.b_mode()<64:#if the circle is red
                  img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))#识别到的红色圆形用红色的圆框出来
              elif 0<statistics.l_mode()<30 and -9<statistics.a_mode()<20 and -34<statistics.b_mode()<17:#if the circle is red
                  img.draw_circle(c.x(), c.y(), c.r(), color = (0, 0, 255))#识别到的红色圆形用红色的圆框出来
          print("FPS %f" % clock.fps())
      
      发布在 OpenMV Cam
      B
      btck
    • RE: 请问如何用OpenMV识别同心圆,如何解决无人机下降过程中图像变大导致OpenMV识别不到同心圆的中心环问题

      @argl 老哥解决了吗

      发布在 OpenMV Cam
      B
      btck
    • RE: 颜色形状同时识别,我只想识别多个圆环中间那个圆点

      那请问我该在哪行代码中进行更改找到最小的圆

      发布在 OpenMV Cam
      B
      btck
    • 颜色形状同时识别,我只想识别多个圆环中间那个圆点

      0_16306743880786A1D.png

      import sensor, image, time
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QQVGA)
      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()
      def draw_hori_line(img, x0, x1, y, color):
          for x in range(x0, x1):
              img.set_pixel(x, y, color)
      # 绘制竖直线
      def draw_vec_line(img, x, y0, y1, color):
          for y in range(y0, y1):
              img.set_pixel(x, y, color)
      
      while(True):
          clock.tick()
          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):
              area = (c.x()-c.r(), c.y()-c.r(), 2*c.r(), 2*c.r())
              #area为识别到的圆的区域,即圆的外接矩形框
              statistics = img.get_statistics(roi=area)#像素颜色统计
              print(statistics)
              #(0,100,0,120,0,120)是红色的阈值,所以当区域内的众数(也就是最多的颜色),范围在这个阈值内,就说明是红色的圆。
              #l_mode(),a_mode(),b_mode()是L通道,A通道,B通道的众数。
              if 16<statistics.l_mode()<65 and 6<statistics.a_mode()<108 and -14<statistics.b_mode()<102:#if the circle is red
                  img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))#识别到的红色圆形用红色的圆框出来
              elif 0<statistics.l_mode()<35 and -12<statistics.a_mode()<22 and -34<statistics.b_mode()<10:#if the circle is red
                  img.draw_circle(c.x(), c.y(), c.r(), color = (0, 0, 255))#识别到的红色圆形用红色的圆框出来
                  #将非红色的圆用白色的矩形框出来
          print("FPS %f" % clock.fps())
      
      
      发布在 OpenMV Cam
      B
      btck