Hand Recognition and Finger Identification with Raspberry Pi and OpenCV

Hi Fyeo,

Welcome to the forum :slight_smile:
We had a major website update that dropped the attachments from the tutorial and we’re working on restoring those. In the meantime you can download the files from the link here.

2 Likes

Oh wow, thanks for the quick reply. You are doing a great job.

2 Likes

Hello sir!
It shows that no module named ‘mediapipe.python.framework_bindings’
i have tried ur instructions for this problem above but its showing same error.

2 Likes

Hey mate, send through some screen shots of your errors and I’ll best be able to help :slight_smile:

1 Like

I see some serious applications for this. Has anyone built an optical theremin with something like this? The theremin is a notoriously difficult instrument to play - something built around this could make it accessible. Other thing which comes to mind is deciphering hand sign language. So many people out there, autistic, hearing problems and so forth, could wear a portable version on their reading their hands and vocalising so that people understand them.

1 Like

Hi Tony,

This is a bit of a reach, but you might wanna check out Zack Freedman’s video where he uses IMUs and a Teensy to turn gestures into a keyboard, you could possibly look at expanding on that:

-James

3 Likes

Anything is possible (given time)

2 Likes

I was running the make -j $(nproc)command in the terminal and it was working just fine, though, at about 25%, it gave me an error, the same one you mentioned above, but when I retyped the command, it still gave me an error. I tried it 2 times but it didn’t work.
Please let me know what to do asap. Thanks!
(A picture is attached below)

2 Likes

Hey mate,

It is weird that it is doing it that often, I’d be tempted (and recommend to you) to keep running that | make -j $(nproc) | command a couple more times and see if you get any further progress. It does seem to be completing different tasks between the first 25% Stop and the second 25% Stop.

Potentially a heatsink ontop of the Raspberry Pi will help, the Pi has to do a lot of computations at this step. Also just going to ask for confirmation that you are running the previous (legacy) Raspberry Pi OS ‘Buster’.

1 Like

I have tried running the command multiple times and even tried it without -j and just make but that still crashed at 30%. I am running the previous ‘Buster’ OS. Turns out the SD card files may have been corrupted and now the whole SD Card is corrupted and its in a RAW filesystem. I even tried to format it and used different third-party programs to fix it but it looks like it’s done. I’m gonna have to try to use a different SD card and hopefully that goes well. But thanks for the assistance!

2 Likes

What are some applications of this Hand recognition and finger identification project? Thank you.

Hi Tim & Community :),

Great video and clear instructions, however unfortunately I have run into an issue and I don’t know how to solve it (as I am a newbie to pi). I have a 4B with 8GB of RAM, am running upto date code ie. done the update / upgrade thing. I installed CV2 and that went well (after I flashed the bios of the pi). I followed the instructions and the mediapipe code has installed properly. However when I try and run the simple-hand-tracker.py script I get the following error:

Python 3.9.2 (/usr/bin/python3)
>>> %Run Simple-Hand-Tracker.py
Traceback (most recent call last):
  File "/home/pi/Simple-Hand-Tracker.py", line 2, in <module>
    import mediapipe
  File "/usr/local/lib/python3.9/dist-packages/mediapipe/__init__.py", line 16, in <module>
    from mediapipe.python import *
  File "/usr/local/lib/python3.9/dist-packages/mediapipe/python/__init__.py", line 17, in <module>
    from mediapipe.python._framework_bindings import resource_util
ModuleNotFoundError: No module named 'mediapipe.python._framework_bindings'
>>> 

It looks similar to what others have - but I wasn’t able to see any clear resolution. I was wondering if you or anyone here would know how to fix??

Cheers James.

1 Like

Hey mate,

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

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

Also for good measure this one too.

sudo apt-get install python-opencv python3-opencv opencv-data

Hi Tim,

Many thanks for your email of yesterday. I tried the suggestions however it unfortunately didn’t work. However I have to confess that I missed the important aspect of the demo only working with Buster (as I was running the 64-bit Bullseye). I have since scrubbed my micro-ssd and put 32-bit Buster on it, followed the instructions to the letter on your website and I can report it is working a treat.

I guess when opencv or media pipe fix their issues then it’ll be good to try it in 64-bit mode, however for the moment I will settle for a working 32-bit version.

Thank you so much for all your effort in putting the video and instructions together in the first instance, it’s an awesome video and great set of instructions. My next trick is to get the 4G Hat working with the same config so that I can then hopefully send the finger detection results in a text message over 4G to someone…

Again Thank you for all that you do, I love your videos and the awesome service from core electronics.

Best regards,

James.

2 Likes

Hi Shirley,

Best to keep discussion on this forum, that way we can keep this info open to other makers. I also recommend keeping email addresses off the public internet - bots are constantly looking to scrape them and add you to lists.

Can you share your servo code with us? 3 Backticks (```) on either side of your servo code will format it nicely on this forum.

Keen to get to the bottom of this with you!
-James

1 Like

Hey Shirley.

I reckon what is going on is I wrote that Code for an Adafruit Servo HAT in mind, like in this guide, whereas all you desire is a single servo to be controlled, like in this guide.

If you take the Code from that second linked article and combine it with the Python scripts in this article you’ll get the result your looking for :slight_smile:. I’ll clear up any future confusion by renaming that file slightly as well.

Kind regards,
Tim

1 Like

Hi James,

Thanks for the kind advice! I will delete it & repost the previous question just for everyone’s reference.

Best regards,
Shirley

[Question repost for reference only] Hi Tim, thank you for the guides. I was trying to run the ’ Are Fingers Up Servo Control.py’ and a SG90 servo motor was connected to pin7, 5V of my Rpi. However, I have encountered the below error:

Hello Tim & Community,

Thanks for the reply! True, I was trying the code with one servo motor for some testing on the RPI without the Servo HAT. I will try combine the codes like you suggested :wink:

Also, may I know if it is possible to replace the Adafruit Servo HAT with PCA 9685 which is also 16-channel? thanks again.

Best regards,
Shirley