update create_webcam_preview

highbuyer 2024-10-02 11:16:10 +08:00
parent c08bec22e3
commit 7e75f07879
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():
global preview_label, PREVIEW
stream_url = 'http://192.168.0.103:4747'
camera = cv2.VideoCapture(
0
# stream_url
#7
1, cv2.CAP_DSHOW
) # Use index for the webcam (adjust the index accordingly if necessary)
camera.set(
cv2.CAP_PROP_FRAME_WIDTH, PREVIEW_DEFAULT_WIDTH