导航

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

    ndk4

    @ndk4

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

    ndk4 关注

    ndk4 发布的帖子

    • RE: openMV不能正常脱机工作,如何解决?急!

      @kidswong999 格式化试过了,没有用。。。。

      发布在 OpenMV Cam
      N
      ndk4
    • openMV不能正常脱机工作,如何解决?急!

      各位大咖,openMV未能正常脱机工作,不知是哪里出了错,想请教大家。大致情况是:
      1、如果我单单让openmv通过串口发消息到arduino板上,不进行图像识别的话,发消息在脱机状态下是可以实现的,它会一直发送;
      2、加上图像识别的代码后,不脱机连接电脑的情况下,是能识别以及发送消息的;
      3、但一旦脱机好像openmv就不工作了,也不知是不会去识别了还是识别了没发消息;
      4、程序我事先都已经是烧到openmv板以及SD卡里了。
      5、供电正常。
      ——————————接线图——————————————————————————
      1_1572944022118_微信图片_20191105164743.jpg 0_1572944022094_微信图片_20191105164736.jpg
      ——————————openMV IDE程序——————————————————————————

      import time, sensor, image, time, pyb
      from image import SEARCH_EX, SEARCH_DS
      from pyb import UART
      
      sensor.reset()
      
      sensor.set_contrast(1)
      sensor.set_gainceiling(16)
      
      sensor.set_framesize(sensor.QQVGA)
      
      sensor.set_pixformat(sensor.GRAYSCALE)
      
      
      template1 = image.Image("/J.pgm")
      template2 = image.Image("/Js.pgm")
      template3 = image.Image("/Jx.pgm")
      template4 = image.Image("/Jz.pgm")
      template5 = image.Image("/Jy.pgm")
      uart = UART(3, 9600)
      clock = time.clock()
      
      
      while (True):
          clock.tick()
          img = sensor.snapshot()
      
      
          r1 = img.find_template(template1, 0.70, step=4, search=SEARCH_EX)
          if r1:
              img.draw_rectangle(r1)
              uart.write("1\r")
              time.sleep(1000)
      
          r2 = img.find_template(template2, 0.70, step=4, search=SEARCH_EX)
          if r2:
              img.draw_rectangle(r2)
              uart.write("1\r")
              time.sleep(1000)
      
          r3 = img.find_template(template3, 0.70, step=4, search=SEARCH_EX)
          if r3:
              img.draw_rectangle(r3)
              uart.write("1\r")
              time.sleep(1000)
      
          r4 = img.find_template(template4, 0.70, step=4, search=SEARCH_EX)
          if r4:
              img.draw_rectangle(r4)
              uart.write("1\r")
              time.sleep(1000)
      
          r5 = img.find_template(template5, 0.70, step=4, search=SEARCH_EX)
          if r5:
              img.draw_rectangle(r5)
              uart.write("1\r")
              time.sleep(1000)
      
          print(clock.fps())
      
      

      ——————————arudino程序——————————————————————————

      #include <SoftwareSerial.h>
      
      SoftwareSerial softSerial(10, 11); // RX, TX
      
      void setup() {
        // put your setup code here, to run once:
        softSerial.begin(9600);
        Serial.begin(9600);
      }
      
      void loop() {
        int a1=1;
        while (a1=1){
         while (softSerial.available()>0)
        {
         char rec=(char)softSerial.read();
         Serial.print(rec);
         delay(5);
        }
        }
        }
       
      
      
      

      谢谢大家~

      发布在 OpenMV Cam
      N
      ndk4