Detecting faces in a UIImage

In iOS the task of detecting faces in a UIImage is a relatively simple task thanks to the CoreImage framework.

However there are a couple of gotchas to be avoided:

  • The coordinate space for images in the CoreGraphics and CoreImage frameworks are different.
  • The orientation of the source image is important — the CoreImage API will not be able to recognize faces at extreme angles.

With these caveats in mind the following is a utility class for identifying faces in an image.

Leave a Reply

Your email address will not be published. Required fields are marked *