Navigation

    • Login
    • Search
    • 版块
    • 产品
    • 教程
    • 论坛
    • 淘宝
    1. Home
    2. or1s
    O
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    or1s

    @or1s

    0
    Reputation
    1
    Posts
    85
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    or1s Follow

    Posts made by or1s

    • 为什么在中文文档中找的方法报错?

      0_1627465728884_335b1655-bbfc-4703-88fb-e701f92e8845-image.png

      import sensor, image, time
      from pyb import UART
      green_threshold   = (   66,   80,  -15,   0,   -6,   15)
      
      sensor.reset() 
      sensor.set_pixformat(sensor.RGB565) 
      sensor.set_framesize(sensor.QQVGA) 
      sensor.skip_frames(time = 2000) 
      sensor.set_auto_gain(False) 
      sensor.set_auto_whitebal(False)
      
      clock = time.clock() 
      uart = UART(3, 115200)
      while(True):
          clock.tick() 
          img = sensor.snapshot() 
          print(type(img))
          blobs = img.find_blobs([green_threshold])
          print(blobs.corners())
          if blobs:
              for b in blobs:
                  img.draw_rectangle(b[0:4]) 
                  for i in range(4):
                      print(b[i]) 
                  img.draw_cross(b[5], b[6]) 
                  uart.write("x:")
                  uart.write(str(b[5]))
                  uart.write("y:")
                  uart.write(str(b[6]))
                  uart.write("\r\n")
                  print("x:"+str(b[5])+","+"y:"+str(b[6]))
          #print(clock.fps()) # 注意: 你的OpenMV连到电脑后帧率大概为原来的一半
      

      Traceback (most recent call last):
      File "", line 77, in
      AttributeError: 'list' object has no attribute 'corners'
      MicroPython: v1.15-r32 OpenMV: v4.0.2 HAL: v1.9.0 BOARD: OPENMV4P-STM32H743
      Type "help()" for more information.

      print(blobs.corners())

      我这样使用就会报这样的错
      主要是想问大家这个东西该怎么用

      posted in OpenMV Cam
      O
      or1s