From 7e735d8db8f255e67aca1959cf141101cb10e19c Mon Sep 17 00:00:00 2001
From: Kenneth Estanislao <hacksider@gmail.com>
Date: Sat, 4 Nov 2023 20:48:58 +0800
Subject: [PATCH] Update ui.py

balance between resolution and speed
---
 modules/ui.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/ui.py b/modules/ui.py
index b052e0f..71f596c 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -257,11 +257,11 @@ def webcam_preview():
     global preview_label, PREVIEW
 
     cap = cv2.VideoCapture(0)  # Use index for the webcam (adjust the index accordingly if necessary)    
-    cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)  # Set the width of the resolution
-    cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)  # Set the height of the resolution
+    cap.set(cv2.CAP_PROP_FRAME_WIDTH, 854)  # Set the width of the resolution
+    cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)  # Set the height of the resolution
     cap.set(cv2.CAP_PROP_FPS, 60)  # Set the frame rate of the webcam
-    PREVIEW_MAX_WIDTH = 1280
-    PREVIEW_MAX_HEIGHT = 720
+    PREVIEW_MAX_WIDTH = 854
+    PREVIEW_MAX_HEIGHT = 480
 
     preview_label.configure(image=None)  # Reset the preview image before startup