导航

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

    维他奶

    @维他奶

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

    维他奶 关注

    维他奶 发布的帖子

    • RE: 怎么把人脸检测的方框数提取出来,并传输给单片

      @yuan openmv的上位机是可以打印出来有几个框,但是单片机接回来的数据是00 30 00
      下面是单片机的主函数代码
      void macUSART_INT_FUN(void)
      {
      static uint16_t usRxCount = 0;

      if(USART_GetITStatus( macUSARTx, USART_IT_RXNE ) != RESET)
      {			
      	ucTemp = USART_ReceiveData( macUSARTx );
      	/* 遇到换行字符,认为接收到一个命令 */
      		Usart_SendStr_length( macUSARTx, ucaRxBuf, usRxCount );
      		a = ucaRxBuf[24];
      		printf("%d",a);
      		usRxCount = 0;
      }
      	else
      	{
      		ucaRxBuf[usRxCount++] = ucTemp;
      	}
      

      }

      int main(void)
      {
      // /* USART1 配置模式为 115200 8-N-1,中断接收 */
      USARTx_Config();
      NVIC_Configuration();

      Usart_SendString( macUSARTx, "这是一个串口中断接收回显实验\n" );
      Usart_SendString( macUSARTx, "输入数据并以回车键结束\n" );
      

      }

      发布在 OpenMV Cam
      维
      维他奶
    • RE: 怎么把人脸检测的方框数提取出来,并传输给单片

      @yuan import sensor, time, image, pyb,lcd
      from pyb import UART
      led = pyb.LED(3)
      sensor.reset()
      sensor.set_contrast(1)
      sensor.set_gainceiling(16)
      sensor.set_framesize(sensor.HQVGA)
      sensor.set_pixformat(sensor.GRAYSCALE)
      face_cascade = image.HaarCascade("frontalface", stages=25)
      uart = UART(3,19200)
      print(face_cascade)
      clock = time.clock()
      lcd.init() # Initialize the lcd screen.
      while (True):
      clock.tick()
      img = sensor.snapshot()
      objects = img.find_features(face_cascade, threshold=0.75, scale_factor=1.25)
      for a in objects:
      img.draw_rectangle(a)
      time.sleep(2000)
      uart.write("%s",a[2])
      time.sleep(1000)

      print(clock.fps())

      lcd.display(img) # Take a picture and display the image.

      这是代码,我要把检测到的人脸个数传送给单片机

      发布在 OpenMV Cam
      维
      维他奶
    • RE: 怎么把人脸检测的方框数提取出来,并传输给单片

      @yuan 不能直接print(a)

      发布在 OpenMV Cam
      维
      维他奶
    • 怎么把人脸检测的方框数提取出来,并传输给单片
      import sensor, time, image, pyb,lcd
      from pyb import UART
      led = pyb.LED(3)
      sensor.reset()
      sensor.set_contrast(1)
      sensor.set_gainceiling(16)
      sensor.set_framesize(sensor.HQVGA)
      sensor.set_pixformat(sensor.GRAYSCALE)
      face_cascade = image.HaarCascade("frontalface", stages=25)
      uart = UART(3,19200)
      print(face_cascade)
      clock = time.clock()
      lcd.init() # Initialize the lcd screen.
      while (True):
          clock.tick()
          img = sensor.snapshot()
          objects = img.find_features(face_cascade, threshold=0.75, scale_factor=1.25)
          for a in objects:
              img.draw_rectangle(a)
              time.sleep(2000)
                    uart.write("%s",a[2])
                    time.sleep(1000)请在这里粘贴代码
      
      发布在 OpenMV Cam
      维
      维他奶