FindFaces

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

FindFaces[image,{min,max}]
finds faces whose approximate pixel widths range from min to max.

DetailsDetails

  • FindFaces returns detected faces as a list of bounding boxes, each given in the form .
  • Coordinates are assumed to be in the standard image coordinate system where x runs from to width and y runs from to height. Position corresponds to the bottom-left corner of the image.
  • For multichannel images, FindFaces operates on grayscale intensities.
  • In FindFaces[image,size], the following forms can be used for size:
  • {min,max}faces of size min through max in pixels
    {Scaled[amin],Scaled[amax]}faces of relative size amin to amax
  • In FindFaces[image], a range for face size is automatically selected based on the dimensions of image.

ExamplesExamplesopen allclose all

Basic Examples  (2)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]=

Find faces of all sizes:

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

Specify a maximum face size in pixels:

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

Specify a minimum face size in pixels:

In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=

Use Scaled to specify the face size relative to the image dimensions:

In[6]:=
Click for copyable input
Out[6]=
In[7]:=
Click for copyable input
Out[7]=

Dynamic detection of faces:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Introduced in 2012
(9.0)
Translate this page: