Navigation

    • Login
    • Search
    • 版块
    • 产品
    • 教程
    • 论坛
    • 淘宝
    1. Home
    2. guzr
    G
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    • mipush

    guzr

    @guzr

    0
    Reputation
    10
    Posts
    62
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    guzr Follow

    Posts made by guzr

    • 瞳孔识别里面想在两次眼睛出现之间加个标志位来实现眨眼次数统计

      比如它一直是有眼睛,那么a就一直是一个值,当没有眼睛的时候,标志位就变化一次,然后num+1,然后如果一直没眼睛,标志位也就一直不变

      import sensor, time, image
      
      sensor.reset()
      sensor.set_contrast(3)
      sensor.set_gainceiling(16)
      sensor.set_framesize(sensor.VGA)
      sensor.set_windowing((220, 190, 200, 100))
      sensor.set_pixformat(sensor.GRAYSCALE)
      
      eyes_cascade = image.HaarCascade("eye", stages=24)
      print(eyes_cascade)
      
      clock = time.clock()
      
      num=0
      while (True):
          clock.tick()
          img = sensor.snapshot()
      
          eyes = img.find_features(eyes_cascade, threshold=0.5, scale=1.5)
          for e in eyes:
              iris = img.find_eye(e)
              img.draw_rectangle(e)
              img.draw_cross(iris[0], iris[1])
          if img.draw_cross(iris[0], iris[1]):
              if a==1:
                  num=num+1
                  a=!a
              else if:
                  a=!a
          print(num)
      
      
      posted in OpenMV Cam
      G
      guzr
    • RE: 关于编写外部中断的问题

      import sensor, time, image, pyb
      from pyb import UART
      from pyb import Pin
      from pyb import ExtInt

      sensor.reset() # Initialize the camera sensor.
      sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE
      sensor.set_framesize(sensor.B128X128) # or sensor.QQVGA (or others)
      sensor.set_windowing((92,112))
      sensor.skip_frames(10) # Let new settings take affect.
      sensor.skip_frames(time = 2000) #等待5s
      uart = UART(3, 115200)#串口波特率
      uart.init(115200,bits=8,parity=None,stop=1)

      key_pin=Pin('P7',pyb.Pin.OUT_OD,pyb.Pin.PULL_UP)

      #SUB = "s1"
      NUM_SUBJECTS = 2 #图像库中不同人数,一共6人
      NUM_SUBJECTS_IMGS = 20 #每人有20张样本图片

      img = None
      pmin = 999999
      num=0
      def min(pmin, a, s):
      global num
      if a<pmin:
      pmin=a
      num=s
      return pmin
      #外部中断配置
      def callback(line):
      if(key_pin.value()):
      print('5')
      else:
      print('6')
      #extint = pyb.ExtInt(key_pin, pyb.ExtInt.IRQ_RISING_FALLING, pyb.Pin.PULL_DOWN, callback)
      extint = ExtInt(Pin('P7'), ExtInt.IRQ_RISING, Pin.PULL_NONE, callback)
      while(1):
      img = sensor.snapshot()
      d0 = img.find_lbp((0, 0, img.width(), img.height()))
      img = sensor.snapshot()
      if uart.any():
      t=uart.readline().decode().strip()
      print(t)
      for s in range(1, NUM_SUBJECTS+1):
      dist = 0
      for i in range(2, NUM_SUBJECTS_IMGS+1):
      img = image.Image("singtown/s%d/%d.pgm"%(s, i))
      d1 = img.find_lbp((0, 0, img.width(), img.height()))
      dist += image.match_descriptor(d0, d1)#计算d0 d1即样本图像与被检测人脸的特征差异度。
      pmin = min(pmin, dist/NUM_SUBJECTS_IMGS, s)#特征差异度越小,被检测人脸与此样本更相似更匹配。
      print(num) # num为当前最匹配的人的编号。
      uart.write(str(num)+'\r\n') #发送串口数据
      我没有添加

      posted in OpenMV Cam
      G
      guzr
    • 关于编写外部中断的问题
      return_pin = Pin('P0', Pin.PULL_UP, Pin.OUT_PP)
      def return_start():
          wave_trig_pin.value(1)
          utime.sleep_us(15)
          return_pin.value(0)
      callback = lambda e: print("intr")
      extint = ExtInt(Pin('P0'), ExtInt.IRQ_RISING, Pin.PULL_NONE, callback)
      #SUB = "s1"
      NUM_SUBJECTS = 2 #图像库中不同人数,一共6人
      NUM_SUBJECTS_IMGS = 20 #每人有20张样本图片
      
      img = None
      pmin = 999999
      num=0
      def min(pmin, a, s):
          global num
          if a<pmin:
              pmin=a
              num=s
          return pmin
      def callback(line):
          if(return_pin .value()):
              print("4")
          else:
              extint.disable()
      while(1):
          def callback(line):
              if(return_pin .value()):
                  print("4")
              else:
                  extint.disable()
          img = sensor.snapshot()
          d0 = img.find_lbp((0, 0, img.width(), img.height()))
          img = sensor.snapshot()
          if uart.any():
              t=uart.readline().decode().strip()
              print(t)
          for s in range(1, NUM_SUBJECTS+1):
              dist = 0
              for i in range(2, NUM_SUBJECTS_IMGS+1):
                  img = image.Image("singtown/s%d/%d.pgm"%(s, i))
                  d1 = img.find_lbp((0, 0, img.width(), img.height()))
                  dist += image.match_descriptor(d0, d1)#计算d0 d1即样本图像与被检测人脸的特征差异度。
              pmin = min(pmin, dist/NUM_SUBJECTS_IMGS, s)#特征差异度越小,被检测人脸与此样本更相似更匹配。
              print(num) # num为当前最匹配的人的编号。
              uart.write(str(num)+'\r\n') #发送串口数据
      
      

      我想靠按键实现外部中断 运行程序没有报错 但是按键没有反应 跳不出来循环

      posted in OpenMV Cam
      G
      guzr
    • RE: 有关于驾驶员疲劳度检测模型

      我看讨论群说有人做出来了

      posted in OpenMV Cam
      G
      guzr
    • RE: 在edge网站训练连续运动模型的有关问题

      0_161581327X.png

      posted in OpenMV Cam
      G
      guzr
    • 在edge网站训练连续运动模型的有关问题

      0_1615812363731_0)5F{@AUBPFA_IC@36WNKX.png ![0_1615812395070_BL%G~)D927S]_HG98YQX2Y9.png
      这个连续运动的模型有没有教程 自己用手机记录的运动得到的模型总是不对

      posted in OpenMV Cam
      G
      guzr
    • 有关于驾驶员疲劳度检测模型

      openmv的edge网站适合做驾驶员疲劳度检测模型吗

      posted in OpenMV Cam
      G
      guzr
    • 有关于人脸分辨的问题,识别了两个不同的人脸,识别人脸输出结果只能出来1,求大佬解释

      ![0_1611030189441_DKH@9_RNHNL2MSQ18]H]KUS.png](https://fcdn.singtown.com/4be8b1a9-07e6-4bb0-bed5-67cd0460fe4f.png)

      请在这里粘贴代码
      
      posted in OpenMV Cam
      G
      guzr
    • RE: 求助关于人脸分辨的相关问题

      确实跟着教程一步一步走 但就是分辨不出来

      posted in OpenMV Cam
      G
      guzr
    • 关于人脸图片保存为啥sd卡中图片显示不出来?对人脸分辨是否有无影响
      # Snapshot Example
      #
      # Note: You will need an SD card to run this example.
      #
      # You can use your OpenMV Cam to save image files.
      
      import sensor, image, pyb
      
      RED_LED_PIN = 1
      BLUE_LED_PIN = 3
      
      sensor.reset() # Initialize the camera sensor.
      sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE
      sensor.set_framesize(sensor.QQVGA) # or sensor.QQVGA (or others)
      sensor.set_windowing((92,112))
      sensor.skip_frames(10) # Let new settings take affect.
      sensor.skip_frames(time = 2000)
      
      num = 1 #设置被拍摄者序号,第一个人的图片保存到s1文件夹,第二个人的图片保存到s2文件夹,以此类推。每次更换拍摄者时,修改num值。
      
      n = 20 #设置每个人拍摄图片数量。
      
      #连续拍摄n张照片,每间隔3s拍摄一次。
      while(n):
          #红灯亮
          pyb.LED(RED_LED_PIN).on()
          sensor.skip_frames(time = 3000) # Give the user time to get ready.等待3s,准备一下表情。
      
          #红灯灭,蓝灯亮
          pyb.LED(RED_LED_PIN).off()
          pyb.LED(BLUE_LED_PIN).on()
      
          #保存截取到的图片到SD卡
          print(n)
          sensor.snapshot().save("singtown/s%s/%s.pgm" % (num, n) ) # or "example.bmp" (or others)
      
          n -= 1
      
          pyb.LED(BLUE_LED_PIN).off()
          print("Done! Reset the camera to see the saved image.")
      
      

      0_1609843106032_QQ图片20210105183807.png
      0_1609843113545_QQ图片20210105183807.png

      posted in OpenMV Cam
      G
      guzr