导航

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

    lndf 发布的帖子

    • RE: Wifi模块与人脸识别录像同时运行,为什么从手机登陆网址看只有一帧

      @kidswong999 还是不行啊,我想的是WIFI同步影像以及人脸识别录像,这个 WIFI 模块上看实时影像还是只有一张图,卡顿的然后就不更新图像了

      发布在 OpenMV Cam
      L
      lndf
    • openmv有没有系统库,可以同时交互跑两个程序的那种有吗

      谢谢大佬帮助小白

      发布在 OpenMV Cam
      L
      lndf
    • Wifi模块与人脸识别录像同时运行,为什么从手机登陆网址看只有一帧

      MJPEG Streaming AP.

      这个例子展示了如何在AccessPoint模式下进行MJPEG流式传输。

      Android上的Chrome,Firefox和MJpegViewer App已经过测试。

      连接到OPENMV_AP并使用此URL:http://192.168.1.1:8080查看流。

      import sensor, image, time, network, usocket, sys, mjpeg, pyb

      SSID ='wlan work,face detection error' # Network SSID
      KEY ='1234567890' # Network key (must be 10 chars)
      HOST = '' # Use first available interface
      PORT = 8080 # Arbitrary non-privileged port
      RED_LED_PIN = 1
      BLUE_LED_PIN = 3

      Reset sensor

      sensor.reset()

      Set sensor settings

      sensor.set_contrast(1)
      sensor.set_brightness(1)
      sensor.set_saturation(1)
      sensor.set_gainceiling(16)
      sensor.set_framesize(sensor.QQVGA)
      sensor.set_pixformat(sensor.GRAYSCALE)
      sensor.skip_frames(time = 2000) # Let new settings take affect.
      face_cascade = image.HaarCascade("frontalface", stages=25)

      在AP模式下启动wlan模块。

      wlan = network.WINC(mode=network.WINC.MODE_AP)
      wlan.start_ap(SSID, key=KEY, security=wlan.WEP, channel=2)

      #您可以阻止等待客户端连接
      #print(wlan.wait_for_sta(10000))

      def start_streaming(s):
      print ('Waiting for connections..')
      client, addr = s.accept()
      # 将客户端套接字超时设置为2秒
      client.settimeout(2.0)
      print ('Connected to ' + addr[0] + ':' + str(addr[1]))

      # 从客户端读取请求
      data = client.recv(1024)
      # 应该在这里解析客户端请求
      
      # 发送多部分head
      client.send("HTTP/1.1 200 OK\r\n" \
                  "Server: OpenMV\r\n" \
                  "Content-Type: multipart/x-mixed-replace;boundary=openmv\r\n" \
                  "Cache-Control: no-cache\r\n" \
                  "Pragma: no-cache\r\n\r\n")
      
      # FPS clock
      clock = time.clock()
      
      # 开始流媒体图像
      #注:禁用IDE预览以增加流式FPS。
      while (True):
          clock.tick() # Track elapsed milliseconds between snapshots().
          frame = sensor.snapshot()
          cframe = frame.compressed(quality=35)
          header = "\r\n--openmv\r\n" \
                   "Content-Type: image/jpeg\r\n"\
                   "Content-Length:"+str(cframe.size())+"\r\n\r\n"
          client.send(header)
          client.send(cframe)
          print(clock.fps())
          print("123")
          pyb.LED(RED_LED_PIN).on()
          print("About to start detecting faces...")
          sensor.skip_frames(time = 2000) # Give the user time to get ready.
      
          pyb.LED(RED_LED_PIN).off()
          print("Now detecting faces!")
          pyb.LED(BLUE_LED_PIN).on()
      
          diff = 10 # We'll say we detected a face after 10 frames.
          while(diff):
              img = sensor.snapshot()
              # Threshold是介于0.0-1.0的阈值,较低值会同时提高检出率和假阳性
              # 率。相反,较高值会同时降低检出率和假阳性率。
              # scale是一个必须大于1.0的浮点数。较高的比例因子运行更快,
              # 但其图像匹配相应较差。理想值介于1.35-1.5之间。
      
              faces = img.find_features(face_cascade, threshold=0.5, scale_factor=1.5)
      
              if faces:
                  diff -= 1
                  for r in faces:
                      img.draw_rectangle(r)
      
          m = mjpeg.Mjpeg("example4-%d.mjpeg" % pyb.rng())
      
          clock = time.clock() # Tracks FPS.
          print("You're on camera!")
          for i in range(200):
              clock.tick()
              m.add_frame(sensor.snapshot())
              print(clock.fps())
      
          m.close(clock.fps())
          pyb.LED(BLUE_LED_PIN).off()
          print("Restarting...")
      

      while (True):
      print("456")
      # 创建服务器套接字
      s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)
      try:
      # Bind and listen
      s.bind([HOST, PORT])
      s.listen(5)

          # 设置服务器套接字超时
          # 注意:由于WINC FW bug,如果客户端断开连接,服务器套接字必须
          # 关闭并重新打开。在这里使用超时关闭并重新创建套接字。
          s.settimeout(3)
          start_streaming(s)
      except OSError as e:
          s.close()
          print("socket error: ", e)
          #sys.print_exception(e)
      发布在 OpenMV Cam
      L
      lndf
    • RE: openmv如何同时实现Wifi图像传输人脸识别和录像功能

      下面的合并程序能实现吗

      发布在 OpenMV Cam
      L
      lndf
    • RE: openmv如何同时实现Wifi图像传输人脸识别和录像功能

      MJPEG Streaming AP.

      这个例子展示了如何在AccessPoint模式下进行MJPEG流式传输。

      Android上的Chrome,Firefox和MJpegViewer App已经过测试。

      连接到OPENMV_AP并使用此URL:http://192.168.1.1:8080查看流。

      import sensor, image, time, network, usocket, sys, mjpeg, pyb

      SSID ='OPENMV_AP' # Network SSID
      KEY ='1234567890' # Network key (must be 10 chars)
      HOST = '' # Use first available interface
      PORT = 8080 # Arbitrary non-privileged port
      RED_LED_PIN = 1
      BLUE_LED_PIN = 3

      Reset sensor

      sensor.reset()

      Set sensor settings

      sensor.set_contrast(1)
      sensor.set_brightness(1)
      sensor.set_saturation(1)
      sensor.set_gainceiling(16)
      sensor.set_framesize(sensor.QQVGA)
      sensor.set_pixformat(sensor.GRAYSCALE)
      sensor.skip_frames(time = 2000) # Let new settings take affect.
      face_cascade = image.HaarCascade("frontalface", stages=25)

      在AP模式下启动wlan模块。

      wlan = network.WINC(mode=network.WINC.MODE_AP)
      wlan.start_ap(SSID, key=KEY, security=wlan.WEP, channel=2)

      #您可以阻止等待客户端连接
      #print(wlan.wait_for_sta(10000))

      def start_streaming(s):
      print ('Waiting for connections..')
      client, addr = s.accept()
      # 将客户端套接字超时设置为2秒
      client.settimeout(2.0)
      print ('Connected to ' + addr[0] + ':' + str(addr[1]))

      # 从客户端读取请求
      data = client.recv(1024)
      # 应该在这里解析客户端请求
      
      # 发送多部分head
      client.send("HTTP/1.1 200 OK\r\n" \
                  "Server: OpenMV\r\n" \
                  "Content-Type: multipart/x-mixed-replace;boundary=openmv\r\n" \
                  "Cache-Control: no-cache\r\n" \
                  "Pragma: no-cache\r\n\r\n")
      
      # FPS clock
      clock = time.clock()
      
      # 开始流媒体图像
      #注:禁用IDE预览以增加流式FPS。
      while (True):
          clock.tick() # Track elapsed milliseconds between snapshots().
          frame = sensor.snapshot()
          cframe = frame.compressed(quality=35)
          header = "\r\n--openmv\r\n" \
                   "Content-Type: image/jpeg\r\n"\
                   "Content-Length:"+str(cframe.size())+"\r\n\r\n"
          client.send(header)
          client.send(cframe)
          print(clock.fps())
      

      while (True):
      # 创建服务器套接字
      s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)
      try:
      # Bind and listen
      s.bind([HOST, PORT])
      s.listen(5)

          # 设置服务器套接字超时
          # 注意:由于WINC FW bug,如果客户端断开连接,服务器套接字必须
          # 关闭并重新打开。在这里使用超时关闭并重新创建套接字。
          s.settimeout(3)
          start_streaming(s)
      except OSError as e:
          s.close()
          print("socket error: ", e)
          #sys.print_exception(e)
      pyb.LED(RED_LED_PIN).on()
      print("About to start detecting faces...")
      sensor.skip_frames(time = 2000) # Give the user time to get ready.
      
      pyb.LED(RED_LED_PIN).off()
      print("Now detecting faces!")
      pyb.LED(BLUE_LED_PIN).on()
      
      diff = 10 # We'll say we detected a face after 10 frames.
      while(diff):
          img = sensor.snapshot() 
          faces = img.find_features(face_cascade, threshold=0.5, scale_factor=1.5)
      
          if faces:
              diff -= 1
              for r in faces:
                  img.draw_rectangle(r)
      
      m = mjpeg.Mjpeg("example-%d.mjpeg" % pyb.rng())
      
      clock = time.clock() # Tracks FPS.
      print("You're on camera!")
      for i in range(200):
          clock.tick()
          m.add_frame(sensor.snapshot())
          print(clock.fps())
      
      m.close(clock.fps())
      pyb.LED(BLUE_LED_PIN).off()
      print("Restarting...")
      发布在 OpenMV Cam
      L
      lndf
    • 代码能实现什么功能 在线等

      MJPEG Streaming AP.

      这个例子展示了如何在AccessPoint模式下进行MJPEG流式传输。

      Android上的Chrome,Firefox和MJpegViewer App已经过测试。

      连接到OPENMV_AP并使用此URL:http://192.168.1.1:8080查看流。

      import sensor, image, time, network, usocket, sys, mjpeg, pyb

      SSID ='OPENMV_AP' # Network SSID
      KEY ='1234567890' # Network key (must be 10 chars)
      HOST = '' # Use first available interface
      PORT = 8080 # Arbitrary non-privileged port
      RED_LED_PIN = 1
      BLUE_LED_PIN = 3

      Reset sensor

      sensor.reset()

      Set sensor settings

      sensor.set_contrast(1)
      sensor.set_brightness(1)
      sensor.set_saturation(1)
      sensor.set_gainceiling(16)
      sensor.set_framesize(sensor.QQVGA)
      sensor.set_pixformat(sensor.GRAYSCALE)
      sensor.skip_frames(time = 2000) # Let new settings take affect.
      face_cascade = image.HaarCascade("frontalface", stages=25)

      在AP模式下启动wlan模块。

      wlan = network.WINC(mode=network.WINC.MODE_AP)
      wlan.start_ap(SSID, key=KEY, security=wlan.WEP, channel=2)

      #您可以阻止等待客户端连接
      #print(wlan.wait_for_sta(10000))

      def start_streaming(s):
      print ('Waiting for connections..')
      client, addr = s.accept()
      # 将客户端套接字超时设置为2秒
      client.settimeout(2.0)
      print ('Connected to ' + addr[0] + ':' + str(addr[1]))

      # 从客户端读取请求
      data = client.recv(1024)
      # 应该在这里解析客户端请求
      
      # 发送多部分head
      client.send("HTTP/1.1 200 OK\r\n" \
                  "Server: OpenMV\r\n" \
                  "Content-Type: multipart/x-mixed-replace;boundary=openmv\r\n" \
                  "Cache-Control: no-cache\r\n" \
                  "Pragma: no-cache\r\n\r\n")
      
      # FPS clock
      clock = time.clock()
      
      # 开始流媒体图像
      #注:禁用IDE预览以增加流式FPS。
      while (True):
          clock.tick() # Track elapsed milliseconds between snapshots().
          frame = sensor.snapshot()
          cframe = frame.compressed(quality=35)
          header = "\r\n--openmv\r\n" \
                   "Content-Type: image/jpeg\r\n"\
                   "Content-Length:"+str(cframe.size())+"\r\n\r\n"
          client.send(header)
          client.send(cframe)
          print(clock.fps())
      

      while (True):
      # 创建服务器套接字
      s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)
      try:
      # Bind and listen
      s.bind([HOST, PORT])
      s.listen(5)

          # 设置服务器套接字超时
          # 注意:由于WINC FW bug,如果客户端断开连接,服务器套接字必须
          # 关闭并重新打开。在这里使用超时关闭并重新创建套接字。
          s.settimeout(3)
          start_streaming(s)
      except OSError as e:
          s.close()
          print("socket error: ", e)
          #sys.print_exception(e)
      pyb.LED(RED_LED_PIN).on()
      print("About to start detecting faces...")
      sensor.skip_frames(time = 2000) # Give the user time to get ready.
      
      pyb.LED(RED_LED_PIN).off()
      print("Now detecting faces!")
      pyb.LED(BLUE_LED_PIN).on()
      
      diff = 10 # We'll say we detected a face after 10 frames.
      while(diff):
          img = sensor.snapshot() 
          faces = img.find_features(face_cascade, threshold=0.5, scale_factor=1.5)
      
          if faces:
              diff -= 1
              for r in faces:
                  img.draw_rectangle(r)
      
      m = mjpeg.Mjpeg("example-%d.mjpeg" % pyb.rng())
      
      clock = time.clock() # Tracks FPS.
      print("You're on camera!")
      for i in range(200):
          clock.tick()
          m.add_frame(sensor.snapshot())
          print(clock.fps())
      
      m.close(clock.fps())
      pyb.LED(BLUE_LED_PIN).off()
      print("Restarting...")
      发布在 OpenMV Cam
      L
      lndf
    • RE: openmv如何同时实现Wifi图像传输人脸识别和录像功能

      录制人脸识别动图例程

      注意:您将需要SD卡来运行此示例。

      您可以使用OpenMV Cam来录制gif文件。可以用于RGB565图或灰度图。

      使用像GIMP这样的照片编辑软件在将GIF上传到网络之前对其进行压缩和优化。

      这个例子演示了如何在你的OpenMV Cam上使用面部追踪来获取gif。

      import sensor, image, time, gif, pyb

      RED_LED_PIN = 1
      BLUE_LED_PIN = 3

      sensor.reset() # Initialize the camera sensor.
      sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.
      sensor.set_framesize(sensor.QQVGA) # or sensor.HQVGA (or others)
      sensor.skip_frames(time = 2000) # Let new settings take affect.

      加载人脸检测HaarCascade。 这是OpenMV Cam可以使用下面的

      find_features()方法来检测人脸的对象。 您的OpenMV具有HaarCascade

      内置的人脸模型。 默认情况下,HaarCascade的所有阶段都被加载。 但是,

      您可以调整阶段的数量来加快处理速度,但要以准确性为代价。

      HaarCascade的前面有25个阶段。

      face_cascade = image.HaarCascade("frontalface", stages=25)

      while(True):

      pyb.LED(RED_LED_PIN).on()
      print("About to start detecting faces...")
      sensor.skip_frames(time = 2000) # Give the user time to get ready.
      
      pyb.LED(RED_LED_PIN).off()
      print("Now detecting faces!")
      pyb.LED(BLUE_LED_PIN).on()
      
      diff = 10 # We'll say we detected a face after 10 frames.
      while(diff):
          img = sensor.snapshot()
          # Threshold是介于0.0-1.0的阈值,较低值会同时提高检出率和假阳性
          # 率。相反,较高值会同时降低检出率和假阳性率。
          # scale是一个必须大于1.0的浮点数。较高的比例因子运行更快,
          # 但其图像匹配相应较差。理想值介于1.35-1.5之间。
      
          faces = img.find_features(face_cascade, threshold=0.5, scale_factor=1.5)
      
          if faces:
              diff -= 1
              for r in faces:
                  img.draw_rectangle(r)
      
      g = gif.Gif("example-%d.gif" % pyb.rng(), loop=True)
      
      clock = time.clock() # Tracks FPS.
      print("You're on camera!")
      for i in range(100):
          clock.tick()
          # clock.avg() returns the milliseconds between frames - gif delay is in
          g.add_frame(sensor.snapshot(), delay=int(clock.avg()/10)) # centiseconds.
          print(clock.fps())
      
      g.close()
      pyb.LED(BLUE_LED_PIN).off()
      print("Restarting...")
      发布在 OpenMV Cam
      L
      lndf
    • openmv如何同时实现Wifi图像传输人脸识别和录像功能

      openmv自带单个程序,小白不懂怎么混合

      发布在 OpenMV Cam
      L
      lndf
    • RE: 有没有可以开机录像并且有人脸识别的程序?

      😇

      发布在 OpenMV Cam
      L
      lndf
    • RE: 有没有可以开机录像并且有人脸识别的程序?

      同时有Wifi模块能在网址上实时观察

      发布在 OpenMV Cam
      L
      lndf
    • 有没有可以开机录像并且有人脸识别的程序?

      小白不懂啊啊啊啊啊

      发布在 OpenMV Cam
      L
      lndf
    • RE: 有没有开机就可以录像并且有人脸识别功能的混合程序,小白一个,谢谢大佬帮助

      Ddddddddddddddddddddd

      发布在 OpenMV Cam
      L
      lndf
    • RE: 有没有开机就可以录像并且有人脸识别功能的混合程序,小白一个,谢谢大佬帮助

      求大佬帮助,有人脸识别的程序 但是不知道怎么混合

      发布在 OpenMV Cam
      L
      lndf
    • 有没有开机就可以录像并且有人脸识别功能的混合程序,小白一个,谢谢大佬帮助

      我用的是openmv2

      发布在 OpenMV Cam
      L
      lndf