Raspberry Pi Uses AI for Virtual Painting

Raspberry Pi
(Image credit: Sparklers: We Are The Makers)

The Raspberry Pi is a fantastic tool for both the technically inclined and the creative artist. If you’re looking for a Pi project that is fun to play with and teaches maker fundamentals, this project created by Sparklers: We Are The Makers, known over at YouTube, is for you. Using our favorite SBC, the team has created an AI-powered virtual painting application.

The project relies on image recognition using OpenCV to map out the user’s hand. It identifies the index finger and follows it, leaving a trail of color behind the tip of the finger, enabling the user to draw. Colors can be selected using virtual buttons at the top of the screen. A button is also available to clear the image to start with a fresh palette.

The goal of this project wasn’t just to make a fun project but also to create a tutorial that could help both new and experienced makers. Following their tutorial will give some insight into using tools like OpenCV and MediaPipe for AI. You’ll also get to play around with one of the most popular languages for makers in the Pi community—Python.

Another good thing about this project is how little hardware you need to set it up. Let’s assume you’ve got a Pi ready with an SD card and power supply; all you need is a camera. You can get away with a camera module or a USB webcam if it’s compatible. The Sparklers: We Are The Makers team uses a Raspberry Pi 4, but a Pi 3 B+ would work all right in its stead, albeit with less processing power.

The project is running on top of the latest edition of Raspberry Pi OS. The code is written in Python and has been made available on GitHub for anyone to download and explore. You’ll also need OpenCV and MediaPipe for the image recognition side of the project.

If you want to see this Raspberry Pi project in action, check out the official video shared on YouTube, which also breaks down how the project goes together. Follow Sparklers: We Are The Makers for more cool Pi projects and tutorials.

Ash Hill
Freelance News and Features Writer

Ash Hill is a Freelance News and Features Writer at Tom's Hardware US. She manages the Pi projects of the month and much of our daily Raspberry Pi reporting.