diff --git a/camera.py b/camera.py new file mode 100644 index 0000000..272fd9d --- /dev/null +++ b/camera.py @@ -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() \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 0b93adf..4fa4f0e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,5 @@ pyside6 keras tensorflow + +opencv-python \ No newline at end of file diff --git a/resources/VID_20261012_140702.mp4 b/resources/VID_20261012_140702.mp4 new file mode 100644 index 0000000..c073be3 Binary files /dev/null and b/resources/VID_20261012_140702.mp4 differ