导航

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

    6hgw 发布的帖子

    • 识别矩形圆形也被识别出来,三角形也会被识别成矩形?这是为什么

      0_1558509309495_DWN67NB`IBOXFFPC~451V08.jpg

      import sensor, image, time
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565) # grayscale is faster
      sensor.set_framesize(sensor.QQVGA)
      sensor.skip_frames(time = 2000)
      sensor.set_auto_whitebal(False)
      clock = time.clock()
      
      while(True):
          clock.tick()
      
        
          img = sensor.snapshot().lens_corr(1.8)
       2, r_max = 100, r_step = 2):
              #img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))
              #print(c)
          roi=(20,20,160,80)
          juxing=img.find_rects(roi,threshold = 15000)
          for r in juxing:
              img.draw_rectangle(r.rect(), color = (255, 0, 0))
              #for p in r.corners(): img.draw_circle(p[0], p[1], 5, color = (0, 255, 0))
                  #print(r)
      
          #yuan=img.find_circles(threshold = 2000, x_margin = 10, y_margin = 10, r_margin = 10,r_min = 2, r_max = 100, r_step = 2)
          print('矩形有',len(juxing))
          print("FPS %f" % clock.fps())
      
      
      发布在 OpenMV Cam
      6
      6hgw
    • RE: 颜色识别,因为亮度加了曝光,可是摄像头拍摄时就一闪一闪的,怎么解决?

      @mrqg 没有 如果不加曝光那句话 就是没问题的 ,加了就一直闪动

      发布在 OpenMV Cam
      6
      6hgw
    • 颜色识别,因为亮度加了曝光,可是摄像头拍摄时就一闪一闪的,怎么解决?

      0_1558232917556_783694aa-7e20-4433-97e9-1ec82ff3d8ba-image.png
      0_1558232941044_b926e005-ffb4-4e3a-a3fb-f4b59190cbe9-image.png

      
      # Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max)
      # The below thresholds track in general red/green things. You may wish to tune them...
      thresholds = [(63, 72, 27, 127, -128, 127), # generic_red_thresholds -> index is 0 so code == (1 << 0)
                    (30, 100, -64, -8, -32, 32), # generic_green_thresholds -> index is 1 so code == (1 << 1)
                    (97, 100, -5, 33, -3, 30)] # generic_blue_thresholds -> index is 2 so code == (1 << 2)
      # Codes are or'ed together when "merge=True" for "find_blobs".
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      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
      sensor.set_auto_exposure(False, 1500)#这里设置曝光时间
      clock = time.clock()
      
      # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are
      # returned by "find_blobs" below. Change "pixels_threshold" and "area_threshold" if you change the
      # camera resolution. "merge=True" must be set to merge overlapping color blobs for color codes.
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
          is_red=img.find_blobs([thresholds[0]],roi=(30,10,200,50),pixels_threshold=200, area_threshold=200)
          is_green=img.find_blobs([thresholds[1]],roi=(30,10,200,50),pixels_threshold=200, area_threshold=200)
          is_yellow=img.find_blobs([thresholds[2]],roi=(30,10,200,50),pixels_threshold=200, area_threshold=200)
          if is_red:
              print(1)
          if is_green:
              print(2)
          if is_yellow:
              print(3)
      
      发布在 OpenMV Cam
      6
      6hgw
    • RE: 怎么获取图中红绿灯的颜色,周围亮度太高,颜色识别一直出错?

      @kidswong999 我加了曝光 设置但是加了以后摄像头拍摄的灯光处就会一闪一闪的
      怎么解决

      发布在 OpenMV Cam
      6
      6hgw
    • 获取到某个像素点的颜色3个值以后怎么判断是什么颜色?

      用get_pixels获取图片中的像素点的颜色值 但是怎么判断是什么颜色?

      发布在 OpenMV Cam
      6
      6hgw
    • 怎么获取图中红绿灯的颜色,周围亮度太高,颜色识别一直出错?

      0_1557993198679_f40c81cb-c4a8-40e4-9056-7669b2305cca-image.png
      0_1557993284373_4e77d7d3-8bfa-4151-9ef3-1629a1eba7de-image.png
      0_1557993303368_79a47a8e-ead4-46df-b72d-c2cd14950d92-image.png

      发布在 OpenMV Cam
      6
      6hgw