March 2020
Intermediate to advanced
366 pages
9h 8m
English
As we have seen in the previous chapters with a wxpython GUI, in order to run this app (chapter8.py), we need to set up a screen capture by using cv2.VideoCapture, and pass the handle to the FaceLayout class. We can do this by following the next steps:
def run_layout(layout_cls, **kwargs): # open webcam capture = cv2.VideoCapture(0) # opening the channel ourselves, if it failed to open. if not(capture.isOpened()): capture.open() capture.set(cv2.CAP_PROP_FRAME_WIDTH, 640) capture.set(cv2.CAP_PROP_FRAME_HEIGHT, 480) # start graphical user interface app = wx.App() layout = layout_cls(capture, **kwargs) layout.Center() layout.Show() ...
Read now
Unlock full access