I have noticed that every image I upload to Facebook is cropped automatically for the thumbnails. By automatically I mean that the user is not involved in setting the crop params in any way. The thing that is bugging me is that even with auto crop the thumbnails Facebook gets in the end are intelligent (they somehow crop the exact area where the face or the figure of the person is). How is that possible and how to do it in PHP?
P.S. I can't install install things to the server. And even without a face detection is there someway to make a good guess. I have noticed that for larger images facebook requires manual crops and does auto crop only for smaller images. The main goal is to make smart square crops and then resize them for thumbnails.
Advanced Smart Crop — Intelligent, Automatic Image Cropping Smart Crop is a feature that analyses the content of an image and intelligently focuses on the most important part of the image for cropping allowing you to create perfect thumbnails
As you can see here, with Smart Cropping, you can automatically generate a 1:1 or 4:5 version of any video clip, with Facebook's system identifying the key focus elements, and optimizing based on these points.
One is the auto crop mode, and the other is the face crop mode. In auto crop mode, we try to preserve as much of the image as possible, while centering on the most important part of the image. This is useful when you are trying to create an image gallery.
ImageKit offers two crop modes to use with smart cropping. One is the auto crop mode, and the other is the face crop mode. In auto crop mode, we try to preserve as much of the image as possible, while centering on the most important part of the image.
There's also a jquery plugin which can do face detection so you could use the coordinates that it comes up with in a php script to crop the image. http://papermashup.com/jquery-face-detection/
Probably they are parsing the image with an algorithm for face-object detection.
http://corpocrat.com/2009/08/18/automatic-face-detection-with-php-in-linux/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With