导航

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

    iuk4 发布的帖子

    • OPENMV4怎么把if语句中执行后的数传递到语句外使用?
      import sensor, image, time
      green_threshold   = (18, 37, -6, 26, -72, -25)
      sensor.reset() 
      sensor.set_pixformat(sensor.RGB565) 
      sensor.set_framesize(sensor.QVGA) 
      sensor.skip_frames(time = 2000) 
      clock = time.clock() 
      
      while(True):
          
          clock.tick() 
          img = sensor.snapshot() 
          colour_blobs = img.find_blobs([green_threshold],area_threshold=1000)
          
          if colour_blobs:   
              for b in colour_blobs:
                img.draw_rectangle(b[0:4]) 
                img.draw_cross(b[5], b[6]) 
                print(b[5])                              
                if b[5] >= 200:
                      a=b[8]
                  #print("a=",a)
                elif b[5] <= 100:
                      b=b[8]
                  #print("b=",b)
                else :
                      c=b[8]
                  #print("c=",c)
      

      目的:print(a,b,c) #此语句一直错误,不知道怎么写
      (x轴分三部分,把这三部分在if语句中处理的颜色编号1,2,4传递到if语句外面使用)

      发布在 OpenMV Cam
      I
      iuk4