aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2023-07-30 16:35:05 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2023-07-30 16:35:31 +0530
commitc9062fa7e82e39a6019686814248038b5c0bdaf3 (patch)
tree7cf1a57b88c0b6a5b011a5b5ff16bdb38cde9ef4
parentf85af76d3c13a872726eaa442aedb3e610890be3 (diff)
use rtsp
-rw-r--r--game.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/game.py b/game.py
index 9158e37..8f33b91 100644
--- a/game.py
+++ b/game.py
@@ -13,13 +13,13 @@ from asteroid import Asteroid
pygame.init()
# Define screen dimensions
-SCREEN_WIDTH = 600
-SCREEN_HEIGHT = 400
+SCREEN_WIDTH = 1920
+SCREEN_HEIGHT = 1080
class MyGame:
def __init__(self) -> None:
# Open the webcam (0 is usually the default)
- self.cap = cv2.VideoCapture(0)
+ self.cap = cv2.VideoCapture('rtsp://10.20.89.139:8080/h264_aac.sdp')
# Create a list to hold cockroaches
self.cockroaches = []
@@ -139,6 +139,7 @@ class MyGame:
# Rotate the frame counter-clockwise by 90 degrees
frame = cv2.rotate(frame, cv2.ROTATE_90_COUNTERCLOCKWISE)
+ frame = cv2.flip(frame, 0)
# Convert frame from RGB to HSV, and define frame used for detection
det_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)