FindFaces

FindFaces[image]

attempts to find human faces in image and returns a list of bounding boxes.

FindFaces[image,prop]

returns the specified property prop for each detected face.

FindFaces[image,crit,prop]

finds faces that satisfy the criterion crit.

Details

  • FindFaces returns detected faces as a list of bounding boxes, each given in the form Rectangle[{xmin,ymin},{xmax,ymax}].
  • Coordinates {x,y} are assumed to be in the standard image coordinate system.
  • The criterion crit can be either of the following:
  • {min,max}faces of size min through max in pixels
    {Scaled[amin],Scaled[amax]}faces of relative size amin to amax
    ffaces that satisfy f
  • The property prop can be either of the following:
  • "BoundingBox"bounding boxes returned as Rectangle objects
    "BoundingBoxArea"pixel area of each face
    "Image"subimages containing each face
    "Position"the position of each face given as {x,y}
    featany feature available in FacialFeatures
    {prop1,prop2,}a list of properties
  • When a pure function f is used, facial features can be accessed using #feature1, #feature2, . A face is returned if f returns True.
  • For the complete list of facial features, see the reference page for FacialFeatures.
  • For multichannel images, FindFaces operates on grayscale intensities.
  • FindFaces uses machine learning, and its training set and methods may change in different versions of the Wolfram Language, yielding different results.

Examples

open allclose all

Basic Examples  (2)

Find coordinates of faces in an image:

In[1]:=
Click for copyable input
Out[2]=

Extract subimages that include faces:

In[3]:=
Click for copyable input
Out[3]=

Detect and highlight a face in an image:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Scope  (8)

Applications  (1)

Properties & Relations  (1)

Possible Issues  (2)

See Also

FacialFeatures  ImageIdentify  Classify  CurrentImage  EdgeDetect  ImageKeypoints  TextRecognize

Introduced in 2012
(9.0)
| Updated in 2018
(11.3)