Skip to content
Snippets Groups Projects
Commit 8f2da0f2 authored by Zhaoliang Zheng's avatar Zhaoliang Zheng
Browse files

change the website address

parent 1cf31b6e
No related merge requests found
...@@ -6,31 +6,31 @@ def nothing(x): ...@@ -6,31 +6,31 @@ def nothing(x):
pass pass
if __name__ == "__main__":
#change the IP address below according to the
#IP shown in the Serial monitor of Arduino code
# url='http://192.168.4.1/cam-hi.jpg'
# url='http://192.168.1.107/cam-hi.jpg'
url='http://192.168.4.1/cam-mid.jpg'
#change the IP address below according to the
#IP shown in the Serial monitor of Arduino code
url='http://192.168.4.1/cam-hi.jpg'
# url='http://192.168.1.107/cam-hi.jpg'
# url='http://192.168.1.107/cam-mid.jpg'
# cv2.namedWindow("live transmission", cv2.WINDOW_AUTOSIZE)
# cv2.namedWindow("live transmission", cv2.WINDOW_AUTOSIZE) cv2.namedWindow("live transmission", cv2.WINDOW_NORMAL)
cv2.namedWindow("live transmission", cv2.WINDOW_NORMAL) while True:
header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36."}
req = Request(url, headers=header)
img_resp = urlopen(req, timeout=60)
imgnp=np.array(bytearray(img_resp.read()),dtype=np.uint8)
frame=cv2.imdecode(imgnp,-1)
while True:
header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36."}
req = Request(url, headers=header)
img_resp = urlopen(req, timeout=60)
imgnp=np.array(bytearray(img_resp.read()),dtype=np.uint8)
frame=cv2.imdecode(imgnp,-1)
cv2.imshow("live transmission", frame)
h,w,_ = frame.shape
print("with:{},high:{}".format(w,h))
key=cv2.waitKey(5)
if key==ord('q'):
break
cv2.imshow("live transmission", frame) cv2.destroyAllWindows()
h,w,_ = frame.shape
print("with:{},high:{}".format(w,h))
key=cv2.waitKey(5)
if key==ord('q'):
break
cv2.destroyAllWindows()
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment