导航

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

    54bx

    @54bx

    0
    声望
    1
    楼层
    155
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录

    54bx 关注

    54bx 发布的帖子

    • 为什么我直接复制教程的分辨不同人脸的代码,在我的openmv里运行不了
      # 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, machine
      import 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.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)
      
      num = 1 #设置被拍摄者序号,第一个人的图片保存到s1文件夹,第二个人的图片保存到s2文件夹,以此类推。每次更换拍摄者时,修改num值。
      
      n = 20 #设置每个人拍摄图片数量。
      
      #连续拍摄n张照片,每间隔3s拍摄一次。
      while(n):
          #红灯亮
          machine.LED("LED_RED").on()
          #pyb.LED(RED_LED_PIN).on()
          sensor.skip_frames(time = 3000) # Give the user time to get ready.等待3s,准备一下表情。
      
          #红灯灭,蓝灯亮
          machine.LED("LED_RED").off()
          machine.LED("LED_BLUE").on()
          #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()
          machine.LED("LED_BLUE").off()
          print("Done! Reset the camera to see the saved image.")
      

      0_1721280306460_QQ截图20240718132318.png
      0_1721280319882_QQ截图20240718132336.png

      发布在 OpenMV Cam
      5
      54bx