• 安装星瞳实验室APP,快速收到回复。扫描二维码或者点击 https://singtown.com/app/
  • 必看:玩转星瞳论坛了解一下图片上传,代码格式等问题。
  • 一个提问,一个帖子,标题为问题的介绍
  • 请贴出具体的代码,与报错提示。
  • 代码一定要让别人可以运行的文本,不要贴图片
  • 怎样提高拍照的清晰度



    • 如题,选择用模型匹配进行物体识别,发现分辨率不高,拍照模糊,怎样能提高呢0_1525399960399_阿里旺旺图片20180504101010.jpg



    • @laoguren1122 程序如图
      import time, sensor, image, math
      from image import SEARCH_EX, SEARCH_DS

      Reset sensor

      sensor.reset()

      Set sensor settings

      sensor.set_contrast(1)
      sensor.set_gainceiling(16)

      Max resolution for template matching with SEARCH_EX is QQVGA

      sensor.set_framesize(sensor.QQVGA)

      You can set windowing to reduce the search image.

      #sensor.set_windowing(((640-80)//2, (480-60)//2, 80, 60))
      sensor.set_pixformat(sensor.GRAYSCALE)

      Load template.

      Template should be a small (eg. 32x32 pixels) grayscale image.

      template = image.Image("/ball3.pgm")

      low_threshold = (0, 50)
      high_threshold = (195, 255)

      clock = time.clock()

      Run template matching

      while (True):
      clock.tick()
      img = sensor.snapshot().lens_corr(1.8)

      for x in range(4):

      r = img.find_template(template, 0.70)
      if r:
          img.draw_rectangle(r,color=0)
      

      img.find_edges(image.EDGE_CANNY, threshold=(50, 80))

      for c in img.find_circles(threshold = 2500, x_margin = 20, y_margin = 20, r_margin = 20):

      img.draw_circle(c.x(), c.y(), c.r(), color = (0, 0, 0))

      print(c)

      print(clock.fps())


    • 来自星瞳实验室APP: [常见问题]Memory Error: FB Alloc collision!内存不够 https://forum.singtown.com/topic/558