3
$\begingroup$

I have used FindFaces on a list of pictures which contain a number of people. These faces have then been highlighted using HighlightImage. What I would now like is a list of cropped images of just the faces (ie. a list of what is in the red squares). How do I go about doing this?

enter image description here

I have tried

ImageTrim[images[[#]],Partition[Flatten@FindFaces[images[[#]]], 2]] & /@ Table[k, {k, 1, Dimensions[images][[1]], 1}]

however this resulted in a list of 3 images cropped to fit all of the faces into one photo, as below.

enter image description here

$\endgroup$
0

1 Answer 1

2
$\begingroup$
images = Import /@ 
   {"http://www.mountainviewlife.org/wp-content/uploads/2012/02/group.jpg",
    "http://thechaosroom.com/wp-content/uploads/2011/08/GroupPhoto_000008314113Medium1.jpg", 
    "http://www.yjevents.com/ny/images/group.jpg"}

Mathematica graphics

Function[{im}, ImageTrim[im, #] & /@ FindFaces[im]] /@ images

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.