Skip to content

Commit

Permalink
fix aspect ratio and start script
Browse files Browse the repository at this point in the history
  • Loading branch information
ovs-code committed Nov 1, 2021
1 parent 1433527 commit 16d4b77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions application/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ class WebcamInput(Input):
def __init__(self, cam_id, resolution):
self.cam_id = cam_id
self.resolution = resolution


def start(self):
self.cam = cv2.VideoCapture(self.cam_id, cv2.CAP_DSHOW)
# Set camera resolution to FHD to ensure 16:9 aspect ratio
self.cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
self.cam.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)

def get_inputs(self):
s, img = self.cam.read()
Expand Down
6 changes: 3 additions & 3 deletions run.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python run.py
Rem start python run.py
Rem "C:\Program Files\Google\Chrome\Application\chrome.exe" --kiosk "http://localhost:8123"
python run.py application
Rem start python run.py application
Rem "C:\Program Files\Google\Chrome\Application\chrome.exe" --kiosk "http://localhost:8123/launch"

0 comments on commit 16d4b77

Please sign in to comment.