opencv对应海康sdk函数

 

1. 连接摄像头

#cap = cv2.VideoCapture("rtsp://admin:[email protected]")

    int iUserID = NET_DVR_Login_V30(sIP, iPort, sUserName, sPassword, &struDeviceInfo);

 

2. 读帧

ret, frame = cap.read()

//拿到视频流

int iRealPlayHandle = NET_DVR_RealPlay_V40(iUserID, &struPreviewInfo, PsDataCallBack, NULL);

 

截图

NET_DVR_CapturePicture

NET_DVR_CaptureJPEGPicture

 

3.显示帧

cv2.imshow("frame1", frame)

 

 

 

 

你可能感兴趣的:(摄像头)