Maker Dani Stem Adds Apple Music Gesture Control to a Raspberry Pi Smart Mirror via OpenCV

Tracking fingers with a Raspberry Pi Camera Module and OpenCV, this Python-powered plug-in avoids smudges from swipes.

Maker Dani Stem is working on a Raspberry Pi-powered smart mirror, which has just received a major upgrade: gesture recognition for music control.

Smart mirrors, also known as "magic mirrors," are a commonly-seen project for makers: Take a partially-silvered mirror, place a display behind it, and wire in some kind of smarts and you have a device that can show you the weather and headlines while you brush your teeth.

Stem's build, though, looks to integrate a little more functionality than most — starting with gesture control.

This smart mirror includes gesture-based music control, courtesy of the OpenCV library. (📹: Dani Stem)

"[An] Apple music widget loads up my playlist that can be controlled with gestures," Stem writes of the project, "to avoid smudgy fingerprints on my smart mirror. One finger to play/pause, two fingers to play next song, three fingers to shuffle."

Based on a Raspberry Pi single-board computer with Camera Module, located behind the partially-silvered mirror along with the display, the gesture recognition system is driven by Python's OpenCV library: The hands are detected, positioned, then the number of fingers raised counted — and the resulting data used to control the playlist.

Stem has published the source code to GitHub under an unspecified license.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Related articles
Sponsored articles
Related articles