导航

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

    u4ey

    @u4ey

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

    u4ey 关注

    u4ey 发布的帖子

    • 如何将拍摄的图片压缩并且分包?
      import sensor,time,image#引入感光元件的模块
      
      from pyb import UART
      
      from pyb import LED
      from pyb import Pin
      import pyb
      # 设置摄像头
      
      sensor.reset()#初始化感光元件
      
      sensor.set_pixformat(sensor.RGB565)#设置为彩色
      
      sensor.set_framesize(sensor.QVGA)#设置图像的大小
      
      sensor.skip_frames()#跳过n张照片,在更改设置后,跳过一些帧,等待感光元件变稳定。
      
      
      uart = UART(3, 115200)
      
      led = LED(2)
      img = sensor.snapshot()
      uart.write(img.compress())
      

      原代码是这样,已经可以成功通过串口发送图片压缩后的二进制数据,但是在单片机接受的时候不能一次性接受那么多数据,请问如何将图片分包发送?

      发布在 OpenMV Cam
      U
      u4ey
    • RE: 为什么OPENMV无法串口通信发送到STM32

      STM32接收端没有问题,因为我尝试STM32与电脑通信是正常的

      发布在 OpenMV Cam
      U
      u4ey
    • RE: 为什么OPENMV无法串口通信发送到STM32

      检测是否接受串口用的是if(USART_RX_STA&0X8000)

      发布在 OpenMV Cam
      U
      u4ey
    • 为什么OPENMV无法串口通信发送到STM32
      import sensor,time,image#引入感光元件的模块
      
      from pyb import UART
      
      from pyb import LED
      from pyb import Pin
      import pyb
      # 设置摄像头
      
      sensor.reset()#初始化感光元件
      
      sensor.set_pixformat(sensor.RGB565)#设置为彩色
      
      sensor.set_framesize(sensor.QVGA)#设置图像的大小
      
      sensor.skip_frames()#跳过n张照片,在更改设置后,跳过一些帧,等待感光元件变稳定。
      
      
      uart = UART(3, 115200)
      
      led = LED(2) 
      img = sensor.snapshot()
      #uart.write(img.compress())
      while(1):
          uart.write('1')
          uart.write('\r\n')
          print(1) 
          led.on()
          time.sleep(150)
          led.off()
          time.sleep(100)
          led.on()
          time.sleep(150)
          led.off()
          time.sleep(600)
      

      尝试脱机运行成功,并且串口引脚连接也正常。
      如果用USB转TTL链接电脑,使用该代码发送信息到电脑,可以用串口调试助手接收,请问openmv发送到STM32出了什么问题

      发布在 OpenMV Cam
      U
      u4ey
    • 为什么用串口发送jpg图片的二进制形式有错误?
      import sensor,time,image#引入感光元件的模块
      
      from pyb import UART
      
      
      # 设置摄像头
      
      sensor.reset()#初始化感光元件
      
      sensor.set_pixformat(sensor.RGB565)#设置为彩色
      
      sensor.set_framesize(sensor.QVGA)#设置图像的大小
      
      sensor.skip_frames()#跳过n张照片,在更改设置后,跳过一些帧,等待感光元件变稳定。
      
      
      
      # 一直拍照
      uart = UART(3, 19200)
      
      img = sensor.snapshot()#拍摄一张照片,img为一个image对象
      
      uart.write(img)
      

      我用串口发送二进制的图片数据到电脑,然后将这些二进制数字保存下来用jpg格式打开,发现无法识别。
      而且对比原图片的二进制数字,发现串口发送的数字不一样?

      发布在 OpenMV Cam
      U
      u4ey
    • RE: openmv运行程序后自动断电如何解决?

      @kidswong999

      import sensor, image, time, 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 = 1000)
      while(True):
      img = sensor.snapshot()
      roi1=(10,0,80,60)
      d1= img.find_lbp(roi1)

      删去部分函数,只重复给d1赋值相同的lbp时,不会断电

      发布在 OpenMV Cam
      U
      u4ey
    • RE: openmv运行程序后自动断电如何解决?

      @kidswong999 能不能解释一下为什么错了,如何解决错误

      发布在 OpenMV Cam
      U
      u4ey
    • openmv运行程序后自动断电如何解决?
      # Untitled - By: Lenovo - 周二 9月 17 2019
      
      import sensor, image, time, 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 = 1000)
      while(True):
          img = sensor.snapshot()
          roi1=(10,0,80,60)
          roi2=(40,20,78,20)
          d1= img.find_lbp(roi1)
          d1= img.find_lbp(roi2)
      
      

      用的M7模块,运行后直接断电

      发布在 OpenMV Cam
      U
      u4ey