Found a fix for anyone stuck on a similar issue.
sudo apt-get install libqt4-dev
cmake -D WITH_QT=ON ..
make
sudo make install
sudo apt-get install libopencv-*
Not sure why or how but running the above lines worked!
Found a fix for anyone stuck on a similar issue.
sudo apt-get install libqt4-dev
cmake -D WITH_QT=ON ..
make
sudo make install
sudo apt-get install libopencv-*
Not sure why or how but running the above lines worked!
Hey mate, looks to me like you missed a line or two during the Open-CV installation process, in particular likely the below lines. Just go back, redo and take care.
sudo apt install cmake build-essential pkg-config git
sudo apt install libgtk-3-dev libqtgui4 libqtwebkit4 libqt4-test python3-pyqt5
Tim brother when I come to install the lines you wrote it gives me this error.
I think libqtgui5 is now available and I installed it.
Tim my friend when I wrote the lines you sent I get this error.
I think libqtgui5 is now available instead of 4 and I did install libqtgui5 before on the raspberry pi.
Ah, I see the issue. You gotta use the older “Buster” OS with this Open-CV system.
I can see by the background that you’re using the Newer Raspberry Pi ‘Bullseye’ OS which hasn’t got full compatibility with Open-CV just yet (at least not for what we want in this guide).
Make sure to flash your SD-Card with this Legacy version of Raspberry Pi OS, follow through the guide and you’ll be right as rain.
Tutorial to flashing the previous Raspberry Pi ‘Buster’ OS onto your Micro-SD for use with this guide
Thank you all guys, very good conversation learned alot.
Hi Tim, everything works perfectly.
I have a question Tim, did you have any research papers regarding this tutorial?
Because I want to know the algorithms were used, and what is the efficiency of the trainer?
Hi Tim or anybody out ther itry to get the program autostarted but all tutorils i followed i was unsuccesfull - has anybody managed to get there with the face recogination?
Hey mate, definitely a lot of papers are being written on this technology. The best place to start looking is the mouth of the river so check out the Docs Page for OpenCV on Face Recognition. If you scroll down to the credits it will link you to a number of research talking about the methods of face detection being used
Cron-Jobs/Crontab is what you want to be looking at. Come give Michael’s guide on it a looksie here.
There are other ways to get programs to run on start-up with a Raspberry Pi Single Board Computer but I’ve had the most success with CronTab.
Hi Tim, I’m running into the error:
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 456, in _init_camera
self._camera = mo.MMALCamera()
File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 2279, in __init__
super(MMALCamera, self).__init__()
File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 631, in __init__
mmal_check(
File "/usr/lib/python3/dist-packages/picamera/exc.py", line 184, in mmal_check
raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to create MMAL component b'vc.ril.camera': Out of memory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/facial_recognition/facial_req.py", line 27, in <module>
vs = VideoStream(usePiCamera=True).start()
File "/home/pi/.local/lib/python3.9/site-packages/imutils/video/videostream.py", line 17, in __init__
self.stream = PiVideoStream(resolution=resolution,
File "/home/pi/.local/lib/python3.9/site-packages/imutils/video/pivideostream.py", line 10, in __init__
self.camera = PiCamera()
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 431, in __init__
self._init_camera(camera_num, stereo_mode, stereo_decimate)
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 459, in _init_camera
raise PiCameraError(
picamera.exc.PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.
I think I see a solution, just jump into the | Raspberry PI Configuration Menu | and make sure to enable the Raspberry Pi Camera. After doing so run a quick reboot on your system. Check here if your need in the written up article.
Having done that type and enter the following into your terminal.
raspivid -t 0
If that opens up a live feed of what the camera is seeing then your back on track to close this live feed have the terminal open and type | CTRL-C |.
Hi Tim,
Thanks a lot for such a helpful tutorial,
With the help of your code and discussion forum, I have managed to get the facial recognition up and running,
Can you please help me add one more security layer along with facial recognition such as 4 digit pin or password?
Regards,
Rohan.
Hi Tim when I write this part ( make -j$(nproc) )
this error jump to me
(error: unrecognized command-line option ‘–param=ipcp-unit-growth=100000’; did you mean ‘–param=ipa-cp-unit-growth=’?)
what should I do
Need some help, please
Setting up a 4 digit pin lock for like a door or a safe sounds like a proper awesome project would love to see that in our projects section. Give this fellows work a look at because he’s taking most of the pieces you need, in regards to a Raspberry Pi and creating a 4 Digit Pin and putting it together with other security measures (like RDIF) - (all except the face recognition part, which you have here) - Build a Raspberry Pi Smart Door Lock Security System for your Smart Home! - YouTube
Hopefully that puts you on track to a winner.
Kindest regards,
Tim
An interesting issue that I haven’t run into before. At what point in the installation does that error come up? At a certain percentage or straight away? If you can send through some images of the Terminal that’d be sweet.
Also what Raspberry Pi OS are you using (Bullseye the newer one or Buster the older one?) Also, what is the hardware that your using? Like a Raspberry Pi 4 or an older one? Plus fear not, we’ll figure out what is wrong and get your system up and running the way it should
Hi Tim,
Thanks again for such a quick response, I’ll look into the link that you’ve provided.
Also, I had one more question I am basically designing a smart door locking system using facial recognition. I am done with calibrating Facial Recognition with a 12V Permanent Magnet DC Motor.
However, for health and safety, I have installed 3 PIR Sensors onto the Door to reverse my motor direction when an object is located on the track. I have attached the images of my code as well. Can you please guide me on where I can use an IF LOOP (or Anything else) to give priority to PIR Sensors?
Regards,
Rohan.
Hey mate no worries,
Scripts run top to bottom and loops with the least indented lines have higher ‘priority’. If you want to have the 3 PIR sensors I would increase the indentation of everything between your | pir_state = GPIO.input…etc | line and add an IF statement there that will do your desired effect. That effect is to reverse the motor direction when an object is located on the track.
Hope this helps with your project, when its done I’d love to see it
Kind regards,
Tim
That’s Great Tim,
I’ll give it a try and let you know about my progress,
Cheers,
Rohan.