Tool for Automatically Blurring People in Photos

8,899

Solution 1

I have found for The GIMP the Face Detection Plugin from 2010 (no guarantee that it still works) :

image

Otherwise, you might have to roll out your own software. In this case see the following links :

face detection software
Microsoft Research Face SDK Beta
Intel Perceptual Computing SDK

Of special mention is OpenCV. See Detect face then autocrop pictures for an example using python.

Solution 2

If you're fine with "some assembly required" solutions, try using "facedetect" (which simply uses OpenCV) and ImageMagick. There is an example at the following page:

http://www.thregr.org/~wavexx/hacks/facedetect/#blurring-faces-within-an-image

A couple of notes on the example:

  • It uses pixelation, but you can easily replace the "-scale" operators with a simple "-blur 0x100".
  • Each face is processed independently in the example, which is exactly what you need: you can use "display -crop GEOMETRY" to show the face before the blurring process. With "zenity" or some shell scripting it's relatively straightforward to ask whether to proceed with the blurring or not.

No face detection software is 100% accurate though. You will get both false positives and misses. In particular, the default OpenCV profile is definitely not the best on the market without additional training. False positives are easily worked around with the method you describe, but misses are a different story. Having to review all photos manually might not save you a lot of time. I guess it depends on your accuracy demands.

To show the detection super-imposed use the "-o" flag on a sample of your images and see if the detection rate is adequate for your needs.

Solution 3

The current best answer appears to be:

https://github.com/openalpr/openalpr

Unfortunately, this is just a software library and only for detection. You would need to integrate this into software that did the blurring.

I have a similar need, so I might give this a try, but my programming skills are a bit ... rusty.

Google had the same problem. They published their research here, but not their code: http://static.googleusercontent.com/media/research.google.com/en//archive/papers/cbprivacy_iccv09.pdf

Share:
8,899
O. R. Mapper
Author by

O. R. Mapper

Updated on September 18, 2022

Comments

  • O. R. Mapper
    O. R. Mapper almost 2 years

    I am looking for a way to easily make people on photos unrecognizeable. Whenever I put any photos (usually of cities and landscapes) in my online album, I first make all the recognizeable people unrecognizeable, as I feel it is a basic matter of politeness not to publish photos of strangers.

    So, I basically want to do more or less what Google does to StreetView images. Currently, I am doing this manually for each photo, by drawing ellipse selections around all the faces in Gimp and then using a blur filter on the selection.

    Is there a tool that lets me do this blurring more or less in a single click? Ideally, by showing me all the recognized faces in the first step, then by letting me deselect those that I don't want to be blurred?

    (Blurring out other personal details, such as car license plates, would be nice, too, but my main objective is finding such a tool for blurring out faces, as people frequently appear on photos, while the total number of legible license plates is minimal. Moreover, I'm looking for tools that blur out the faces. Pixelation may be a fallback, but it does not integrate with the rest of the image as nicely as blurring.)

    I have been searching for such tools for a while already, but everything I find seems to belong into one of three categories:

    • It is meant to run on smartphones rather than on desktop computers, such as this app.
    • It is meant for videos, as indicated by similar questions like this or this, or this article.
    • It is web-based, hence all the photos need to be uploaded to someone's server for processing, and an internet connection is required while editing the photos, such as with this service or this editor.

    I am looking exclusively for software that runs on Windows and/or Ubuntu without the need for an internet connection (i.e. no cloud tools that require me to upload all the photos for processing). A free tool would be nice, but a paid-for tool is still better than no tool at all.

  • O. R. Mapper
    O. R. Mapper about 11 years
    I'm sorry, I had already linked to that article myself in my question as an example of what I'm not looking for. I don't want to upload my photos to some webservice because the transfer takes ages, and because who knows what will happen to the photos once on that company's servers. If there's nothing standalone, I'll keep looking for some Gimp plugin.
  • Alex
    Alex about 11 years
    @O.R.Mapper: sorry, I've must skipped that. let us know if you find any app.
  • harrymc
    harrymc about 11 years
    lrint does "round to nearest integer" and is defined as "long int lrint(double x)". Should be easy to code.
  • O. R. Mapper
    O. R. Mapper about 11 years
    I'll accept this answer for now, as it's the most useful one and does seem promising. Unfortunately, SU's bounty system does not give me the due time to sufficiently try the various suggestions to determine their eventual usefulness before the bounty expires ... and have a job ;-) In other words, thanks a lot, though I might add some additional remarks later on.
  • O. R. Mapper
    O. R. Mapper about 11 years
    Hmm. When I add a definition for lrint, the compiler complains about conflicting definitions for lrint, when I do not add one, it complains about lrint being an undefined reference.
  • harrymc
    harrymc about 11 years
    Find the definition in question and base your function header on it.
  • O. R. Mapper
    O. R. Mapper about 11 years
    Well, if the original error message says that lrint is an "undefined reference", that should mean that there is no definition, right? Strangely enough, the C source file constituting that plugin does not contain the text lrint at all. According to the compiler output, the undefined reference is in function cvRound ... does that mean there's a bug in the OpenCV API headers?
  • O. R. Mapper
    O. R. Mapper about 11 years
    Ok, I could solve this last issue by adhering to the information from this forum posting, which explains that in current gcc versions, the options and flags have to be indicated after the input and output files (which was not the case in the makefile supplied with the plugin source code). The plugin was installed properly and recognizes some faces ... now if I could just get it to generally recognize all faces, rather than many random bits of concrete, buildings and shrubbery ...
  • harrymc
    harrymc about 11 years
    It might be easier to use OpenCV.
  • O. R. Mapper
    O. R. Mapper about 11 years
    That plugin is already based on OpenCV.
  • harrymc
    harrymc about 11 years
    Have you linked it with the latest OpenCV ?
  • O. R. Mapper
    O. R. Mapper about 11 years
    Hm. I have not indicated any specific version (or rather, the makefile does not seem to indicate any specific version, just opencv). I have installed the latest libopencv-dev before compiling.
  • harrymc
    harrymc about 11 years
    Hope you are using OpenCV version 2. Cascade Classifier might be useful and maybe something from the version 1 Face Detection using OpenCV.
  • O. R. Mapper
    O. R. Mapper over 8 years
    Hm, C++ is none of my core languages, and I currently have no time for experimenting, but a bit later (weeks? months?), I might think about trying this for practice. Though, from the readme file, it seems this is only for license plates, not for faces?