• OpenMV VSCode 扩展发布了,在插件市场直接搜索OpenMV就可以安装
  • 如果有产品硬件故障问题,比如无法开机,论坛很难解决。可以直接找售后维修
  • 发帖子之前,请确认看过所有的视频教程,https://singtown.com/learn/ 和所有的上手教程http://book.openmv.cc/
  • 每一个新的提问,单独发一个新帖子
  • 帖子需要目的,你要做什么?
  • 如果涉及代码,需要报错提示全部代码文本,请注意不要贴代码图片
  • 必看:玩转星瞳论坛了解一下图片上传,代码格式等问题。
  • 为什么识别不了图片上的那个矩形?



    • # 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
      
      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()
      
      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...
      
          for r in img.find_rects(threshold = 10000):
              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)
      
          print("FPS %f" % clock.fps())
      ![0_1648879005721_1648822288838.jpg](正在上传 75%) 
      


    • 图片没上传成功,重新上传一下jpg。