diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2023-07-30 16:35:05 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2023-07-30 16:35:31 +0530 |
commit | c9062fa7e82e39a6019686814248038b5c0bdaf3 (patch) | |
tree | 7cf1a57b88c0b6a5b011a5b5ff16bdb38cde9ef4 | |
parent | f85af76d3c13a872726eaa442aedb3e610890be3 (diff) |
use rtsp
-rw-r--r-- | game.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) |