Introduction
As we start learning artificial intelligence, let’s make it more engaging by incorporating a fun activity. One of the most popular topics in AI is face detection, and we can make it even more exciting by learning it with the help of Humanoid robots. Are you interested in learning it together?
Code
Logic
- Simply drag and drop the RHip(), LHip(), RFoot(), LFoot(), RHand(), LHand() block from the Humanoid extension.
- Start the program by initializing the sprite and face detection library parameters.
- Use the forever loop block to create a continuous loop.
- If the camera detects more than one face, the Humanoid will move forward with a specific time, speed, and dance move with do() motion() times at () speed() block.
- If no face is detected, the Humanoid will move backward at a specific time and speed using do() motion() times at () speed() block.