Add ip cam script and video resource
This commit is contained in:
25
camera.py
Normal file
25
camera.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import cv2 as cv
|
||||||
|
import time
|
||||||
|
|
||||||
|
ip = "192.168.137.100"
|
||||||
|
vid = cv.VideoCapture(f"http://{ip}:8080/video?1920x1080")
|
||||||
|
|
||||||
|
cv.namedWindow("Stream", cv.WINDOW_NORMAL)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
ret, frame = vid.read()
|
||||||
|
|
||||||
|
if not ret:
|
||||||
|
raise Exception("Failed to read image!")
|
||||||
|
|
||||||
|
cv.imshow("Stream", frame)
|
||||||
|
|
||||||
|
# Set window size once, after the window actually exists
|
||||||
|
if cv.getWindowProperty("Stream", cv.WND_PROP_VISIBLE) >= 0:
|
||||||
|
cv.resizeWindow("Stream", 1280, 720)
|
||||||
|
|
||||||
|
if cv.waitKey(1) & 0xFF == ord("q"):
|
||||||
|
break
|
||||||
|
|
||||||
|
vid.release()
|
||||||
|
cv.destroyAllWindows()
|
||||||
@@ -3,3 +3,5 @@ pyside6
|
|||||||
|
|
||||||
keras
|
keras
|
||||||
tensorflow
|
tensorflow
|
||||||
|
|
||||||
|
opencv-python
|
||||||
BIN
resources/VID_20261012_140702.mp4
Normal file
BIN
resources/VID_20261012_140702.mp4
Normal file
Binary file not shown.
Reference in New Issue
Block a user