O'Reilly logo

Getting Started with Raspberry Pi Zero by Richard Grimmett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Gesture detection

OpenCV and your webcam can also track objects. This will be useful as you want your project to differentiate your hand from the background. OpenCV makes this amazingly simple by providing some high-level libraries that can help us with this task. To accomplish this, you'll edit a file to look something similar to what is shown in the following screenshot:

Gesture detection

This code makes it possible to isolate your hand. Once you have created this file and saved it, you can run the program. Now take your target (in this case your hand) and move it into the frame. You should see something similar to what is shown in the following screenshot:

Note ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required