Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I currently have to take an image provided to me and crop it down to be consider

ID: 661655 • Letter: I

Question

I currently have to take an image provided to me and crop it down to be considered a headshot. The problem is that this could be a few hundred photos a week. Does anyone know how to do this automatically, or even make it quicker? Surly my company is not the only company that does this on an enterprise level. Any assistance would be greatly appreciated.

The program must be able to:

Auto crop and re-size an image, Either by setting up a fixed camera/distance or using facial recognition.
It also must be able to do this in batch/bulk (multiple files).
It should run on windows, if it has to be a Mac I can make that work.
The image will be either a JPG or PNG. It needs to be in a specific format I can convert easily enough.

Explanation / Answer

I'm guessing that you don't just crop the image but you have other things you'll be doing with the images before and after they're cropped. So I guess it's worthwhile to take a look at scripting the cropping as well as those other tasks.

If you want to do a facial recognition based cropping, you might want to look at OpenCV. OpenCV has a feature detection algorithms and also includes a pretrained classifier for facial detection. You can write a face detection and cropping script in probably about 10 lines of python code: http://docs.opencv.org/trunk/doc/py_tutorials/py_objdetect/py_face_detection/py_face_detection.html.

OpenCV runs on Windows, Linux, Mac, even Android or iOS
Can do batch processing, it had binding for many popular scripting languages
Supports PNG and JPEG
as long as you already have a pretrained classifier for the feature you want to detect, you wouldn't even need to know how those black magic works
and if you have to, you have the option to train your own classifier

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote