Function Repository Resource:

OccludeFaces

Source Notebook

Occlude all human faces in a given image

Contributed by: Michael Sollami

ResourceFunction["OccludeFaces"][image]

blurs all the human faces found in the image.

ResourceFunction["OccludeFaces"][image,type]

occludes all the faces with an occlusion of a given type.

Details and Options

ResourceFunction["OccludeFaces"] uses FindFaces and accepts all of those same options, along with "BlurRadius".
The occlusion type of ResourceFunction["OccludeFaces"] can be any color expression, "Noise" or "Blur" (default).

Examples

Basic Examples (3) 

Blur all the faces in an image:

In[1]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/e42e3c9d-542a-48be-addc-cbde1df4019c"]
Out[2]=

Occlude faces in an image with a specific color rectangle:

In[3]:=
ResourceFunction["OccludeFaces"][i, #] & /@ {Purple, RGBColor[0, 1, .6], GrayLevel[.2]}
Out[3]=

Occlude faces in an image with a random pixel noise:

In[4]:=
GraphicsRow@{ResourceFunction["OccludeFaces"][i, "Noise"], ResourceFunction["OccludeFaces"][ColorConvert[i, "GrayScale"], "Noise"]}
Out[4]=

Options (2) 

OccludeFaces feeds all valid options to FindFaces:

In[5]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/856d4d6f-aa67-48c3-ac7b-91dcca5d96d6"]
Out[6]=

Change the strength of the blur:

In[7]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/92842b15-1e59-4214-9a16-c8e6fea5f8f7"]
Out[7]=

Publisher

Michael Sollami

Version History

  • 1.0.0 – 26 March 2020

Related Resources

License Information