I have created a video and exported it as individual photos. I currently have around 200 of them. I am looking for an editing tool that will automatically detect the face in each image and apply an effect to it (put something on top of it). Is this possible? If so how?


Do you mind doing some (simple) coding? The OpenCV computer vision library includes face detection routines, and there's a Python interface.

And here's a quick howto on doing it with python, including sample code showing someone doing exactly what you want — the image is the input, and then ImageMagick is used to draw a square around the face.

  • My python bias is showing in my answer, by the way. If you just want to do it with C, tada: opencv.willowgarage.com/wiki/FaceDetection – mattdm Jan 29 '11 at 3:08
  • Wow, this is incredible. thank you. Do you know of any libraries in c# though? – vondip Jan 29 '11 at 8:33
  • I don't know much about C#. Can you call C library functions in some way? There's gotta be. That's probably a question for stackoverflow.com – mattdm Jan 29 '11 at 16:23
  • 1
    This is the kind of answers that makes me think that most photographers who hang out in photo.SE came from SO. – jon2512chua Jan 29 '11 at 17:54

I don't know one to do this, but using a few different programs and a lil' scripting, you could probably accomplish this with Picasa and GIMP (or maybe even just ImageMagick).

Picasa has facial recognition built in and and stores the facial rectangle in a hidden picasa.ini file in the same folder as the picture. This file contains a line that looks like:

faces=rect64(328f08a1ae66e711),e5013ddaca3d0567 That number inside the rect64() is a 64-bit hexadecimal number and can be transformed into 4 16 bit bounding corners I believe. You can take that information and transform it into a into a rectangle that defines the facial area. Details on how to do that appear to be able to be found here.

You could then script ImageMagick or GIMP into overlaying the previously defined area in the picture with your desired image.

These are obviously not detailed instructions, but I don't think it'd be too difficult to hack together.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.