导航

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

    sdot

    @sdot

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

    sdot 关注

    sdot 发布的帖子

    • 更新WiFi固件不成功,求详细解释如何操作

      这个更新固件是直接连接openmv烧录吗,我出现没找到文件 能详细解释一下怎沫操作吗

      # WINC固件更新脚本
      #
      # 此脚本更新ATWINC1500 WiFi模块固件。
      # 1) 将wifi固件镜像复制到FAT32/exFAT SD卡上。
      # 2)安全删除/弹出SD卡(或Linux上的umount)。
      # 3) 从IDE中重置OpenMV。
      # 4)运行这个脚本来更新固件。
      
      # 注意: 主机驱动程序不再支持较老的fimware版本。
      # 注意: 最新的wifi固件(19.6.1)只能在winc1500 - mr210pb上运行。
      # 注意: 固件位于<openmv-ide-install-dir>/share/qtcreator/ Firmware /WINC1500/winc_19_6_1.bin
      # 注意:固件版本19.5.2不支持ATWINC1500-MR210PA。
      
      import network
      
      # 初始化wlan模块处于下载模式。
      wlan = network.WINC(mode=network.WINC.MODE_FIRMWARE)
      
      # 启动固件更新过程。
      # 对于ATWINC1500-MR210PA/B
      #wlan.fw_update("/winc_19_4_4.bin")
      
      # 仅支持ATWINC1500-MR210PB。
      wlan.fw_update("/winc_19_6_1.bin")
      
      
      发布在 OpenMV Cam
      S
      sdot
    • 这个怎魔改才能把这个测距功能通过WiFi拓展版让手机能看见
      import sensor, image, time, network, usocket, sys
      
      SSID ='lll'
      KEY ='1234567890'
      HOST =''
      PORT =8080
      
      
      
      
      yellow_threshold   = (14, 82, 11, 116, 46, -21)
      
      
      
      
      
      sensor.reset()# Initialize the camera sensor.
      
      sensor.set_contrast(1)
      sensor.set_brightness(1)
      sensor.set_saturation(1)
      sensor.set_gainceiling(16)
      
      sensor.set_pixformat(sensor.RGB565) # use RGB565.
      
      sensor.set_framesize(sensor.QQVGA) # use QQVGA for speed.
      
      sensor.skip_frames(10) # Let new settings take affect.
      
      sensor.set_auto_whitebal(False) # turn this off.
      
      clock = time.clock() # Tracks FPS.
      
      wlan = network.WINC(mode=network.WINC.MODE_AP)
      
      wlan.start_ap(SSID, key=KEY, security=wlan.WEP, channel=2)
      
      
      
      #您可以阻止等待客户端连接
      
      #print(wlan.wait_for_sta(10000))
      
      
      
      def start_streaming(s):
      
          print ('Waiting for connections..')
      
          client, addr = s.accept()
      
          # 将客户端套接字超时设置为2秒
      
          client.settimeout(2.0)
      
          print ('Connected to ' + addr[0] + ':' + str(addr[1]))
      
      
      
      
      
      K=1300#the value should be measured
      
      
      
      while(True):
      
          clock.tick() # Track elapsed milliseconds between snapshots().
      
          img = sensor.snapshot() # Take a picture and return the image.
      
      
      
          blobs = img.find_blobs([yellow_threshold])
      
          if len(blobs) == 1:
      
              # Draw a rect around the blob.
      
              b = blobs[0]
      
              img.draw_rectangle(b[0:4]) # rect
      
              img.draw_cross(b[5], b[6]) # cx, cy
      
              Lm = (b[2]+b[3])/2
      
              c = K/Lm
      
              img.draw_string(10,10, str(c))
      
              print(c)
      
      发布在 OpenMV Cam
      S
      sdot
    • 使用WiFi无线传输模块传输视频流并测距怎魔改。要改那个部分,
      
      
      import sensor, image, time, network, usocket, sys
      
      SSID ='蹭大爷的网'    # Network SSID
      KEY  ='1234567890'    # Network key (must be 10 chars)
      HOST = ''           # Use first available interface
      PORT = 8080         # Arbitrary non-privileged port
      
      # Reset sensor
      sensor.reset()
      # Set sensor settings
      sensor.set_contrast(1)
      sensor.set_brightness(1)
      sensor.set_saturation(1)
      sensor.set_gainceiling(16)
      sensor.set_framesize(sensor.QQVGA)
      sensor.set_pixformat(sensor.RGB565)
      
      # 在AP模式下启动wlan模块。
      wlan = network.WINC(mode=network.WINC.MODE_AP)
      wlan.start_ap(SSID, key=KEY, security=wlan.WEP, channel=2)
      
      #您可以阻止等待客户端连接
      #print(wlan.wait_for_sta(10000))
      
      def start_streaming(s):
          print ('Waiting for connections..')
          client, addr = s.accept()
          # 将客户端套接字超时设置为2秒
          client.settimeout(2.0)
          print ('Connected to ' + addr[0] + ':' + str(addr[1]))
      
          # 从客户端读取请求
          data = client.recv(1024)
          # 应该在这里解析客户端请求
      
          # 发送多部分head
          client.send("HTTP/1.1 200 OK\r\n" \
                      "Server: OpenMV\r\n" \
                      "Content-Type: multipart/x-mixed-replace;boundary=openmv\r\n" \
                      "Cache-Control: no-cache\r\n" \
                      "Pragma: no-cache\r\n\r\n")
      
          # FPS clock
          clock = time.clock()
      
          # 开始流媒体图像
          #注:禁用IDE预览以增加流式FPS。
          while (True):
              clock.tick() # Track elapsed milliseconds between snapshots().
              frame = sensor.snapshot()
              cframe = frame.compressed(quality=35)
              header = "\r\n--openmv\r\n" \
                       "Content-Type: image/jpeg\r\n"\
                       "Content-Length:"+str(cframe.size())+"\r\n\r\n"
              client.send(header)
              client.send(cframe)
              print(clock.fps())
      
      while (True):
          # 创建服务器套接字
          s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)
          try:
              # Bind and listen
              s.bind([HOST, PORT])
              s.listen(5)
      
              # 设置服务器套接字超时
              # 注意:由于WINC FW bug,如果客户端断开连接,服务器套接字必须
              # 关闭并重新打开。在这里使用超时关闭并重新创建套接字。
              s.settimeout(3)
              start_streaming(s)
          except OSError as e:
              s.close()
              print("socket error: ", e)
              #sys.print_exception(e)
      
      发布在 OpenMV Cam
      S
      sdot
    • RE: 颜色识别测距怎么在方框的旁边显示距离。不是通过串口打印。是直接显示在方框的旁边

      不是输出固定字符,而是想把openmv测到的实时距离显示在边框上。怎么引用距离

      发布在 OpenMV Cam
      S
      sdot
    • 颜色识别测距怎么在方框的旁边显示距离。不是通过串口打印。是直接显示在方框的旁边
      # Measure the distance
      
      #
      
      
      
      import sensor, image, time
      
      
      
      # For color tracking to work really well you should ideally be in a very, very,
      
      # very, controlled enviroment where the lighting is constant...
      
      yellow_threshold   = (12, 100, 30, 127, -39, 50)
      
      # You may need to tweak the above settings for tracking green things...
      
      # Select an area in the Framebuffer to copy the color settings.
      
      
      
      sensor.reset() # Initialize the camera sensor.
      
      sensor.set_pixformat(sensor.RGB565) # use RGB565.
      
      sensor.set_framesize(sensor.QQVGA) # use QQVGA for speed.
      
      sensor.skip_frames(10) # Let new settings take affect.
      
      sensor.set_auto_whitebal(False) # turn this off.
      
      clock = time.clock() # Tracks FPS.
      
      
      
      K=1310#the value should be measured
      
      
      
      while(True):
      
          clock.tick() # Track elapsed milliseconds between snapshots().
      
          img = sensor.snapshot() # Take a picture and return the image.
      
      
      
          blobs = img.find_blobs([yellow_threshold])
      
          if len(blobs) == 1:
      
              # Draw a rect around the blob.
      
              b = blobs[0]
      
              img.draw_rectangle(b[0:4]) # rect
      
              img.draw_cross(b[5], b[6]) # cx, cy
      
              Lm = (b[2]+b[3])/2
      
              length = K/Lm
      
              print(length)
              print(b[5], b[6])
      
      发布在 OpenMV Cam
      S
      sdot