Play chrome Dino with your smile! Used lib OpenCv.
OpenCv library has pretrained Haar cascade models. At first we are detecting face. If face is detected, we are looking for a smile. When we are smiling Dino is happy so he jumps! Now we can play Dino without touching keyboard!
In variable "cap" we define which camera we will be using.
We use while(True) loop for continous capturing frames from camera.
This function works only on black-white frames so we have to convert RGB frame.
If face is detected, variable faces will contains table with [X_up_left_corner,Y_up_left_corner, Width_of_face, Height_of_face].
X of the down right corner = X_up_left_corner + Width_of_face
Y of the down right corner = Y_up_left_corner + Height_of_face
For smile detection, face have to be in black-white as well.
If smile is detected, code artificially create pressing key "UP".