手机端配置
1、下载一个IP摄像头,配置好密码。
2、打开app后,点击下方的“打开IP摄像头服务器”(连上wifi,确保电脑与手机处在同一局域网内)。
电脑端
OPENCV代码(python)
其中open函数后面admin是账户名称12345是密码,在手机端可以设置;@后面是局域网IP地址,手机上显示。
import cv2 as cv
cap = cv.VideoCapture()
cap.open("http://admin:12345@192.168.191.4:8081")
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
#gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
if ret == True:
# Display the resulting frame
cv.imshow('frame',frame)
if cv.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv.destroyAllWindows()