Class 6 - Coding, AI & Robotics Course
-
Coding
Session 1: Introduction to Coding3 Topics -
Session 2: Backdrop, Costume, and Animation3 Topics|1 Quiz
-
Session 3: Basics of Algorithm and Flowchart3 Topics|1 Quiz
-
Session 4: Basics of Pseudocode3 Topics|1 Quiz
-
Session 5: Getting Started with Quarky3 Topics|1 Quiz
-
Session 6: Variables: The Multitaskers4 Topics|1 Quiz
-
Session 7: Arithmetic Operators4 Topics|1 Quiz
-
Session 8: Conditional Statements3 Topics|1 Quiz
-
Session 9: Logical Operators4 Topics|1 Quiz
-
Session 10: Nested Conditional Statements2 Topics|1 Quiz
-
Session 11: Loops3 Topics|1 Quiz
-
Session 12: Touch Based Piano2 Topics
-
Session 13: Criterial in Loops5 Topics|1 Quiz
-
Session 14: Catch the Fruit Game - Part 12 Topics
-
Session 15: Catch the Fruit Game - Part 22 Topics|1 Quiz
-
Artificial IntelligenceSection 16: Introduction to Artificial Intelligence3 Topics|1 Quiz
-
Session 17: Basics of Face Detection2 Topics|1 Quiz
-
Session 18: Face Expression Detection2 Topics|1 Quiz
-
Session 19: Mimic Face with Quarky1 Topic
-
Session 20: Face Filter - Part 12 Topics
-
Session 21: Face Filter - Part 22 Topics
-
RoboticsSession 22: Basics of Robotics2 Topics|1 Quiz
-
Session 23: Wirelessly Controlled Robot2 Topics
-
Session 24: Introduction to Sensors3 Topics|1 Quiz
-
Session 25: Introduction to Actuators3 Topics|1 Quiz
-
Session 26: Face Tracking with Robot2 Topics
-
Session 27: Obstacle Avoidance Robot - Part 13 Topics
-
Session 28: Obstacle Avoidance Robot - Part 22 Topics|1 Quiz
-
Session 29: Edge Detector Robot - Part 13 Topics
-
Session 30: Edge Detector Robot - Part 22 Topics|1 Quiz
-
Capstone ProjectCapstone Project
Face Detection Blocks in PictoBlox
Face Detection Blocks in PictoBlox
The Face Detection extension in PictoBlox has blocks dedicated to face detection.
Let’s first add the extension to our project:
- Create a new project in PictoBlox.
- Next, click on the Add Extension button and add the Face Detection extension.
- The face detection models will be downloaded which may take few seconds to load.
- Once downloaded you will get a message saying “Model loaded successfully”.
Facial Detection Block
To execute face detection, we will use analyse image from () block.
You can input the image in the following ways:
- Camera feed
- Stage
This block. analyses the image and saves the face information locally, which can be accessed using other blocks similar to computer vision.
You have to run this block every time you want to analyze a new image from the camera or stage.
Controlling camera feed
You can control the camera feed on the stage using turn () video on stage with () % transparency block.
You can change the following parameters of the block:
- Camera state:
- OFF – The video feed on the stage will stop.
- ON – The video feed on the stage will start.
- ON flipped – The video feed on the stage will start with the video mirrored. So, your right hand will be shown as left hand and vice versa.
- Transparency: This parameter makes the video translucent. O is defined as the camera feed will be shown on the stage and 100 is the video will fade out completely from the stage.
Edit the parameter and try out this block yourself.
Example – Analyzing Image on Stage
In this topic, we will analyze the following image:
- Download the image from here: https://learn.edustream.ae/wp-content/uploads/2023/09/Boy-and-Girl.jpg
- In PictoBlox, turn off the camera using turn () video on stage with () % transparency block, and choosing the options as shown. Click on the block to execute it.
- Next upload it as backdrop.
- Select Tobi sprite and hide it.
- You will find the stage like this:
- Drag analyse image from () block, change the feed as stage and click on the block to analyze the image.
- Now we will see what things we get when we analyze images in face detection.
Get # faces
Once you have analyzed the images, you can use the get # faces block to get the number of faces recognized in the image.
For the image being analyzed, you will get 2.
Get expression of face ()
The get expression of face () block reports the recognized expression of the selected face. If the face selected is not detected then it reports NULL.
Example: For the first face in the image being analyzed, the expression is Happy.
Is expression of face () ()
The is expression of face () () block checks whether the selected face has a particular emotion or not. If the emotion matches, then the block returns true, else false.
E.g., for face 1 in the image, the emotion is Happy.
Get () of face ()
The get () of face () block reports the following attributes of the image:
- X position: X coordinate of the center of the image on the stage
- Y position: Y coordinate of the center of the image on the stage
- Width: Width of the face
- Height: Height of the face
Using this block you can make the bounding box for the face like this:
We will learn how to do the same in the next topic by making a face detector.
Get () position of landmark () of face ()
The get () position of landmark () of face () block reports the x and y position of the selected landmark (number from 1 to 68) of the selected face.
Using this block you can draw the landmark points on the stage like this:
Conclusion
We have looked at the various blocks to analyze images of faces and get key information out of them. In the next lesson, will see how to draw the bounding box on the detected face and report their expressions.