Face detection seems to be a very complex idea, but in reality it is really simple.
Prerequisites:
- Raspberry Pi 2 or 3 with Raspbian OS installed
- Raspberry Pi Camera module or your Smartphone
- Basic Python knowledge
1. The first thing to do is install OpenCV. How to install OpenCV is instructed here.
2. Attach the Raspberry Pi Camera Module. Go to Raspi-config from the terminal and switch camera interface on.
3. The Python code for Face detection is given attached.
4. Open a terminal and run the Python script.
5. For those using a Smartphone for camera, download IP Webcam from Playstore. After that make the following change in the Python file:
video_capture = cv2.VideoCapture('http://192.168.43.1:8080/video')
And voila!
Comments