enumx

移动端下载一个工具:IP摄像头(app)

Android的下载地址:http://app.mi.com/details?id=com.shenyaocn.android.WebCam

下载安装后,打开app后,点击下方的“打开IP摄像头服务器”(连上wifi,确保电脑与手机处在同一局域网内)。

然后,使用python进行opencv代码调用部分:

import cv2
 
cv2.namedWindow("camera",1)
#开启ip摄像头
video="http://admin:admin@192.168.1.5:8081/"   #此处@后的ipv4 地址需要改为app提供的地址
cap =cv2.VideoCapture(video)
 
 
while True:
    # Start Camera, while true, camera will run
 
    ret, image_np = cap.read()
 
    # Set height and width of webcam
    height = 600
    width = 1000
 
    # Set camera resolution and create a break function by pressing \'q\'
    cv2.imshow(\'object detection\', cv2.resize(image_np, (width, height)))
    if cv2.waitKey(25) & 0xFF == ord(\'q\'):
        cap.release()
        cv2.destroyAllWindows()
        break
# Clean up
cap.release()
cv2.destroyAllWindows()

分类:

技术点:

相关文章:

  • 2021-11-02
  • 2021-11-19
  • 2022-01-02
  • 2021-08-24
  • 2022-01-02
  • 2022-01-02
  • 2021-09-01
猜你喜欢
  • 2021-10-17
  • 2021-11-25
  • 2021-09-23
  • 2021-11-14
  • 2021-06-27
  • 2021-06-10
  • 2021-10-17
相关资源
相似解决方案