导航

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

    syxh

    @syxh

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

    syxh 关注

    syxh 发布的帖子

    • RE: IDE中预览时出现黑色条纹轮播

      @kidswong999 我接LCD显示模块也是这样

      发布在 OpenMV Cam
      S
      syxh
    • RE: IDE中预览时出现黑色条纹轮播

      @kidswong999 2.6.9版本IDE录制的帧缓冲区

      发布在 OpenMV Cam
      S
      syxh
    • RE: IDE中预览时出现黑色条纹轮播

      @kidswong999 OV7725,固件版本4.0.2

      发布在 OpenMV Cam
      S
      syxh
    • IDE中预览时出现黑色条纹轮播

      0_1627647459480_1 00_00_00-00_00_30_1.jpeg 0_1627647464280_1 00_00_00-00_00_30_2.jpeg 0_1627647474247_1 00_00_00-00_00_30_4.jpeg

      import sensor, image, time
      
      sensor.reset() # 初始化sensor
      sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
      #设置图像色彩格式,有RGB565色彩图和GRAYSCALE灰度图两种
      sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others)
      sensor.set_saturation(3)
      sensor.set_contrast(3)
      sensor.set_brightness(3)
      sensor.skip_frames(time = 1000)
      sensor.set_auto_exposure(False, 4532)
      sensor.set_auto_gain(False,gain_db=8.95857)
      sensor.set_auto_whitebal(False,rgb_gain_db=(-4.64378, -6.02073, -3.05939))
      sensor.skip_frames(time = 3000)
      clock = time.clock()
      
      while(True):
          clock.tick()
          img = sensor.snapshot()#.find_edges(image.EDGE_CANNY,threshold=(70, 100))
          '''cs=img.find_circles(threshold = 3000, x_margin = 50, y_margin = 50, r_margin = 10,r_min = 2, r_max = 100, r_step = 2)
          if cs:
              for c in cs:
                  img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))
                  print(c)
          else:
              print("None")'''
          print(clock.fps())
      
      发布在 OpenMV Cam
      S
      syxh
    • 启动后亮度不一致,而且串口打印的白平衡也与设定的不一致

      1_1626438793589_屏幕截图 2021-07-16 171514.jpg 0_1626438793587_屏幕截图 2021-07-16 171437.jpg 0_1626438932873_屏幕截图 2021-07-16 203518.jpg

      import sensor, image, time,car
      from pyb import LED
      from pid import PID
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QQVGA)
      sensor.set_vflip(True)
      sensor.set_hmirror(True)
      sensor.set_auto_gain(False,gain_db=6.02)
      #sensor.set_auto_whitebal(False,rgb_gain_db=(63.4416, 60.2071, 63.7403))#H7 PLUS
      sensor.set_auto_whitebal(False,rgb_gain_db=(-5,-6,-3))#H7
      '''sensor.set_saturation(3)#饱和度
      sensor.set_contrast(3)#对比度
      sensor.set_brightness(3)#亮度'''
      sensor.skip_frames(time = 2000)
      clock = time.clock() # 跟踪FPS帧率
      
      rho_pid = PID(p=0.6, i=0)
      theta_pid = PID(p=0.001, i=0)
      THRESHOLD= (32, 69, -12, 22, -13, 15)
      BLACK=((100,100),[250,255])
      while(True):
          clock.tick()
          img = sensor.snapshot().lens_corr(strength = 1.8, zoom = 1.0).mean(2).binary([THRESHOLD])
      
          line = img.get_regression([BLACK[0]],roi=(0,sensor.height()-40,sensor.width(),40),x_stride=2,y_stride=2,pixels_threshold=1,robust = True)
          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)
              print(rho_err,line.magnitude(),theta_err)
              #if -40<b_err<40 and -30<t_err<30:
              rho_output = rho_pid.get_pid(rho_err,1)
              theta_output = theta_pid.get_pid(theta_err,1)
              output = rho_output+theta_output
              car.run(30+output, 30-output)
          else:
              car.run(20,-20)
              pass
          print(clock.fps(),sensor.get_gain_db())
      
      
      发布在 OpenMV Cam
      S
      syxh
    • 识别矩形时识别对象不稳定,经常框到图像边缘

      0_1618933214432_4d96d8c0-564b-433c-bd49-bb437a413ae3-image.png
      0_1618933244832_86d29a55-aca7-408f-b12d-26ed1ece49fb-image.png

      # Untitled - By: Misaki - 周六 12月 19 2020
      
      import sensor, image, time
      
      sensor.reset()
      sensor.set_pixformat(sensor.GRAYSCALE)
      #sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QQVGA)
      sensor.skip_frames(time = 2000)
      
      clock = time.clock()
      def find_max(rects):
          max_size=0
          max_rect=rects
          for rect in rects:
              if rect[2]*rect[3] > max_size:
                  max_rect=rects
                  max_size = rect[2]*rect[3]
          return max_rect
      def find_max_rects(img):
          rects=img.find_rects(threshold=12000)
          for max_rect in find_max(rects):
              img.draw_rectangle(max_rect.rect(), color = (255, 255, 255))
              #img.draw_edges(max_rect.corners(), color = (255, 255, 255))
      
              return max_rect
          else:
              return 0
      while(True):
          clock.tick()
          img = sensor.snapshot().gaussian(1).find_edges(image.EDGE_CANNY,threshold=(50, 90))
          print(find_max_rects(img))
          '''for c in img.find_circles(threshold = 2500, x_margin =10, y_margin = 10, r_margin = 10,r_min = 50, r_max = 200, r_step = 2):
              img.draw_circle(c.x(), c.y(), c.r(), color = (255, 255, 255))
              print(c)
          for l in img.find_line_segments(merge_distance = 0, max_theta_diff = 0):
              img.draw_line(l.line(), color = (255, 0, 0))
              print(l)'''
      
          print(clock.fps())
      
      
      发布在 OpenMV Cam
      S
      syxh
    • RE: 更新固件后运行旧程序时内存不足

      这程序也没几行,为啥这么点代码就内存不足了

      发布在 OpenMV Cam
      S
      syxh
    • 更新固件后运行旧程序时内存不足

      0_1618844862423_483e335c-5539-44a6-bb9a-0fa478dd61f5-image.png

      # Untitled - By: Misaki - 周六 12月 19 2020
      
      import sensor, image, time,lcd
      
      lcd.init(freq=15000000)
      sensor.reset()
      #sensor.set_pixformat(sensor.GRAYSCALE)
      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()
          lcd.display(img)
          '''for c in img.find_circles(threshold = 2500, x_margin =10, y_margin = 10, r_margin = 10,r_min = 50, r_max = 200, r_step = 2):
              img.draw_circle(c.x(), c.y(), c.r(), color = (255, 255, 255))
              print(c)
          for l in img.find_line_segments(merge_distance = 0, max_theta_diff = 0):
              img.draw_line(l.line(), color = (255, 0, 0))
              print(l)'''
          
          for r in img.find_rects(threshold=13000):
              img.draw_rectangle(r.rect(), color = (255, 255, 255))
              img.draw_edges(r.corners(), color = (0, 0, 0))
              for p in r.corners():
                  img.draw_circle(p[0], p[1], 5, color = (255, 255, 255))
                  print(r)
          print(clock.fps())
      
      发布在 OpenMV Cam
      S
      syxh
    • 7 Puls关闭白平衡,IDE显示黑屏

      sensor.set_auto_whitebal(False,rgb_gain_db=(-5,-6,-3))
      H7运行结果:
      0_1618328417932_17ea532e-987f-4f5c-9fdd-9b22b169c68b-image.png
      H7 Plus运行结果:
      0_1618328535394_677f7b80-089f-449f-83da-4455b626eb62-image.png

      发布在 OpenMV Cam
      S
      syxh