导航

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

    13331763481 发布的帖子

    • 模板匹配算法如何每隔三秒检测一次

      模板匹配算法如何每隔三秒检测一次

      发布在 OpenMV Cam
      1
      13331763481
    • RE: LCD为什么和模板匹配算法一起使用一照到东西就白屏

      @kidswong999 那岂不是除了板子上不就剩下一个P9能用了吗

      发布在 OpenMV Cam
      1
      13331763481
    • RE: LCD为什么和模板匹配算法一起使用一照到东西就白屏

      @kidswong999 在 LCD为什么和模板匹配算法一起使用一照到东西就白屏 中说:

      P0,P1,P2,P3,P6,P7,P8

      那岂不是除了串口的引脚就剩P9了

      发布在 OpenMV Cam
      1
      13331763481
    • LCD为什么和模板匹配算法一起使用一照到东西就白屏
      from pyb import Pin
      from image import SEARCH_EX, SEARCH_DS
      
      # Reset sensor
      sensor.reset()
      # Set sensor settings
      sensor.set_contrast(1)
      sensor.set_gainceiling(16)
      # Max resolution for template matching with SEARCH_EX is QQVGA
      sensor.set_framesize(sensor.QQVGA)
      # You can set windowing to reduce the search image.
      #sensor.set_windowing(((640-80)//2, (480-60)//2, 80, 60))
      
      sensor.set_pixformat(sensor.GRAYSCALE)
      # Load template.
      # Template should be a small (eg. 32x32 pixels) grayscale image.
      template = image.Image("10.pgm")
      lcd.init()
      clock = time.clock()
      uart = UART(3, 9600)
      while(True):
          #uart.write("Hello World!\r")
          #p1_out.high()
          lcd.display(sensor.snapshot())
          clock.tick()
          img = sensor.snapshot()
          
          r = img.find_template(template, 0.70, step=4, search=SEARCH_EX) #, roi=(10, 0, 60, 60))
                 #find_template(template, threshold, [roi, step, search]),threshold中
                 #的0.7是相似度阈值,roi是进行匹配的区域(左上顶点为(10,0),长80宽60的矩形),
                 #注意roi的大小要比模板图片大,比frambuffer小。
                 #把匹配到的图像标记出来
      
          if r:
              img.draw_rectangle(r)
              p3_out = Pin('P7', Pin.OUT_PP)
              p3_out.low()
              time.sleep_ms(1000)
              p3_out.high()
              uart.write("Hello World!\r")
              print(clock.fps())
      
          if uart.any():
              a=uart.readline().decode().strip()
              print(a)
              if a == '1':
                  p1_out = Pin('P1', Pin.OUT_PP)
                  p1_out.low()
                  time.sleep_ms(1000)
                  p1_out.high()
                  uart.write("Hello World!\r")
      
              if a=='2':
                  uart.write("Hello ")
                  p2_out = Pin('P2', Pin.OUT_PP)
                  p2_out.low()
                  time.sleep_ms(1000)
                  p2_out.high()
              if a=='4':
                  uart.write("Hello")
                  p4_out = Pin('P0', Pin.OUT_PP)
                  p4_out.low()
                  time.sleep_ms(1000)
                  p4_out.high()
      
      
      
      发布在 OpenMV Cam
      1
      13331763481
    • openmv3用模板匹配算法 内存卡里已经存放图片了 为什么还显示找不到文件

      0_162113687803png

      发布在 OpenMV Cam
      1
      13331763481
    • 麻烦问下模板匹配算法除了数字意外 可以识别图案吗

      麻烦问下模板匹配算法除了数字意外 可以识别图案吗

      发布在 OpenMV Cam
      1
      13331763481
    • 如何在LCD屏幕上写字啊

      如何在LCD屏幕上写字啊 用什么函数。。

      发布在 OpenMV Cam
      1
      13331763481
    • 同时识别圆形和矩形为啥通电后不好使 啊
      import sensor, image, time
      
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565) # grayscale is faster (160x120 max on OpenMV-M7)
      sensor.set_framesize(sensor.QQVGA)
      sensor.skip_frames(time = 2000)
      clock = time.clock()
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
      
          # 下面的`threshold`应设置为足够高的值,以滤除在图像中检测到的具有
          # 低边缘幅度的噪声矩形。最适用与背景形成鲜明对比的矩形。
      
          for r in img.find_rects(threshold = 10000):
              img.draw_rectangle(r.rect(), color = (255, 0, 0))
              for p in r.corners(): img.draw_circle(p[0], p[1], 5, color = (0, 255, 0))
              print(r)
          img1 = sensor.snapshot().lens_corr(1.8)
          for c in img1.find_circles(threshold = 3500, x_margin = 10, y_margin = 10, r_margin = 10,
                      r_min = 2, r_max = 100, r_step = 2):
                  area = (c.x()-c.r(), c.y()-c.r(), 2*c.r(), 2*c.r())
                  #area为识别到的圆的区域,即圆的外接矩形框
                  statistics = img1.get_statistics(roi=area)#像素颜色统计
                  print(statistics)
                  #(0,100,0,120,0,120)是红色的阈值,所以当区域内的众数(也就是最多的颜色),范围在这个阈值内,就说明是红色的圆。
                  #l_mode(),a_mode(),b_mode()是L通道,A通道,B通道的众数。
                  if 0<statistics.l_mode()<100 and 0<statistics.a_mode()<127 and 0<statistics.b_mode()<127:#if the circle is red
                      img.draw_rectangle(area, color = (255, 255, 255))#识别到的红色圆形用红色的圆框出来
                  elif 30<statistics.l_mode()<100 and -64<statistics.a_mode()<-8 and -32<statistics.b_mode()<32:#if the circle is red
                      img.draw_rectangle(area, color = (255, 255, 255))#识别到的红色圆形用红色的圆框出来
                  elif 0<statistics.l_mode()<15 and 0<statistics.a_mode()<-40 and -80<statistics.b_mode()<-20:#if the circle is red
                      img.draw_rectangle(area, color = (255, 255, 255))#识别到的红色圆形用红色的圆框出来
          print("FPS %f" % clock.fps())
      
      
      发布在 OpenMV Cam
      1
      13331763481
    • 如何同时识别不同颜色的圆形和矩形求代码

      如何同时识别不同颜色的圆形和矩形

      发布在 OpenMV Cam
      1
      13331763481
    • 如何使用pc9685点亮小灯啊 求代码

      如何使用pc9685点亮小灯啊 求代码

      发布在 OpenMV Cam
      1
      13331763481
    • 如何识别矩形 求代码

      如何识别矩形啊 求代码

      发布在 OpenMV Cam
      1
      13331763481
    • 怎么利用PCA9685使不同的小灯亮啊 比如说识别到红色第一个灯亮识别到蓝色第二个灯亮 能分享一下代码嘛

      怎么利用PCA9685使不同的小灯亮啊 比如说识别到红色第一个灯亮识别到蓝色第二个灯亮 能分享一下代码嘛

      发布在 OpenMV Cam
      1
      13331763481
    • RE: 如何利用pca9685分别连接6个LED小灯 如何接线啊

      怎么根据识别不同的颜色让不同的小灯亮啊,比如说 识别到红色第一个灯亮 识别蓝色第二个灯亮 能分享一下参考代码嘛

      发布在 OpenMV Cam
      1
      13331763481
    • 如何利用pca9685分别连接6个LED小灯 如何接线啊
      请在这里粘贴代码
      ``
      发布在 OpenMV Cam
      1
      13331763481