导航

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

    34yl

    @34yl

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

    34yl 关注

    34yl 发布的帖子

    • 如何将拍摄并保存好的图片通过串口发送到开发板

      我之前是想通过获取图片的灰度和宽高,转化成16进制去发送,但是代码有错误,而且这样的话在接收端也需要重新组合,有没有更方便的方法

      请在这里粘贴代码
      

      import time, image
      from pyb import UART
      file_abs = None
      uart = UART(3, 19200)
      oled = []
      s = [100]
      n=0
      classmates = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']
      while (True):
      lu = ('singtown/first.png')
      file_abs = image.Image(lu,copy_to_fb=True)
      va1 = 64
      width = int(file_abs.width()/va1)
      high = int(file_abs.height()/va1)
      #gray_lwpCV = file_abs.get_pixel(i,j)
      for i in range(high):
      for j in range(width):
      gray_lwpCV = file_abs.get_pixel(i,j)
      oled.append('gray_lwpCV')
      sss = len(oled)
      for i in range(sss):
      while oled[i]>0:
      s[n] = oled[i]%16
      oled[i]=oled[i]/16
      n+=1
      for m in n:
      hhex = classmates[s[m]]
      uart.write(hhex)
      print(hhex)

      发布在 OpenMV Cam
      3
      34yl