In our Android apps, when we crop photos to display them, we often encounter the problem of positioning faces properly.

This inspired me to create a tool that will locate faces and in an image (if there are any) and center the cropped image around them.

Here’s how I did it.

I started with Face Detection API of Google’s mobile vision. This API provides: