diff --git a/main.py b/main.py index 6a31acb..1b2f84d 100755 --- a/main.py +++ b/main.py @@ -25,7 +25,7 @@ def main(args) -> None: create_dirs() if args.webcam: from TrafficLightDetector.traffic_light_webcam import TrafficLightDetectorWebcam - camera = TrafficLightDetectorWebcam() + camera = TrafficLightDetectorWebcam(0) # Change number if webcam didn't detect camera.enable() if args.image: diff --git a/setup.cfg b/setup.cfg index ea84088..6e9cfb9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = detector +name = TrafficLightDetector desctiption = Reduce traffic congestion effects due to human reaction times at intersections with traffic lights by utilizing a computer system based on direct communication method of changes in the circumscribed route intersection. author = Kristofers Solo license = MIT diff --git a/src/TrafficLightDetector/traffic_light_webcam.py b/src/TrafficLightDetector/traffic_light_webcam.py index db84c37..694154c 100644 --- a/src/TrafficLightDetector/traffic_light_webcam.py +++ b/src/TrafficLightDetector/traffic_light_webcam.py @@ -4,8 +4,8 @@ from TrafficLightDetector.traffic_light_detector import TrafficLightDetector class TrafficLightDetectorWebcam(TrafficLightDetector): - def __init__(self) -> None: - self.video_capture = cv2.VideoCapture(0) # Change number if webcam didn't detect + def __init__(self, source: int) -> None: + self.video_capture = cv2.VideoCapture(source) def enable(self) -> None: while True: