From 9b6d4d124d8335e95bc3c3a7d61f0a034ef1ab53 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 19:45:37 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=20[security=20fix]=20Remove=20depr?= =?UTF-8?q?ecated=20and=20insecure=20cv2.CAP=5FDSHOW=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed commented-out code that suggested using cv2.CAP_DSHOW as an alternative for video capture. Using the standard cv2.VideoCapture(0) is the preferred and more secure configuration pattern. Co-authored-by: Michal-Fularz <3768498+Michal-Fularz@users.noreply.github.com> --- image_processing_course/sw_s01e10.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/image_processing_course/sw_s01e10.py b/image_processing_course/sw_s01e10.py index 73704f6..bc50358 100644 --- a/image_processing_course/sw_s01e10.py +++ b/image_processing_course/sw_s01e10.py @@ -20,9 +20,6 @@ def empty(_): cv2.createTrackbar('threshold', 'current_frame', 20, 255, empty) cap = cv2.VideoCapture(0) - # alternative solution to the one with setting the env variable is to use DSHOW, - # however, it might reduce the achievable fps - # cap = cv2.VideoCapture(0, cv2.CAP_DSHOW) img_gray = cv2.cvtColor(cap.read()[1], cv2.COLOR_BGR2GRAY) img_current = np.copy(img_gray)