Table of Contents

analyse image for hand from camera

Description

This block is used to analyze the image received as input from the camera, for human hand detection.

Alert: This block processes the image input and updates the values in the other functions hence it needs to be put inside loops while making projects.

Example

The example demonstrates how to use hand recognition to track the different parts of the fingers.

Script

Output

Read More
The example demonstrates how to use hand recognition and pen extensions to make an air draw game.

Script

Output

Read More
Incorporate a fun activity into your artificial intelligence learning journey by using Humanoid robots to learn about face detection.

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

  1. Simply drag and drop the RHip(), LHip(), RFoot(), LFoot(), RHand(), LHand() block from the Humanoid extension.
  2. Start the program by initializing the sprite and face detection library parameters.
  3. Use the forever loop block to create a continuous loop.
  4. 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.
  5. If no face is detected, the Humanoid will move backward at a specific time and speed using do() motion() times at () speed() block.

Output

Read More
Explore the power of machine learning in recognizing hand gestures and controlling the movements of a Quadruped robot.

Introduction

This project demonstrates how to use Machine Learning Environment to make a machinelearning model that identifies the hand gestures and makes the Quadruped move accordingly. learning model that identifies the hand gestures and makes the qudruped move accordingly.

We are going to use the Hand Classifier of the Machine Learning Environment. The model works by analyzing your hand position with the help of 21 data points.

Hand Gesture Classifier Workflow

Follow the steps below:

  1. Open PictoBlox and create a new file.
  2. You can click on “Machine Learning Environment” to open it.
  3. Click on “Create New Project“.
  4. A window will open. Type in a project name of your choice and select the “Hand Gesture Classifier” extension. Click the “Create Project” button to open the Hand Pose Classifier window.
  5. You shall see the Classifier workflow with two classes already made for you. Your environment is all set. Now it’s time to upload the data.

Class in Hand Gesture Classifier

There are 2 things that you have to provide in a class:

  1. Class Name: It’s the name to which the class will be referred as.
  2. Hand Pose Data: This data can either be taken from the webcam or by uploading from local storage.

Note: You can add more classes to the projects using the Add Class button.
Adding Data to Class

You can perform the following operations to manipulate the data into a class.

  1. Naming the Class: You can rename the class by clicking on the edit button.
  2. Adding Data to the Class: You can add the data using the Webcam or by Uploading the files from the local folder.
    1. Webcam:
Note: You must add at least 20 samples to each of your classes for your model to train. More samples will lead to better results.

We are going to use the Hand Classifier of the Machine Learning Environment.

 

Training the Model

After data is added, it’s fit to be used in model training. In order to do this, we have to train the model. By training the model, we extract meaningful information from the hand pose, and that in turn updates the weights. Once these weights are saved, we can use our model to make predictions on data previously unseen.

The accuracy of the model should increase over time. The x-axis of the graph shows the epochs, and the y-axis represents the accuracy at the corresponding epoch. Remember, the higher the reading in the accuracy graph, the better the model. The range of the accuracy is 0 to 1.

Testing the Model

 

Hand Pose Classifier

The model will return the probability of the input belonging to the classes.You will have the following output coming from the model.

Logic

The Quadruped will move according to the following logic:

  1. When the forward gesture is detected – Quadruped will move forward.
  2. When the backward gesture is detected – Quadruped will move backward.
  3. When the left gesture is detected – Quadruped will turn left.
  4. When the right gesture is detected – Quadruped will turn right.

Code

Output

Read More
All articles loaded
No more articles to load