Fun Filters

by Ansh Chandgothia in Circuits > Software

153 Views, 1 Favorites, 0 Comments

Fun Filters

Picture.jpg

This is an interactive project in which the user can put fun filters like a hat, glasses etc on their faces.

Supplies

1 Scratch 3.0

2 Computer

3 Internet

Sprites

instruction 1.jpg
Instruction 1 picture 2.jpg

Filter sprites were taken directly from scratch sprite library.

Buttons were created by putting text on the buttons available in scratch sprite library.

Create Your Own AI Project

This is not a normal scratch project, I used scratch extensions which are not available on the normal scratch.

Use this link to create your own project -

https://playground.raise.mit.edu/create/

Using the "face Sensing" Extension

instruction 2.jpg

I used the "Face Sensing" extension which detects facial expressions, and can also identify parts of your face.

AI Coding Blocks

Step 4.jpg

There are many blocks in this extension, the one that I have used is marked in the picture given above.

Coding the Buttons

step 5.jpg

I broadcasted messages from the buttons to the filter sprites, in this button, which is used to activate the hat, I coded it so that as soon as this sprite is clicked, it will broadcast a message throughout all sprites, but only the hat sprite, has been coded to receive this specific message.

Coding the Filter Sprites

step 5.jpg

As soon as each sprite receives the message sent by its respective button, it will show itself and go to whichever part of the face it's supposed to go to.

Note: In the hat and party hat filter, there is another block, which makes it go to the front layer.

Special Note:

step 7.jpg
step 8.jpg

There was no option to make the hats go to the head, so what I did was I dragged them up so that even if they go to the nose, the will look like they are on the head.