Hand Recognition and Finger Identification with Raspberry Pi and OpenCV

Hey all, just completed sorted my most recent guide Hand Recognition and Finger Identification with Raspberry Pi and OpenCV.

Have you ever wanted your Raspberry Pi 4 Model B single-board computer to be able to identify every joint in the fingers of your hands, live? Or perhaps use hand gestures to send commands. Or utilise hand key-point detection or hand pose detection? Then this video is exactly where you need to be. Machine and deep learning have never been more accessible as this video will demonstrate. By the end of this video, you will have the knowledge to control hardware (Colour of a GlowBit) and software (VLC Media Control) through simple hand gestures.

The system built here will use Open-CV particularly CVzone. This is a huge package that helps solve real-time computer vision and image processing problems. This system will also be using MediaPipe for real-time Hand Identification, which will run a TensorFlow Lite delegate during script operation for hardware acceleration (this guide has it all!).

Read more

3 Likes

Hey Tim,

Awesome project, what an interesting application for CV.

Looking forward to see what kind of gesture controls are possible using this in the future. If anyone from the community has some ideas, feel free to shoot them through here! :grin:

2 Likes

Hello, thank you for this tutorial. I am having a problem, hopefully you can help. I followed the whole tutorial including opencv one and everything installs without any issue. However, when I run the code, specifically the:

import mediapipe

I get the error:
File “/usr/local/lib/python3.9/dist-packages/mediapipe/init.py”
from mediapipe.python import *
No module named ‘mediapipe.python.framework_bindings

3 Likes

Hey mate,

Double-check for me that you have typed and entered the below lines into the terminal. I reckon once you do that it’ll be good to go.

sudo pip3 install mediapipe-rpi3
sudo pip3 install mediapipe-rpi4
sudo pip3 install gtts
sudo apt install mpg321

1 Like

Thanks for instructions, I tried , but getting error while running, unable to find module and findnameoflandmark and findpostion , please suggest

1 Like

Also I am getting this error - while running the Simple hand tracker program - Module compiled against API version 0xe but this version of numbly is 0xd traceback

import error numpu.core.mulitarray failed to import,

I have followed all instructions as above and installed Buster.

Please help

1 Like

I reinstalled everything, getting this error now as one of user reported above

I get the error:
File “/usr/local/lib/python3.9/dist-packages/mediapipe/ init .py”
from mediapipe.python import *
No module named ‘mediapipe.python. framework_bindings

1 Like

I am also getting the same error - Can you share how did you fix this?

1 Like

I run the simple hand tracker script yesterday and everything worked well. Today - nothing changed - i run the script and the window pops up, but my hands dont get tracked. I already updated the system and also downloaded the script again, but it wont work… anybody has an idea how to fix it? the shell does not show any errors

1 Like

I have a conflict with Mediapipe and OpenCv. Mediapipe is using gtk 3.0, while OpenCV uses gtk 2.0. When the script runs, this message appears: Gtk-ERROR **: 16:16:49.300: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

Any suggestion to solve this problem?

Thanks

1 Like

Hi Angel,

Looks like you’ll have to compile your OpenCV using Qt:

There are some caveats in the above, so make sure you have access to the right packages.

I’ve let @Tim know, and he’s working on an official workaround in an updated version of his guide!

-James

EDIT: I misread the problem, updated my post to Qt instead of GTK2

1 Like

Mike did you ever get this resolved? I am running in to a similar error,

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):

2 Likes

Adam,

I ran through the same issue - in simple terms , it means numpy needs to be upgraded
Run both these commands (though the second one is the one that resolved the issue)

sudo pip install numpy --upgrade --ignore-installed
sudo pip3 install numpy --upgrade --ignore-installed

You will get upgraded to the latest numpy and then run the script again !

3 Likes

I am getting a silly error, “RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd

Traceback (most recent call last)”

ad infinitum, I assume the rest of the erros are due to that one.

1 Like

Bond you Rock, thanks that fixed it now it is time to play!!!

1 Like

Yaya :clap::clap: :blush: :blush:

Have updated the guide with this new information on fixing the Numpy Compatability. Thanks Bond!

Good explanation by you and I have completed all the tasks, but download scripts are not available, please help.

Hi All,

The attachments for this tutorial are available as a download by clicking on this link.
@Gauttam197486 I hope this helps to get your project back on track :smiley:

Liam

1 Like

Thanks @Liam for sharing the code file but the accuracy is not as shown in the video.

Hello,
Your article says they can be downloaded below. But there aren’t any.

2 Likes