Navigation

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

    13957512316

    @13957512316

    0
    Reputation
    10
    Posts
    525
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online

    13957512316 Follow

    Posts made by 13957512316

    • 求问如何在一分钟时输出一句话
      # 边缘检测例子:
      #
      # 这个程序示范了在图像上使用morph函数来进行边缘检测。
      # 然后在进行阈值和滤波
      
      import sensor, image, time
      import sensor, image, time, pyb
      
      #设置核函数滤波,核内每个数值值域为[-128,127],核需为列表或元组
      kernel_size = 1 # kernel width = (size*2)+1, kernel height = (size*2)+1
      kernel = [-1, -1, -1,\
                -1, +8, -1,\
                -1, -1, -1]
      # 这个一个高通滤波器。见这里有更多的kernel
      # http://www.fmwconcepts.com/imagemagick/digital_image_filtering.pdf
      thresholds = [(100, 255)] # grayscale thresholds设置阈值
      
      sensor.reset() # 初始化 sensor.
      sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565
      sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others)
      sensor.skip_frames(10) # 让新的设置生效
      clock = time.clock() # 追踪FPS
      
      # 在OV7725 sensor上, 边缘检测可以通过设置sharpness/edge寄存器来增强。
      # 注意:这个会edge detection can be enhanced
      # significantly by setting the sharpness/edge registers.
      # Note: This will be implemented as a function later.
      if (sensor.get_id() == sensor.OV7725):
          sensor.__write_reg(0xAC, 0xDF)
          sensor.__write_reg(0x8F, 0xFF)
      
      while(True):
          clock.tick() # Track elapsed milliseconds between snapshots().
          img = sensor.snapshot() # Take a picture and return the image.
      
          img.morph(kernel_size, kernel)
          #morph(size, kernel, mul=Auto, add=0),morph变换,mul根据图像对比度
          #进行调整,mul使图像每个像素乘mul;add根据明暗度调整,使得每个像素值加上add值。
          #如果不设置则不对morph变换后的图像进行处理。
          img.binary(thresholds)
          #利用binary函数对图像进行分割
      
          # Erode pixels with less than 2 neighbors using a 3x3 image kernel
          img.erode(1, threshold = 2)
          #侵蚀函数erode(size, threshold=Auto),去除边缘相邻处多余的点。threshold
          #用来设置去除相邻点的个数,threshold数值越大,被侵蚀掉的边缘点越多,边缘旁边
          #白色杂点少;数值越小,被侵蚀掉的边缘点越少,边缘旁边的白色杂点越多。
      
          print(clock.fps()) # Note: Your OpenMV Cam runs about half as fast while
          # connected to your computer. The FPS should increase once disconnected.
          time.sleep(2000)
          print('好')
      
      

      现在是两秒输出帧数和好,但是我想在60秒时单独输出好,其余时间可以只输出帧数,请问应该如何改变,谢谢!

      posted in OpenMV Cam
      1
      13957512316
    • 请问识别线段后如何输出他的长度

      现在只能输出他的帧数

      posted in OpenMV Cam
      1
      13957512316
    • 应该如何检测边缘的光滑度?

      如题,大家有什么好的想法吗

      posted in OpenMV Cam
      1
      13957512316
    • 求助,将边缘检测和绘制特征点的文件整合了,出现如下报错

      0_1555392577667_5e8acabf-58fe-4704-988f-ef13a554e4c5-image.png

      # 边缘检测例子:
      #
      # 这个程序示范了在图像上使用morph函数来进行边缘检测。
      # 然后在进行阈值和滤波
      
      import sensor, image, time
      import sensor, image, time, pyb
      
      # 绘制特征点
      #
      # 此示例显示了OpenMV Cam上的绘制关键点。
      # 通常你在一个关键点对象上调用draw_keypoints(),但你也可以在一个三值元组的列表上调用它...
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE...
      sensor.set_framesize(sensor.QVGA) # or QQVGA...
      sensor.skip_frames(time = 2000)
      clock = time.clock()
      
      while(True):
          clock.tick()
      
          img = sensor.snapshot()
      
          for i in range(20):
              x = (pyb.rng() % (2*img.width())) - (img.width()//2)
              y = (pyb.rng() % (2*img.height())) - (img.height()//2)
              rot = pyb.rng() % 360
      
              r = (pyb.rng() % 127) + 128
              g = (pyb.rng() % 127) + 128
              b = (pyb.rng() % 127) + 128
      
              # 此方法绘制关键点对象或(x,y,rot)元组列表...
              img.draw_keypoints([(x, y, rot)], color = (r, g, b), size = 20, thickness = 2, fill = False)
      
          print(clock.fps())
      
      #设置核函数滤波,核内每个数值值域为[-128,127],核需为列表或元组
      kernel_size = 1 # kernel width = (size*2)+1, kernel height = (size*2)+1
      kernel = [-1, -1, -1,\
                -1, +8, -1,\
                -1, -1, -1]
      # 这个一个高通滤波器。见这里有更多的kernel
      # http://www.fmwconcepts.com/imagemagick/digital_image_filtering.pdf
      thresholds = [(100, 255)] # grayscale thresholds设置阈值
      
      sensor.reset() # 初始化 sensor.
      sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565
      sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others)
      sensor.skip_frames(10) # 让新的设置生效
      clock = time.clock() # 追踪FPS
      
      # 在OV7725 sensor上, 边缘检测可以通过设置sharpness/edge寄存器来增强。
      # 注意:这个会edge detection can be enhanced
      # significantly by setting the sharpness/edge registers.
      # Note: This will be implemented as a function later.
      if (sensor.get_id() == sensor.OV7725):
          sensor.__write_reg(0xAC, 0xDF)
          sensor.__write_reg(0x8F, 0xFF)
      
      while(True):
          clock.tick() # Track elapsed milliseconds between snapshots().
          img = sensor.snapshot() # Take a picture and return the image.
      
          img.morph(kernel_size, kernel)
          #morph(size, kernel, mul=Auto, add=0),morph变换,mul根据图像对比度
          #进行调整,mul使图像每个像素乘mul;add根据明暗度调整,使得每个像素值加上add值。
          #如果不设置则不对morph变换后的图像进行处理。
          img.binary(thresholds)
          #利用binary函数对图像进行分割
      
          # Erode pixels with less than 2 neighbors using a 3x3 image kernel
          img.erode(1, threshold = 2)
          #侵蚀函数erode(size, threshold=Auto),去除边缘相邻处多余的点。threshold
          #用来设置去除相邻点的个数,threshold数值越大,被侵蚀掉的边缘点越多,边缘旁边
          #白色杂点少;数值越小,被侵蚀掉的边缘点越少,边缘旁边的白色杂点越多。
      
          print(clock.fps()) # Note: Your OpenMV Cam runs about half as fast while
          # connected to your computer. The FPS should increase once disconnected.
      
      posted in OpenMV Cam
      1
      13957512316
    • RE: 定时检测特征点问题求助

      @kidswong999 大佬,您发的网址,代码time是不是要改成utime,不然报错

      posted in OpenMV Cam
      1
      13957512316
    • 绘制特征点直接复制代码出现问题

      0_1555331060988_9e48c6e1-74c3-4979-b4a4-402d6fc09f88-image.png
      如图,应该如何解决,还有我想先边缘检测,后在边缘绘制特征点,是否可行?提前谢谢大佬解答

      posted in OpenMV Cam
      1
      13957512316
    • RE: 定时检测特征点问题求助

      sleep15000的话,他刚开始提取样本提取15秒,但是后面仍旧是实时检测,还是无法做到15秒检测一次,HELP

      posted in OpenMV Cam
      1
      13957512316
    • 定时检测特征点问题求助

      每隔15秒检测一次图像的特征点,特征点检测的程序已经有了,如何把定时器的程序放进去,试了几次都只能计时,ORZ

      posted in OpenMV Cam
      1
      13957512316
    • RE: 新人求问,如何检测一个不完全在图像内的圆

      那请问,有方法可以通关圆弧来检测是否是同一个院?比如半径之类的

      posted in OpenMV Cam
      1
      13957512316
    • 新人求问,如何检测一个不完全在图像内的圆

      RT,
      find_circles()方法将只能找到完全在图像内部的圆。圈子之外的图像/ roi被忽略...谢谢大家!

      posted in OpenMV Cam
      1
      13957512316