Tutorial: Video Sensing in Scratch

Alphabets Sounds Video

share us on:

In this lesson, students learned about the video sensing feature in Scratch, which allows them to use their computer’s webcam to interact with projects. They explored three key video sensing blocks: turning on the webcam, adjusting video transparency, and detecting motion, culminating in a fun project where a cat meows in response to detected movement. The lesson encourages creativity and experimentation with these tools to create engaging Scratch projects.

Tutorial: Video Sensing in Scratch

Hello everyone! Today, we’re going to learn about a cool feature in Scratch called video sensing. This feature lets you use your computer’s webcam to interact with your Scratch projects. It’s like magic, and I’m excited to show you how it works!

Finding the Video Sensing Blocks

First, let’s find the video sensing blocks. You’ll find them in the “Sensing” category in Scratch. There are three special blocks for video sensing:

  • Video motion on this sprite: This block helps detect movement.
  • Turn video on: This block turns on your webcam.
  • Set video transparency: This block changes how much of the webcam image you can see.

Turning on the Webcam

Let’s start with the “Turn video on” block. This block will activate your webcam. Drag it out and connect it to an event, like when the green flag is clicked. Now, when you click the green flag, your webcam will turn on, and you’ll see the video feed in the background.

Adjusting Video Transparency

You might notice a white haze over the webcam feed. This is the backdrop, and you can change how much of it you see with the “Set video transparency” block. If you set it to 0, you won’t see any backdrop. If you set it to 100, you’ll see the full backdrop. A good balance is 50 percent, so you can see both the backdrop and the webcam image.

Detecting Motion

Now, let’s talk about the “Video motion on this sprite” block. This block measures how much movement is happening in front of the webcam. It uses a scale from 0 (no motion) to 100 (a lot of motion). You can see how much motion is happening by turning on a reporter next to the block. If you move, you’ll see the numbers go up!

Creating a Fun Project

Let’s make a fun project to see video sensing in action. We’ll make a cat meow when it detects enough motion. Here’s how:

  1. Create a script that checks if the video motion is greater than 20.
  2. If it is, use the “play sound meow until done” block to make the cat meow.

Try it out! When you move in front of the webcam, you’ll hear the cat meow. This is just one way to use video sensing blocks to create fun interactions in your Scratch projects.

Conclusion

I hope you enjoyed learning about video sensing in Scratch. Now it’s your turn to create something amazing with these blocks. Have fun experimenting and see what cool projects you can make!

  1. What was your initial reaction to learning about the video sensing feature in Scratch, and how do you think it could change the way you interact with your projects?
  2. Reflect on the process of finding and using the video sensing blocks. What challenges did you encounter, and how did you overcome them?
  3. How do you envision using the “Set video transparency” block creatively in your future Scratch projects?
  4. Discuss a scenario where detecting motion using the “Video motion on this sprite” block could enhance a Scratch project. What ideas come to mind?
  5. Think about the project where a cat meows when it detects motion. How would you modify or expand this project to make it more engaging?
  6. What insights did you gain about the potential of video sensing in educational settings or interactive storytelling?
  7. How do you feel about the balance between technical skills and creativity when working with video sensing in Scratch?
  8. After experimenting with video sensing, what new project ideas are you inspired to create, and why do they excite you?
  1. Explore Video Sensing Blocks

    Open Scratch and navigate to the “Sensing” category. Find the video sensing blocks: “Video motion on this sprite,” “Turn video on,” and “Set video transparency.” Experiment with each block to see how they work. Try turning the video on and adjusting the transparency to see the effects on your screen.

  2. Create a Motion-Activated Sprite

    Use the “Video motion on this sprite” block to create a sprite that reacts to your movements. Set up a script that changes the sprite’s costume or color when you move in front of the webcam. Test it by moving around and watch your sprite come to life!

  3. Design a Video Sensing Game

    Create a simple game where you have to move to control a character. Use the video motion block to make the character jump or dodge obstacles based on your movements. Challenge yourself to complete the game using only your motion as input!

  4. Experiment with Transparency

    Play with the “Set video transparency” block to see how it affects your project. Try different transparency levels and observe how the video feed blends with your Scratch backdrop. Create a project where the transparency changes dynamically based on certain conditions, like time or score.

  5. Showcase Your Project

    Once you’ve created a project using video sensing, prepare a short presentation to share with your classmates. Explain how you used the video sensing blocks and demonstrate your project. Be ready to answer questions and give tips on how others can use video sensing in their projects.

Here’s a sanitized version of the provided YouTube transcript:

Hello everyone, it’s [Name] from the Scratch team at MIT. Today, I want to show you how to use video sensing blocks. If you’re not familiar with video sensing, it allows someone to interact with your Scratch project using the webcam on their computer. It’s a really cool set of blocks, and I’m excited to show you how to use them today.

We will find the video sensing blocks in the sensing category. Let’s go ahead and click that. The three video sensing specific blocks are right here. One is a variable called “video motion on this sprite,” another block says “turn video on,” and finally, there’s “set video transparency.” We’ll dig into all three of these.

Let’s start with the middle one, “turn video on.” This block activates the webcam, enabling video sensing in your project. I’ll drag that out and make it an event, so when the green flag is clicked, the video will turn on.

Now that the webcam is on, you can see the image in the background, which is the feed from the webcam. This is important for creating interactions in our project. You might notice a white haze over the webcam feed; that’s the backdrop displayed on top of the webcam image. We can manipulate this with the “set video transparency” block. Right now, it’s set to 50 percent transparency. If we change it to 0 and click the green flag, we won’t see any backdrop. Conversely, if we set it to 100, we see the full backdrop.

Let’s find a happy medium and set it back to 50 percent, so we see some of the backdrop along with the webcam footage. Now, let’s create some sort of interaction. The third and final block we haven’t discussed yet is a variable that detects the amount of motion. This variable measures motion on a scale from 0 (no motion) to 100 (maximum motion) under the sprite.

We can also detect motion based on the entire stage, but let’s stick with “video motion on this sprite.” To see how this scale works, we can turn on a reporter next to the block, which will show us the amount of motion happening. Right now, if nothing is happening, it fluctuates between 0 and 1. If I move, we can see the values increase to 20, 30, and even 100.

Now, let’s create a mini project to demonstrate how to use this new block. We’ll set it up so that when I move, the cat will meow. I’ll create a simple script that continuously checks if the video motion is greater than 20. If it is, we’ll have the cat meow by using the “play sound meow until done” block.

Let’s try this out. It’s working! We can hear the cat meowing when there’s enough motion. This is a simple example of how you might use the video sensing blocks to create small interactions in your Scratch project.

I hope this was helpful, and I look forward to seeing what you create with video sensing blocks!

This version removes informal language and personal identifiers while maintaining the instructional content.

ScratchA programming language that lets you create your own interactive stories, games, and animations. – In Scratch, you can drag and drop blocks to make your characters move and talk.

VideoA recording of moving visual images that you can watch on a computer or other device. – We watched a video tutorial to learn how to code a simple game.

SensingA feature in programming that allows a program to detect changes in the environment, like mouse movements or key presses. – In our game, we used sensing blocks to make the character jump when we pressed the space bar.

WebcamA camera connected to a computer that can capture video and images. – We used the webcam to take a picture for our digital project.

MotionThe action or process of moving or being moved, often used in programming to animate characters. – We added motion to our sprite so it could glide across the screen.

TransparencyA feature that makes part of an image or object see-through, allowing other elements to be visible behind it. – We adjusted the transparency of the background so the characters would stand out more.

ProjectA collection of code, images, and sounds that work together to create a program or game. – Our class project was to design a simple animation using Scratch.

BlockA piece of code in Scratch that you can connect with other blocks to build a program. – We used a loop block to make the character repeat its dance moves.

CreateTo make something new, like a program or game, using your ideas and skills. – I love to create new games and share them with my friends.

FunEnjoyable or entertaining, often used to describe activities that are both educational and amusing. – Coding in Scratch is fun because you can make your own stories and games.

All Video Lessons

Login your account

Please login your account to get started.

Don't have an account?

Register your account

Please sign up your account to get started.

Already have an account?