导航

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

    gtq4 发布的帖子

    • 我想用串口只发送一次数据,不想让他一直发,用到什么代码

      .........................

      发布在 OpenMV Cam
      G
      gtq4
    • 向串口发送列表

      import sensor, image, time
      from pyb import UART
      sensor.reset() # Reset and initialize the sensor.
      sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
      sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
      sensor.skip_frames(time = 2000) # Wait for settings take effect.
      clock = time.clock()
      uart=UART(3,9600)# Create a clock object to track the FPS.
      uart.init(9600,bits=8,parity=None,stop=1)
      list=[1,1,2]
      while(True):

      clock.tick() 
      uart.write(list)
      

      我现在这样写他会出现 需要具有缓冲协议的对象,该怎么改。

      发布在 OpenMV Cam
      G
      gtq4
    • 我想知道怎么将列表元素发出去

      0_154349639025.png

      发布在 OpenMV Cam
      G
      gtq4
    • openmv颜色例程问题
      # 多颜色组合识别
      。
      
      import sensor, image, time
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      sensor.skip_frames(time = 2000)
      sensor.set_auto_gain(False) # must be turned off for color tracking
      sensor.set_auto_whitebal(False) # must be turned off for color tracking
      clock = time.clock()
      
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
          for blob in img.find_blobs(thresholds, pixels_threshold=100, area_threshold=100, merge=True):
              if blob.code() == 3: # r/g code
                  img.draw_rectangle(blob.rect())
                  img.draw_cross(blob.cx(), blob.cy())
                  img.draw_string(blob.x() + 2, blob.y() + 2, "r/g")
              if blob.code() == 5: # r/b code
                  img.draw_rectangle(blob.rect())
                  img.draw_cross(blob.cx(), blob.cy())
                  img.draw_string(blob.x() + 2, blob.y() + 2, "r/b")
              if blob.code() == 6: # g/b code
                  img.draw_rectangle(blob.rect())
                  img.draw_cross(blob.cx(), blob.cy())
                  img.draw_string(blob.x() + 2, blob.y() + 2, "g/b")
              if blob.code() == 7: # r/g/b code
                  img.draw_rectangle(blob.rect())
                  img.draw_cross(blob.cx(), blob.cy())
                  img.draw_string(blob.x() + 2, blob.y() + 2, "r/g/b")
          print(clock.fps())
      
      

      blob.code=? 这个数字是因为红色色块是1,绿色是2,蓝色是4吗,怎么得来的。如果我只想判断是否是红色色块是不是就是 blob.code=1,绿色就是 blob.code=2

      发布在 OpenMV Cam
      G
      gtq4
    • 三个代号1,2,3的色块,并排放在一起,摄像头从左到右一次检测,代码逻辑怎么写知道三个色块放置的顺序。

      求程序的逻辑和思路,如色块顺序是321,识别后将321打包发送给串口

      发布在 OpenMV Cam
      G
      gtq4
    • 三个色块并排放在一起,摄像头依次识别,通过识别将他们的位置发给单片机,如红色色块第一个被识别,就先发送红色色块的位置。

      openmv有相应代码可以实现吗

      发布在 OpenMV Cam
      G
      gtq4
    • RE: openmv颜色识别能识别离摄像头最近的色块吗,如果能用到那些代码。

      那我通过摄像头识别三个大小一样的色块,知道他们的位置后,将他们所处的位置发给单片机也不能实现吗

      发布在 OpenMV Cam
      G
      gtq4
    • RE: openmv颜色识别能识别离摄像头最近的色块吗,如果能用到那些代码。

      前提是色块大小一,就识别离摄像头最近的

      发布在 OpenMV Cam
      G
      gtq4
    • openmv颜色识别能识别离摄像头最近的色块吗,如果能用到那些代码。

      如摄像头拍了一张图片,图片中有三种颜色的色块。我想识别离摄像头最近的色块,该怎么写

      发布在 OpenMV Cam
      G
      gtq4
    • RE: 我想将串行终端显示的内容显示到LCD屏幕上,怎么操作

      您好,我的意思是假如识别二维码,二维码内容会在串行终端显示,我想将其内容显示屏幕上

      发布在 OpenMV Cam
      G
      gtq4
    • 我想将串行终端显示的内容显示到LCD屏幕上,怎么操作

      具体用到那些代码,需要哪些环节

      发布在 OpenMV Cam
      G
      gtq4
    • RE: 脱机运行时,代码怎么改才能在识别二维码时候只拍一次二维码,二维码内容就一直出现在LCD上,而不用一直对准二维码识别

      那是不是 a="code.payload"
      while True:
      for code in img.find_qrcodes()
      a=code.payload()
      img.draw()
      lcd.display(img)

      发布在 OpenMV Cam
      G
      gtq4
    • RE: 脱机运行时,代码怎么改才能在识别二维码时候只拍一次二维码,二维码内容就一直出现在LCD上,而不用一直对准二维码识别

      请问下第一行要显示的字符串=“”怎么用代码表示

      发布在 OpenMV Cam
      G
      gtq4
    • 脱机运行时,代码怎么改才能在识别二维码时候只拍一次二维码,二维码内容就一直出现在LCD上,而不用一直对准二维码识别
      import sensor, image, time, lcd, pyb
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      sensor.skip_frames(time = 2000)
      sensor.set_auto_gain(False) # must turn this off to prevent image washout...
      clock = time.clock()
      lcd.init() # Initialize the lcd screen.
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
      
      
          for i in range(10):
              x = (pyb.rng() % (2*img.width())) - (img.width()//2)
              y = (pyb.rng() % (2*img.height())) - (img.height()//2)
              r = (pyb.rng() % 127) + 128
              g = (pyb.rng() % 127) + 128
              b = (pyb.rng() % 127) + 128
      
      
          img.lens_corr(1.8) # strength of 1.8 is good for the 2.8mm lens.
          for code in img.find_qrcodes():
              img.draw_rectangle(code.rect(), color = (255, 0, 0))
              print(code)
              img.draw_string(x, y, code.payload(), color = (255, 0, 0), scale = 5, mono_space = False)
      
          lcd.display(img)
          print(clock.fps())
      
      
      发布在 OpenMV Cam
      G
      gtq4
    • RE: 识别一个内容为123的二维码,想让其二维码内容出现在LCD屏幕上。出现错误:没有足够的位置参数,

      我看到了,哇没注意

      发布在 OpenMV Cam
      G
      gtq4
    • RE: 识别一个内容为123的二维码,想让其二维码内容出现在LCD屏幕上。出现错误:没有足够的位置参数,

      检查了好几遍,自己也改了,不对,一扫到二维码就出现错误。。。。

      发布在 OpenMV Cam
      G
      gtq4
    • 识别一个内容为123的二维码,想让其二维码内容出现在LCD屏幕上。出现错误:没有足够的位置参数,
      # QRCode Example
      #
      # This example shows the power of the OpenMV Cam to detect QR Codes
      # using lens correction (see the qrcodes_with_lens_corr.py script for higher performance).
      
      import sensor, image, time, lcd, pyb
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      sensor.skip_frames(time = 2000)
      sensor.set_auto_gain(False) # must turn this off to prevent image washout...
      clock = time.clock()
      lcd.init() # Initialize the lcd screen.
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
          
      
          for i in range(10):
              x = (pyb.rng() % (2*img.width())) - (img.width()//2)
              y = (pyb.rng() % (2*img.height())) - (img.height()//2)
              r = (pyb.rng() % 127) + 128
              g = (pyb.rng() % 127) + 128
              b = (pyb.rng() % 127) + 128
          
      
          img.lens_corr(1.8) # strength of 1.8 is good for the 2.8mm lens.
          for code in img.find_qrcodes():
              img.draw_rectangle(code.rect(), color = (255, 0, 0))
              print(code)
              img.draw_string(img.draw_string(x, y, code.payload(), color = (r, g, b), scale = 2, mono_space = False)
      )
          lcd.display(img)
          print(clock.fps())
      
      
      发布在 OpenMV Cam
      G
      gtq4
    • 运行后一扫到二维码就出现错误 oseeor: Not enough positional arguments!
      # QRCode Example
      #
      # This example shows the power of the OpenMV Cam to detect QR Codes
      # using lens correction (see the qrcodes_with_lens_corr.py script for higher performance).
      
      import sensor, image, time,lcd
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      sensor.skip_frames(time = 2000)
      sensor.set_auto_gain(False) # must turn this off to prevent image washout...
      clock = time.clock()
      lcd.init() # Initialize the lcd screen.
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
          img.lens_corr(1.8) # strength of 1.8 is good for the 2.8mm lens.
          for code in img.find_qrcodes():
              img.draw_rectangle(code.rect(), color = (255, 0, 0))
              print(code)
              img.draw_string(code.payload())
          lcd.display(img)
          print(clock.fps())
      
      
      发布在 OpenMV Cam
      G
      gtq4
    • RE: 一扫二维码就会出现图像属性没有draw,改哪里吗

      还是回复没有足够的位置参数,怎么搞呢,谢谢

      发布在 OpenMV Cam
      G
      gtq4
    • 一扫二维码就会出现图像属性没有draw,改哪里吗

      0_1539491778833_11.png

      发布在 OpenMV Cam
      G
      gtq4