• 免费好用的星瞳AI云服务上线!简单标注,云端训练,支持OpenMV H7和OpenMV H7 Plus。可以替代edge impulse。 https://forum.singtown.com/topic/9519
  • 我们只解决官方正版的OpenMV的问题(STM32),其他的分支有很多兼容问题,我们无法解决。
  • 如果有产品硬件故障问题,比如无法开机,论坛很难解决。可以直接找售后维修
  • 发帖子之前,请确认看过所有的视频教程,https://singtown.com/learn/ 和所有的上手教程http://book.openmv.cc/
  • 每一个新的提问,单独发一个新帖子
  • 帖子需要目的,你要做什么?
  • 如果涉及代码,需要报错提示全部代码文本,请注意不要贴代码图片
  • 必看:玩转星瞳论坛了解一下图片上传,代码格式等问题。
  • SD卡里图片是用openmv的VGA像素拍摄的,



    • 代码就是检测到有人,就把视线内的所有人脸与SD卡里的人脸对比,SD卡里图片是用openmv的VGA像素拍摄的,有90多KB。一读取就内存报错MemoryError: Out of normal MicroPython Heap Memory!。代码和要比对的图片如下:

      # Face recognition with LBP descriptors.
      # See Timo Ahonen's "Face Recognition with Local Binary Patterns".
      #
      # Before running the example:
      # 1) Download the AT&T faces database http://www.cl.cam.ac.uk/Research/DTG/attarchive/pub/data/att_faces.zip
      # 2) Exract and copy the orl_faces directory to the SD card root.
      
      
      import sensor, time, image, pyb
      
      sensor.reset() # Initialize the camera sensor.
      sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE
      sensor.set_framesize(sensor.VGA) # or sensor.QQVGA (or others)
      sensor.skip_frames(10) # Let new settings take affect.
      sensor.skip_frames(time = 5000) #等待5s
      i = 1
      # 拍摄当前人脸。
      face_cascade = image.HaarCascade("frontalface", stages=25)
      while(True):
          img = sensor.snapshot()
          #img = image.Image("singtown/%s/1.pgm"%(SUB))
          objects = img.find_features(face_cascade, threshold=0.75, scale=1.35)
          if not objects :
              print("no people")
              continue
          for face in objects:
              d0 = img.find_lbp(face)
              img = image.Image("%d.pgm"%i)
              d1 = img.find_lbp((0, 0, img.width(), img.height()))
              dist = image.match_descriptor(d0, d1)#计算d0 d1即样本图像与被检测人脸的特征差异度。
              if dist >28000:
                  print("people is not match")
              else:
                  print("There's a match here ")
      
      


    • @kidswong999 0_1593414142688_1.jpg
      由于不能上传pgm格式图片,我把拓展名改成了jpg格式,麻烦一下您下载后把拓展名改回pgm格式,然后试一下。谢谢!



    • 此回复已被删除!


    • 我测试没问题,固件3.6.4
      face.pgm就是你上传的图片。

      0_1593836028514_截屏2020-07-04 下午12.12.36.jpg