Reputation: 11
my original code for cam is
import cv2.cv as cv
import time
cv.NamedWindow("camera", 1)
capture = cv.CaptureFromCAM(0)
while True:
img = cv.QueryFrame(capture)
cv.ShowImage("camera", img)
if cv.WaitKey(10) == 27:
break
cv.DestroyAllWindows()
what I change,,not the ip for camera is 20.0.0.14
Upvotes: 1
Views: 622
Reputation: 16081
Find out your camera model from the list https://www.ispyconnect.com/sources.aspx . And change the code like this. I assumed that using HoneyWell Camera.
import cv2
capture = cv2.VideoCapture("http://IPADDRESS/axis-cgi/mjpg/video.cgi")
while True:
img,ret = capture.read()
cv2.imshow("camera", img)
if cv.WaitKey(10) == 27:
break
cv2.destroyAllWindows()
Upvotes: 1