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.
http://robertcastle.com/2014/02/installing-opencv-on-a-raspberry-pi/

5. Install the UV4L driver to make /dev/video0 available as a virtual device to your pi cam.
http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=14


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
https://github.com/berak/opencv_smallfry
8.
$ startx
$ cd opencv_smallfry
$ python facerec_online.py your_folder_to_store_training_pics /usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml
9. Enjoy!

4 comments:

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!

Bubble
www.gofastek.com

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.


edupdf.org

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.