导航

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

    xd4v 发布的帖子

    • RE: openmv发送数据串口助手收不到

      @kidswong999 重新插拔一下USB接口 ,就正常了😂

      发布在 OpenMV Cam
      X
      xd4v
    • RE: openmv发送数据串口助手收不到

      @kidswong999 确实是是按照例程来的,线也接的没问题

      发布在 OpenMV Cam
      X
      xd4v
    • RE: openmv发送数据串口助手收不到

      @kidswong999 你好 我的也是这个问题,代码一样,OPENMV可以接收到数据但是发不出去,求教

      发布在 OpenMV Cam
      X
      xd4v
    • RE: 直线检测报错,求教!

      @kidswong999
      0_1544067185831_29cd067a-0305-42c1-81e0-ff7b2a817e3d-image.png

      嗯嗯 刚才忘了加冒号。。。改过之后变成这样了,说帧缓存区空间不够?这是怎么回事啊

      
      import sensor, image, time
      
      sensor.reset()
      sensor.set_framesize(sensor.QVGA)
      sensor.set_pixformat(sensor.RGB565)
      
      
      Line_threshold = (60, 100, -18, 32, -33, 56) # L A B
      
      sensor.skip_frames(time = 1000)
      clock = time.clock()
      
      min_degree = 0
      max_degree = 179
      #img_raw = sensor.snapshot().lens_corr(1.8).save('test.bmp')
      
      
      
      
      img_op=image.Image('123.bmp',copy_to_fb=True)
      
      
      #time.sleep(3000)
      img_op.binary([Line_threshold])
      
      #img_op.erode(2)
      
      img_op.dilate(1)
      img_op.erode(1)
      for l in img_op.find_line_segments(merge_distance=10, max_theta_differance=2):
      #if (min_degree <= l.theta()) and (l.theta() <= max_degree):
          img_op.draw_line(l.line(), color = (255, 0, 0))
          print(l.theta())
      
      
      
      sensor.flush()
      
      time.sleep(100)
      
      发布在 OpenMV Cam
      X
      xd4v
    • RE: 直线检测报错,求教!
      
      import sensor, image, time
      
      sensor.reset()
      sensor.set_framesize(sensor.QVGA)
      sensor.set_pixformat(sensor.RGB565)
      
      
      Line_threshold = (60, 100, -18, 32, -33, 56) # L A B
      
      sensor.skip_frames(time = 1000)
      clock = time.clock()
      
      min_degree = 0
      max_degree = 179
      #img_raw = sensor.snapshot().lens_corr(1.8).save('test.bmp')
      
      
      
      
      img_op=image.Image('123.bmp',copy_to_fb=True)
      
      
          #time.sleep(3000)
      img_op.binary([Line_threshold])
      
      #img_op.erode(2)
      
      img_op.dilate(1)
      img_op.erode(1)
      for l in img_op.find_line_segments(merge_distance=2, max_theta_differance=2) #(x_stride=3,y_stride=3,threshold = 1000, theta_margin = 10, rho_margin = 20):
              #if (min_degree <= l.theta()) and (l.theta() <= max_degree):
      
              img_op.draw_line(l.line(), color = (255, 0, 0))
      
              print(l.theta())
      
      
      
      sensor.flush()
      
      time.sleep(100)
      
      
      发布在 OpenMV Cam
      X
      xd4v
    • 直线检测报错,求教!

      请问这是什么错误呀

      0_1544061374565_f177d1e5-de33-4f4b-8ac0-c501d0e32f77-image.png

      发布在 OpenMV Cam
      X
      xd4v
    • RE: 求助:为什么二值化以后仍然有灰色的像素点?

      哦哦,好滴好滴,另外还有我检测到的直线,很不理想,经常会检测出很多其他的不存在的直线0_1543994807127_QQ截图20181205152631.jpg
      就像这样的。

      发布在 OpenMV Cam
      X
      xd4v
    • 求助:为什么二值化以后仍然有灰色的像素点?

      图上,黑色的线周围有一些灰色的像素点,不知道是怎么回事0.0......求教

      
      import sensor, image, time
      
      sensor.reset()
      sensor.set_framesize(sensor.QVGA)
      sensor.set_pixformat(sensor.RGB565)
      
      
      Line_threshold = (60, 100, -18, 32, -33, 56) # L A B
      
      sensor.skip_frames(time = 1000)
      clock = time.clock()
      
      min_degree = 0
      max_degree = 179
      #img_raw = sensor.snapshot().lens_corr(1.8).save('123.bmp')
      
      
      
      
      img_op=image.Image('123.bmp',copy_to_fb=True)
      
      
          #time.sleep(3000)
      img_op.binary([Line_threshold])
      
      #img_op.erode(2)
      
      img_op.dilate(1)
      img_op.erode(1)
      for l in img_op.find_lines (threshold = 3300, theta_margin = 1000, rho_margin = 10):
              if (min_degree <= l.theta()) and (l.theta() <= max_degree):
      
                 # img_op.draw_line(l.line(), color = (255, 0, 0))
      
                  print(l.theta())
      
      
      
      sensor.flush()
      
      time.sleep(100)
      
      

      0_1543994403141_QQ截图20181205151951.jpg

      发布在 OpenMV Cam
      X
      xd4v
    • RE: 无法把图片读入framebuffer,求教

      @kidswong999 谢谢老哥,整好啦!!!😛

      发布在 OpenMV Cam
      X
      xd4v
    • RE: 无法把图片读入framebuffer,求教

      @kidswong999 我的确是从软件里导出的呀。。。

      发布在 OpenMV Cam
      X
      xd4v
    • RE: 无法把图片读入framebuffer,求教

      @kidswong999 应该是什么呢??不是bmp吗?

      发布在 OpenMV Cam
      X
      xd4v
    • RE: 无法把图片读入framebuffer,求教

      没有插SD卡,example.bmp和main.py在一个文件夹里。0_1543732493166_微信截图_20181202143436.png

      发布在 OpenMV Cam
      X
      xd4v
    • 无法把图片读入framebuffer,求教

      0_1543651463853_微信截图_20181201160409.png

      import sensor, image, time
      
      # 仍然需要初始化 sensor
      sensor.reset()
      # 设置 sensor
      sensor.set_contrast(1)
      sensor.set_gainceiling(16)
      
      # 设置sensor的 pixel format
      sensor.set_framesize(sensor.QQVGA)
      sensor.set_pixformat(sensor.GRAYSCALE)
      
      # 导入 image
      img = image.Image("/example.bmp", copy_to_fb=True)
      
      # 添加画线的代码
      # img.draw_line(...)
      
      # Flush FB
      sensor.flush()
      
      # Add a small delay to allow the IDE to read the flushed image.
      time.sleep(100)
      
      发布在 OpenMV Cam
      X
      xd4v
    • RE: 请问怎么在帧缓冲区显示想要看的图像

      @kidswong999 请问怎么让framebuffer显示想要的图像呢?

      发布在 OpenMV Cam
      X
      xd4v
    • RE: 请问怎么在帧缓冲区显示想要看的图像

      这是第二个代码,刚刚忘了贴

       # Hello World Example
      #
      # Welcome to the OpenMV IDE! Click on the green run arrow button below to run the script!
      
      import sensor, image, time, pyb
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)#160X120
      sensor.skip_frames(time=100)
      clock=time.clock()
      
      while(True):
          
          
          s=sensor.snapshot()
        
          a=s.copy(copy_to_fb=True)
          
          a.to_grayscale()
          
      
      
      发布在 OpenMV Cam
      X
      xd4v
    • 请问怎么在帧缓冲区显示想要看的图像

      我设了一个变量s=sensor.snapshot(),然后让a=s,但是发现a灰度化后,帧缓冲区显示的是灰度化的图像,等于说显示的是a的图像。但是a不是在堆区存放吗?

       # Hello World Example
      #
      # Welcome to the OpenMV IDE! Click on the green run arrow button below to run the script!
      
      import sensor, image, time, pyb
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)#160X120
      sensor.skip_frames(time=100)
      clock=time.clock()
      
      while(True):
          time_start = pyb.millis()
          
          scr_shot=sensor.snapshot()
          #scr_shot.lens_corr(1.8)    
          a=scr_shot
          a.to_grayscale()
          
          duration = pyb.elapsed_millis(time_start)
          print(duration)
      
      

      不知道怎么才能让想要显示的图像显示在帧缓冲区,求教!!!
      另外,这是另一个错误,麻烦帮忙解释一下
      0_1543492843333_QQ截图20181129195950.png

      发布在 OpenMV Cam
      X
      xd4v
    • RE: 光流例程无法实现,最新版的固件不支持吗?

      @kidswong999 找到原因了:因为我写的是B64x64,应该是B64X64

      发布在 OpenMV Cam
      X
      xd4v
    • RE: 光流例程无法实现,最新版的固件不支持吗?

      IDE的固件版本是3.0.0

      发布在 OpenMV Cam
      X
      xd4v
    • 光流例程无法实现,最新版的固件不支持吗?
      # MAVLink OpticalFlow Script.
      #
      # This script sends out OpticalFlow detections using the MAVLink protocol to
      # an LIGHT/PixHawk UAV controller for position control using your OpenMV Cam.
      #
      # P4 = TXD 115200,8,N,1
      
      
      import sensor, image, time, pyb, struct, math
      
      sensor.reset() # Initialize the camera sensor.
      sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
      sensor.set_framesize(sensor.B64x64) # or B40x30 or B64x64
      clock = time.clock() # Tracks FPS.
      
      old = sensor.snapshot()
      
      uart = pyb.UART(3, 115200, timeout_char = 1000)
      
      def send_optical_flow_packet(x, y, c):
          temp = struct.pack("<bbiii",
                             0xAA,
                             0xAE,
                             int(x * 100000 ), # up sample by 4
                             int(y * 100000 ), # up sample by 4
                             int(c * 100000))
          uart.write(temp)
      
      
      while(True):
          clock.tick() # 获取时间
          img = sensor.snapshot() # 获取一帧图像
          '''
          find_displacement 这个功能函数使用是是2D FFT算法获得新旧两张图像的相位移动,由于OPenMV上单片机内存的问题,只能计算
          64x64或者64*32的图片(openmv2),如果使用OPenMV3可以计算128*32或者32*128的图片
          '''
          [delta_x, delta_y, response] = old.find_displacement(img) #获取前面一张图像与刚捕获的图像之间的偏移
          old = img.copy()
          #print("%0.6fX   %0.6fY   %0.2fC   %0.2fFPS" % (delta_x, delta_y, response, clock.fps()))
          if (not (math.isnan(delta_x) or math.isnan(delta_y) or math.isnan(response))):
              send_optical_flow_packet(delta_x, delta_y, response)
      
      

      0_1542096805486_QQ截图20181113161253.png

      发布在 OpenMV Cam
      X
      xd4v