导航

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

    hugx 发布的帖子

    • OpenMv上有蜂鸣器吗?

      OpenMv上有蜂鸣器吗

      发布在 OpenMV Cam
      H
      hugx
    • RE: 为什么openmv会把二维码识别成人脸??

      @kidswong999 好吧,有什么办法补救吗

      发布在 OpenMV Cam
      H
      hugx
    • RE: 为什么openmv会把二维码识别成人脸??

      您好,代码已经在前一楼附上,可否快些回复我,谢谢

      发布在 OpenMV Cam
      H
      hugx
    • RE: 为什么openmv会把二维码识别成人脸??

      @kidswong999

      import sensor, image, time
      
      sensor.reset() # Initialize the camera sensor.
      sensor.set_pixformat(sensor.RGB565) # use RGB565.
      sensor.set_framesize(sensor.QQVGA) # use QQVGA for speed.
      sensor.skip_frames(10) # Let new settings take affect.
      sensor.set_auto_whitebal(False) # turn this off.
      clock = time.clock() # Tracks FPS.
      
      face_cascade = image.HaarCascade("frontalface", stages=25)
      
      
      
      while(True):
      
      
          clock.tick() # Track elapsed milliseconds between snapshots().
          img = sensor.snapshot() # Take a picture and return the image.
          
          objects = sensor.snapshot().to_grayscale().find_features(face_cascade, threshold=0.75, scale=1.35)
         
          if objects:
              print("检测到人脸")
          
          for code in img.find_qrcodes():
              message = code.payload()
              print(message)
          
          
         
      
      
      
      
      发布在 OpenMV Cam
      H
      hugx
    • RE: 为什么openmv会把二维码识别成人脸??
      import sensor, image, time
      
      sensor.reset() # Initialize the camera sensor.
      sensor.set_pixformat(sensor.RGB565) # use RGB565.
      sensor.set_framesize(sensor.QQVGA) # use QQVGA for speed.
      sensor.skip_frames(10) # Let new settings take affect.
      sensor.set_auto_whitebal(False) # turn this off.
      clock = time.clock() # Tracks FPS.
      
      face_cascade = image.HaarCascade("frontalface", stages=25)
      
      
      
      while(True):
      
      
          clock.tick() # Track elapsed milliseconds between snapshots().
          img = sensor.snapshot() # Take a picture and return the image.
          
          objects = sensor.snapshot().to_grayscale().find_features(face_cascade, threshold=0.75, scale=1.35)
         
          if objects:
              print("检测到人脸")
          
          for code in img.find_qrcodes():
              message = code.payload()
              print(message)
          
          
         
      
      麻烦看下
      
      
      发布在 OpenMV Cam
      H
      hugx
    • RE: 人脸识别的代码报这个错,os error,之前运行过,没问题,突然报错,为什么?

      好的已解决,谢谢

      发布在 OpenMV Cam
      H
      hugx
    • 为什么openmv会把二维码识别成人脸??

      把二维码和人脸检测代码结合了下,结果二维码被识别成人脸了??

      发布在 OpenMV Cam
      H
      hugx
    • 人脸识别的代码报这个错,os error,之前运行过,没问题,突然报错,为什么?

      import sensor, time, image, pyb

      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 = 5000) #等待5s

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

      拍摄当前人脸。

      img = sensor.snapshot()
      #img = image.Image("singtown/%s/1.pgm"%(SUB))
      d0 = img.find_lbp((0, 0, img.width(), img.height()))
      #d0为当前人脸的lbp特征
      img = None
      pmin = 999999
      num=0

      def min(pmin, a, s):
      global num
      if a<pmin:
      pmin=a
      num=s
      return pmin

      for s in range(1, NUM_SUBJECTS+1):
      dist = 0
      for i in range(1, NUM_SUBJECTS_IMGS+1):
      img = image.Image("singtown/s%d/%d.bmp"%(s, i))
      d1 = img.find_lbp((0, 0, img.width(), img.height()))
      #d1为第s文件夹中的第i张图片的lbp特征
      dist += image.match_descriptor(d0, d1)#计算d0 d1即样本图像与被检测人脸的特征差异度。
      print("Average dist for subject %d: %d"%(s, dist/NUM_SUBJECTS_IMGS))
      pmin = min(pmin, dist/NUM_SUBJECTS_IMGS, s)#特征差异度越小,被检测人脸与此样本更相似更匹配。
      print(pmin)

      print(num) # num为当前最匹配的人的编号。
      0_1612776285272_QQ图片20210208172432.png

      发布在 OpenMV Cam
      H
      hugx
    • 教程里的这两个代码看不懂,可以解释下吗?
         pan_servo.angle(pan_servo.angle()+pan_output)
          tilt_servo.angle(tilt_servo.angle()-tilt_output)
      

      这个是云台追小球的那个代码,pan指的是底座的那个舵机吗吗?
      为什么一个是加 ,一个是减,是如何通过坐标控制角度的?

      发布在 OpenMV Cam
      H
      hugx
    • 请问wifi扩展板和云台可以共存吗,能否云台追踪同时实现数据传送,如何做呢?

      请问wifi扩展板和云台可以共存吗,能否云台追踪同时实现数据传送,如何做呢?

      发布在 OpenMV Cam
      H
      hugx
    • 在P4引脚创建servo对象,创建Servo对象,怎么使用P4,P5引脚创建Servo对象??

      在P4引脚创建servo对象,创建Servo对象,怎么使用P4,P5引脚创建Servo对象??

      发布在 OpenMV Cam
      H
      hugx
    • 代码如下:想有物体时云台追踪物体,想没有东西识别时进行拍摄,并通过wifi模块上传,但不知道为何实现不了,求大佬解答
      import sensor, image, time, network, usocket, sys
      import pyb
      import wifi
      from pid import PID
      from pyb import Servo
      from pyb import Pin, Timer
      SSID ='OPENMV_AP'    # Network SSID
      KEY  ='1234567890'    # Network key (must be 10 chars)
      HOST = ''           # Use first available interface
      PORT = 8080         # Arbitrary non-privileged port
      
      pan_servo=Servo(1)
      tilt_servo=Servo(2)
      led = pyb.LED(3)
      green_threshold  = (31, 100, -100, -44, -2, 69)
      
      pan_pid = PID(p=0.07, i=0, imax=90)
      tilt_pid = PID(p=0.05, i=0, imax=90)
      
      sensor.reset() # Initialize the camera sensor.
      sensor.set_contrast(1)
      sensor.set_brightness(1)
      sensor.set_saturation(1)
      sensor.set_gainceiling(16)
      sensor.set_pixformat(sensor.RGB565) # use RGB565.
      sensor.set_framesize(sensor.QQVGA) # use QQVGA for speed.
      sensor.skip_frames(10) # Let new settings take affect.
      sensor.set_auto_whitebal(False) # turn this off.
      clock = time.clock() # Tracks FPS.
      face_cascade = image.HaarCascade("frontalface", stages=25)
      
      # Init wlan module in AP mode.
      wlan = network.WINC(mode=network.WINC.MODE_AP)
      wlan.start_ap(SSID, key=KEY, security=wlan.WEP, channel=2)
      
      # You can block waiting for client to connect
      #print(wlan.wait_for_sta(10000))
      
      def find_max(blobs):
          max_size=0
          for blob in blobs:
              if blob[2]*blob[3] > max_size:
                  max_blob=blob
                  max_size = blob[2]*blob[3]
          return max_blob
      
      
      
      while (True):
          clock.tick() # Track elapsed milliseconds between snapshots().
          img = sensor.snapshot() # Take a picture and return the image.
          blobs = img.find_blobs([green_threshold])
          objects = img.to_grayscale().find_features(face_cascade, threshold=0.75, scale=1.35)
       
             
          if blobs:
              max_blob = find_max(blobs)
              pan_error = max_blob.cx()-img.width()/2
              tilt_error = max_blob.cy()-img.height()/2
              print("pan_error: ", pan_error)
              img.draw_rectangle(max_blob.rect()) # rect
              img.draw_cross(max_blob.cx(), max_blob.cy()) # cx, cy
              pan_output=pan_pid.get_pid(pan_error,1)/2
              tilt_output=tilt_pid.get_pid(tilt_error,1)
              print("pan_output",pan_output)
              pan_servo.angle(pan_servo.angle()+pan_output)
              tilt_servo.angle(tilt_servo.angle()-tilt_output)
          elif objects:
              led.on()
              time.sleep_ms(150)     #延时150ms
              led.off()
          else:
              # Create server socket
              s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)
              try:
                  # Bind and listen
                  s.bind([HOST, PORT])
                  s.listen(5)
          
                  # Set server socket timeout
                  # NOTE: Due to a WINC FW bug, the server socket must be closed and reopened if
                  # the client disconnects. Use a timeout here to close and re-create the socket.
                  s.settimeout(3)
                  wifi.start_streaming(s)
              except OSError as e:
                  s.close()
                  print("socket error: ", e)
                  #sys.print_exception(e)
      
      
      
      
      
      
      
      
      
      
      
      发布在 OpenMV Cam
      H
      hugx