导航

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

    rdzg 发布的帖子

    • RE: 图像太亮怎么办
      # Find Rects Example
      #
      # This example shows off how to find rectangles in the image using the quad threshold
      # detection code from our April Tags code. The quad threshold detection algorithm
      # detects rectangles in an extremely robust way and is much better than Hough
      # Transform based methods. For example, it can still detect rectangles even when lens
      # distortion causes those rectangles to look bent. Rounded rectangles are no problem!
      # (But, given this the code will also detect small radius circles too)...
      
      import sensor, image, time, lcd
      
      threshold_index = 0 # 0 for red, 1 for green, 2 for blue
      
      # Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max)
      # The below thresholds track in general red/green/blue things. You may wish to tune them...
      thresholds = [(21, 28, -14, -2, -11, 11),# generic_black_thresholds
                    (64, 73, 31, 52, 14, 39), # generic_red_thresholds
                    (30, 100, -64, -8, -32, 32), # generic_green_thresholds
                    (98, 100, -6, 5, -5, 5),# generic_white_thresholds
                    (0, 30, 0, 64, -128, 0)] # generic_blue_thresholds
      lcd.init() # Initialize the lcd screen.
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565) # grayscale is faster (160x120 max on OpenMV-M7)
      sensor.set_framesize(sensor.QQVGA)
      sensor.skip_frames(time = 2000)
      clock = time.clock()
      
      sensor.set_auto_gain(False) # must be turned off for color tracking
      sensor.set_auto_whitebal(False) # must be turned off for color tracking
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
      
          # `threshold` below should be set to a high enough value to filter out noise
          # rectangles detected in the image which have low edge magnitudes. Rectangles
          # have larger edge magnitudes the larger and more contrasty they are...
          img.draw_cross(80, 60)
      
          for c in img.find_circles(threshold = 3900, x_margin = 10, y_margin = 10, r_margin = 10):
              circle_roi = [c.x()-c.r(),c.y()-c.r(),c.x()+c.r(),c.y()+c.r()]
              #for blob in img.find_blobs([thresholds[1]], roi=circle_roi, pixels_threshold=200, area_threshold=200, merge=True):
              img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))
              img.draw_cross(c.x(), c.y())
              img.draw_string(90,80,'circle',color=(0,0,0))
              img.draw_string(90,90,'r=' + str(c.r()),color=(0,0,0))
              img.draw_string(90,100,'x=' + str(c.x()-80),color=(0,0,0))
              img.draw_string(90,110,'y=' + str(-c.y()+60),color=(0,0,0))
      
          for r in img.find_rects(threshold = 15000):
              if (r.w()-r.h())<10 and (r.w()-r.h())>-10 :
                  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))
                  img.draw_string(20,80,'square',color=(0,0,0))
                  img.draw_string(20,90,'a=' + str((r.h()+r.w())/2),color=(0,0,0))
                  img.draw_string(20,100,'x=' + str(-r.x()+60),color=(0,0,0))
                  img.draw_string(20,110,'y=' + str(-r.y()+40),color=(0,0,0))
              print(r)
      
          for blob in img.find_blobs([thresholds[3]], pixels_threshold=200, area_threshold=200, merge=True):
              img.draw_circle(blob.cx(), blob.cy(), int((blob.h()+blob.w())/4), color = (0, 255, 0))
              img.draw_string(20,10,'led',color=(0,0,0))
              img.draw_string(20,20,'x=' + str(+blob.cx()-80),color=(0,0,0))
              img.draw_string(20,30,'y=' + str(-blob.cy()+60),color=(0,0,0))
      
      
          lcd.display(img)
          print("FPS %f" % clock.fps())
      
      
      发布在 OpenMV Cam
      R
      rdzg
    • 图像太亮怎么办

      获取的图像太亮,导致有颜色的物体也显示成了白色
      图:0_1530773484757_QQ图片20180705145112.png
      前几天亮度还是正常的
      连窗户都能照
      但是现在连桌子都照不清楚了
      求解答!

      发布在 OpenMV Cam
      R
      rdzg
    • RE: IDE的示例程序打不开了怎么办

      试过了
      没有用
      是点击了更新之后就没了的
      换了个盘装也没用

      发布在 OpenMV Cam
      R
      rdzg
    • IDE的示例程序打不开了怎么办

      0_1530409616328_捕获20180701.PNG

      跪求解决办法!

      发布在 OpenMV Cam
      R
      rdzg