2

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?

4

2 回答 2

4

OpenCV 可能是您特定用例的最佳选择:http: //opencv.willowgarage.com/wiki/

它内置了一些对标准人脸识别算法的支持,并且在 Python 中很容易启动和运行。然而,虽然它是一个相当深的库,但我很确定您必须先找到其他东西才能首先从 Flash 中获取图像并将其提供给您的实用程序。我也不确定是否要裁剪,但对于这种事情,我确信如果 OpenCV 不这样做,Python 成像库会起作用。

希望这可以帮助。

于 2010-11-09T01:51:53.410 回答
1

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.

于 2010-11-09T13:21:17.063 回答