March 2020
Intermediate to advanced
366 pages
9h 8m
English
The chapter2.py script is responsible for running the app, and it first imports the following modules:
import cv2import numpy as npfrom gestures import recognizefrom frame_reader import read_frame
The recognize function is responsible for recognizing a hand gesture, and we will compose it later in this chapter. We have also placed the read_frame method that we composed in the previous section in a separate script, for convenience.
In order to simplify the segmentation task, we will instruct the user to place their hand in the center of the screen. To provide a visual aid for this, we create the following function:
def draw_helpers(img_draw: np.ndarray) -> None: # draw some helpers for correctly placing ...
Read now
Unlock full access