Monday, April 28, 2014

Getting face recognition to work on Raspberry Pi with Pi Cam

1. Buy a pi and a camboard module.

2. Install Raspbian.

3. Run
$ sudo raspi-config
to turn on the camera module

4. Follow the instruction here to compile and install opencv.

5. Install the UV4L driver to make /dev/video0 available as a virtual device to your pi cam.

6. Reconfig the U4L driver so that there is no annoying preview coming up.
$ sudo pkill uv4l
$ sudo uv4l --driver raspicam --auto-video_nr --width 640 --height 480 --encoding jpeg --nopreview

7. Download
$ startx
$ cd opencv_smallfry
$ python your_folder_to_store_training_pics /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml
9. Enjoy!


Cindy Dy said...

When someone writes an article he/she keeps the thought of a user in his/her brain that how a user can be aware of it. Therefore that’s why this post is outstanding.Thanks!


Dave Everett said...

Part 8 says enter startx. This will destroy the passwords in Raspbian Jessie and make your SDcard unusable. I have now done this twice while following the tutorial. Back to square one.

sarah lee said...

I really enjoyed reading your article. I found this as an informative and interesting post, so i think it is very useful and knowledgeable. I would like to thank you for the effort you have made in writing this article.

Kenny Zhuo Ming LU said...

@Sarah Thanks for the compliment.

@Dave, I have not tested it in Jessie. I will give it try again and let you know.