Wolfram Research

Function Repository Resource:

ImageAlignFaces

Source Notebook

Align images so that facial features coincide

Contributed by: Jon McLoone

ResourceFunction["ImageAlignFaces"][img1,img2]

returns a list of images where the first face in each image is aligned.

ResourceFunction["ImageAlignFaces"][img1,img2,{i,j}]

returns a list of images where the ith face in img1 is aligned with the jth face in img2.

ResourceFunction["ImageAlignFaces"][img1,img2,{i,j},s]

returns a list of images of size s.

Examples

Basic Examples

Align two images by facial features:

In[1]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/528cae41-2a32-4329-8929-600236c36c81"]
Out[1]=

Superimposing the resulting images shows the facial match:

In[2]:=
ImageCompose[res[[1]], {res[[2]], 1/2}]
Out[2]=

Resource History

License Information