Hand Recognition and Finger Identification with Raspberry Pi and OpenCV

HI @Igor276056,

If you don’t hear back from Piri we would be happy to help.

The more information you can give us about your setup and the steps you took before you hit this error the better!

Specifically your Pi Hardware and OS version as well as screenshots of the error if possible. :grinning:

Hi Samuel.
I have Raspberry Pi 4 Model B and Raspberry Pi Camera V2

===== Hardware Information =====
Model		: Raspberry Pi 4 Model B Rev 1.5
Revision	: c03115
===== Operating System Information =====
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
===== Kernel Version =====
5.10.17-v7l+
===== Python Version =====
Python 3.7.3
===== Firmware Version =====
Apr 30 2021 13:46:42 
Copyright (c) 2012 Broadcom
version d7f29d96450abfc77cd6cf011af1faf1e03e5e56 (clean) (release) (start_x)

I followed the instructions exactly: https://core-electronics.com.au/guides/hand-identification-raspberry-pi/
I installed Buster OS. When the system was first launched, it was updated. Subsequently, I installed Open-CV according to the instructions : https://core-electronics.com.au/guides/hand-identification-raspberry-pi/#Set.
After reboot I enabled Camera, and run :

sudo pip3 install mediapipe-rpi3
sudo pip3 install mediapipe-rpi4
sudo pip3 install gtts
sudo apt install mpg321
sudo pip install numpy --upgrade --ignore-installed
sudo pip3 install numpy --upgrade --ignore-installed

Then I download Simple-Hand-Tracker.py and run it - the error is in the attached picture
Thank you in advance for your help

1 Like

I am attaching the output of the command cmake -D CMAKE_BUILD_TYPE=RELEASE … :slight_smile:
cmake_log.pdf (91.1 KB)

1 Like

Hey @Igor276056,

Thanks for all that information. From the look of that error message, it looks like your installation of protobuf is behind what ‘Simple-Hand-Tracker.py’ is expecting.

From the log pdf you attached it looks like you have version 3.5.1 currently installed and the program is looking for 3.19 or higher

Try pip install --upgrade protobuf and see if that gets you around this error.

Otherwise pip install protobuf==3.20.0 specifies a version that should work as expected.

Hope this helps! :smiley:

Hi Samuel.
Thank you for your advice.
After “pip install protobuf==3.20.0” I got further:

image

I’ve tried:
image
… to see if the camera works

It seems that there is some problem with the camera. Camera is enabled.
But when I change another SD card with OS Bookworm, the camera works. So it’s not a technical problem.
Can you think of what the problem could be?

I’m also attaching the following information:
image

libcamera interfaces should be 1, I think…

Hi Igor,

After a bit of research, I’ve found some possible workarounds. You will need to disable the legacy camera option and enable Glamour through raspi-config.

Here’s a few sources I looked through;
https://www.raspberrypi.com/documentation/computers/camera_software.html#troubleshooting

1 Like

Not sure if the first submission went through. The Hand Recognition and ID is almost what I am looking for. I want to make a robot that would win every or at least 90% of the time at Rock Paper Scissors by predetermining the fingers as to none, two or four are moving and then show the correct win response by the robot. Would need to have the camera to the side to see the fingers.

Hi @Don287451

Welcome to the forum!

For what you’re looking to do I would recommend looking at the Grove - Vision AI Module V2, looking at the pretrained models available there is one specifically for Rock, Paper, Scissors that you should be able to use to get yourself started with that project.

Hi,
Does anyone knows if this would work on a raspberry pi 5, running the latest OS 64bit?

Hi @Jackson288006

Welcome to the forum!

Unfortunately no, currently open CV is only available for Buster OS. You can run Buster on a Pi5 with no issues.