Python script for Face and Eye Detection on a Windows PC

faceandeyedetect

I am using Python 2.7 to write scripts that collect images and video from my webcam. I am using PyInstaller 2.1 to produce executable versions of the Python scripts. I am on a path to using Python to not only control the stepper motor and trigger image capture for my 3D scanner, but to also collect and process images directly using Python. Right now I rotate a platform and save 400 images that I process offline. I want to rotate the platform, capture but not save the images, and perform image analysis to add points to a point cloud at each rotation angle. This should be much faster than the process I use now. So far I am successfully capturing live video from my USB webcam using Python, and performing real time processing.

Since I was recently working on a facial recognition project, I am trying face and eye detection using my PC webcam as a first example.

Here is a video showing a face and eye detection script.

The executable can be downloaded here. The file is 22 MB in size, and includes all of the support files required to run the executable. Please unzip this directory and run the executable. I would like to know if others can make it work with their webcams in .EXE form rather than installing and running Pyhton.

The Python script can be downloaded here.

Press crtl-c in the DOS window to stop the program.

The readily download-able modules I am using with Python 2.7 (32 bit version on Windows 7) include:

scipy-0.10.1-win32-superpack-python2.7.exe

numpy-1.6.1.win32-py2.7.exe

cvtypes-0.8.0.win32.exe

opencv-python-2.4.7.win32.py2.7.exe

PIL-1.1.7.win32-py2.7.exe

You will also need to download:

haarcascade_frontface_alt.xml

haarcascade_eye.xml

You can also download PyInstaller-2.1.zip to try to convert Python scripts to executables.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s