导航

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

    z4a5

    @z4a5

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

    z4a5 关注

    z4a5 发布的帖子

    • RE: 在edgeimpulse上为什么设置分组了不显示也不能用,训练错误呀?

      @geiu我的输出要素也没有显示,在线等

      发布在 OpenMV Cam
      Z
      z4a5
    • 单独使用串口和串口与i2c一起使用时串口助手收到的数据不一样,请问怎么解决
      THRESHOLD = (3, 34, -69, 115, -48, 127)
      
      import sensor, image, time, pyb
      from pyb import LED
      from pid import PID
      from pyb import UART
      import math
      from machine import I2C
      from vl53l1x import VL53L1X
      rho_pid = PID(p=0.4, i=0)
      theta_pid = PID(p=0.001, i=0)
      uart = UART(3, 115200)
      i2c = I2C(2)
      distance_sensor = VL53L1X(i2c)
      LED(1).on()
      LED(2).on()
      LED(3).on()
      
      sensor.reset()
      sensor.set_vflip(True)
      sensor.set_hmirror(True)
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QQQVGA)
      sensor.skip_frames(time = 2000)
      data1 = 0x2c
      data2 = 0x2b
      clock = time.clock()
      
      roi1 = [(0, 0, 25, 20),
              (0, 45, 32, 50),
              (50, 45, 30, 50)
              ]
      
      while True:
          clock.tick()
          img = sensor.snapshot().binary([THRESHOLD])
      
          ROI_L = (22, 31, 4, 5)
          ROI_R = (43, 31, 6, 5)
          ROI1 = (34, 12, 12, 31)
          ROI2 = (27, 45, 15, 15)
          ROI3 = (32, 30, 6, 12)
      
          blobs1 = img.find_blobs([(100, 100)], roi=ROI_L, area_threshold=15, merge=True)
          blobs2 = img.find_blobs([(100, 100)], roi=ROI_R, area_threshold=15, merge=True)
          blobs3 = img.find_blobs([(100, 100)], roi=ROI1, area_threshold=15, merge=True)
          blobs4 = img.find_blobs([(100, 100)], roi=ROI2, area_threshold=15, merge=True)
          blobs5 = img.find_blobs([(100, 100)], roi=ROI3, area_threshold=15, merge=True)
      
          img = sensor.snapshot().binary([THRESHOLD])
      
          line = img.get_regression([(100, 100)], robust=True)
      
          img.draw_line((25, 0, 25, 60), color=(0, 255, 0))
          img.draw_line((47, 0, 47, 60), color=(0, 255, 0))
          img.draw_line((0, 45, 25, 45), color=(0, 255, 0))
          img.draw_line((47, 45, 80, 45), color=(0, 255, 0))
      
          if blobs1 and blobs2:
              #print(666)
              output1 = int(50) + 50
              output_str1 = bytearray([output1])
              uart.write('@')
              uart.write(bytearray(b'd'))
              uart.write('\r\n')
      
          if line:
      		 rho_err = abs(line.rho()) - img.width() / 2
      		 if line.theta() > 90:
      			 theta_err = line.theta() - 180
      		 else:
      			 theta_err = line.theta()
      			 img.draw_line(line.line(), color=127)
      		 if line.magnitude() > 8:
      			 rho_output = rho_pid.get_pid(rho_err, 1)
      			 theta_output = theta_pid.get_pid(theta_err, 1)
      			 output = rho_output + theta_output
      			 output = int(output) + 50
                               OUTPUT = str(round(output))
                               outut_str = bytearray([output])
                               uart.write(bytes([0x2C]))
                               uart.write(outut_str )
                               uart.write(bytes([0x5B]))  # 将16进制转换为字
                               print(outut_str )
      # 读取测距模块数据
          distance = distance_sensor.read()
      
          # 对测距数据进行处理
          distance = distance / 10  # 假设测距模块返回的是以毫米为单位的距离数据
          distance = int(distance)
          print("Distance:", distance, "mm")
          outut_str2 = bytearray([distance])
          uart.write(bytes([0x2C]))
          uart.write(outut_str2 )
          uart.write(bytes([0x5B]))
          time.sleep(0.1)
      
      发布在 OpenMV Cam
      Z
      z4a5
    • 插了测距拓展版但是没办法打开是怎么回事

      0_1690440864374_829e38b4-0d7d-472d-b33d-8c5d18a84633-image.png

      请在这里粘贴代码
      
      发布在 OpenMV Cam
      Z
      z4a5