Compare commits

...

1 Commits

Author SHA1 Message Date
highbuyer 7e75f07879 update create_webcam_preview 2024-10-02 11:16:10 +08:00
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