Simple code in python using openCV (Haar Cascades) for Face Detection in Raspberry Pi or any other PC.
- Python 3
- opencv (tested with 3.4) #Watch https://youtu.be/xlmJsTeZL3w this video for opencv installation in Raspberry Pi
- imutils (tested with 0.5.3) #sudo pip install imutils
Python3 face_detect_haar_cascade.py
To use Raspberry Pi camera module
#c = VideoStream(src=0).start() //For webcam, comment it if using Raspberry Pi Camera module
c = VideoStream(usePiCamera=True).start() //For Raspberry Pi Camera module, comment it if using webcam
To use webcam
c = VideoStream(src=0).start() //For webcam
#c = VideoStream(usePiCamera=True).start() //For Raspberry Pi Camera
To use default webcam
c = VideoStream(src=0).start()
To use external webcam
c = VideoStream(src=1).start() #If system has more than one webcam use the 'src' number accordingly
Arijit Das