导航

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

    g24c

    @g24c

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

    g24c 关注

    g24c 发布的帖子

    • RE: 为什么我用颜色形状同时识别时候,检测两边的图像那么费劲,有改善解决的办法嘛

      @kidswong999

      import sensor, image, time
      from machine import UART
      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
      uart = UART(3,19200)
      clock = time.clock()
      
      while(True):
          clock.tick()
          img = sensor.snapshot().lens_corr(strength = 1.5, zoom = 1.0)
          for c in img.find_circles(threshold = 3500, x_margin = 2, y_margin = 2, 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)#像素颜色统计
              if 20<statistics.l_mode()<100 and -30<statistics.a_mode()<0 and -10<statistics.b_mode()<51:#if the circle is red
                  img.draw_circle(c.x(), c.y(), c.r(), color = (0, 255, 0))#识别到的红色圆形用红色的圆框出来
                  print("已找到目标!")
                  print(c.x(),c.y())
                  if (c.x()<70):
                      {
                       print("a")
                       }
                  elif(c.x()>90):
                      {
                       print("c")
                       }
                  elif(70<c.x()<90):
                      print("b")
              else:
                  img.draw_rectangle(area, color = (255, 255, 255))
                  print("找劈叉了")
                  #将非红色的圆用白色的矩形框出来
          uart.write("Hello World!\r")
          time.sleep_ms(10)
          #print("FPS %f" % clock.fps())
          #roi=(66, 99, -19, -2, -2, 31)
            #(25, 61, -25, -9, -1, 52)
      
      
      发布在 OpenMV Cam
      G
      g24c
    • 为什么我用颜色形状同时识别时候,检测两边的图像那么费劲,有改善解决的办法嘛

      2_1713856432795_2dbcb51974efe67e2627df2eba3d6d4e.jpg 1_1713856432794_b5f17d902848f916ae81229218fc4385 (1).jpg 0_1713856432791_ce699263d36006ead26f7ef581527c7e.jpg

      发布在 OpenMV Cam
      G
      g24c
    • 必须要串口调试扩展版才可以和其他单片机通信吗

      是我理解的问题吗,串口调试扩展版作用到底是什么

      发布在 OpenMV Cam
      G
      g24c