Sammie Aiyer 2024-10-02 11:31:11 +08:00 committed by GitHub
commit f08857a013
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -972,9 +972,11 @@ def webcam_preview(root: ctk.CTk):
def create_webcam_preview(): def create_webcam_preview():
global preview_label, PREVIEW global preview_label, PREVIEW
stream_url = 'http://192.168.0.103:4747'
camera = cv2.VideoCapture( camera = cv2.VideoCapture(
0 # stream_url
#7
1, cv2.CAP_DSHOW
) # Use index for the webcam (adjust the index accordingly if necessary) ) # Use index for the webcam (adjust the index accordingly if necessary)
camera.set( camera.set(
cv2.CAP_PROP_FRAME_WIDTH, PREVIEW_DEFAULT_WIDTH cv2.CAP_PROP_FRAME_WIDTH, PREVIEW_DEFAULT_WIDTH