What is a good computer vision library for Python that will allow me to me to find faces in a Flash/HTML5 video?

Question:

I need to develop a script utilizing computer vision that will:

  1. Scan all frames of an Flash/HTML5 video for people’s faces
  2. Identify the video frames that shows the faces looking directly at the camera
  3. Crop the face in a perfect square
  4. Copy the cropped face to a .PNG file

Any recommendations for a Python computer vision library that could help me develop this script?

Asked By: pylonicon

||

Answers:

OpenCV is probably the best option for your specific use case: http://opencv.willowgarage.com/wiki/

It has some support built in for standard face recognition algorithms, and it’s pretty easy to get up and running with in Python. However, although it’s a pretty deep library, I’m pretty sure you’ll have to find something else to first grab the images from Flash and feed it to your utility. I’m not sure about cropping either, but for that kind of thing I’m sure the Python Imaging Library will work if OpenCV doesn’t do it.

Hope this helps.

Answered By: jonesy

As jonesy said opencv is your best bet for facedetection “out of the box”.

To use flash video as imput you’d need something that will allow you to read .flv (flash video) files that you can connect to opencv. I haven’t tried this myself, but I think if you install opencv with ffmpeg support (if you’re on linux) you should be able to read most any video with opencv including .flv (or any html5 video format).

For cropping this explains what you want. For saving the cropped image as png check the documentation of imwrite.

Answered By: jilles de wit

OpenCV can be used.
It is developed by Intel.
It is abbreviated as open source computer vision library.

Answered By: S.Gabriel Nesaraj