Update codes following the comments of @sourcery-ai.
Signed-off-by: Vic P <vic4key@gmail.com>pull/429/head
parent
4f62119c2e
commit
3755198ecd
|
@ -291,11 +291,9 @@ def webcam_preview():
|
|||
global preview_label, PREVIEW
|
||||
|
||||
camera = cv2.VideoCapture(0) # Use index for the webcam (adjust the index accordingly if necessary)
|
||||
camera.set(cv2.CAP_PROP_FRAME_WIDTH, 960) # Set the width of the resolution
|
||||
camera.set(cv2.CAP_PROP_FRAME_HEIGHT, 540) # Set the height of the resolution
|
||||
camera.set(cv2.CAP_PROP_FRAME_WIDTH, PREVIEW_DEFAULT_WIDTH) # Set the width of the resolution
|
||||
camera.set(cv2.CAP_PROP_FRAME_HEIGHT, PREVIEW_DEFAULT_HEIGHT) # Set the height of the resolution
|
||||
camera.set(cv2.CAP_PROP_FPS, 60) # Set the frame rate of the webcam
|
||||
PREVIEW_MAX_WIDTH = 960
|
||||
PREVIEW_MAX_HEIGHT = 540
|
||||
|
||||
preview_label.configure(width=PREVIEW_DEFAULT_WIDTH, height=PREVIEW_DEFAULT_HEIGHT) # Reset the preview image before startup
|
||||
|
||||
|
|
Loading…
Reference in New Issue