Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook like automatic image crop with intelligent results

Tags:

php

facebook

crop

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.

like image 601
Windom Earle Avatar asked Mar 03 '11 14:03

Windom Earle


People also ask

What is the advanced smart crop feature?

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

What is Facebook smart cropping and how does it work?

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.

What is the difference between auto crop and face crop?

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.

How do I use smart cropping with imagekit?

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.


2 Answers

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/

like image 182
m4rc Avatar answered Sep 25 '22 09:09

m4rc


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/

like image 23
Manuel Pedrera Avatar answered Sep 24 '22 09:09

Manuel Pedrera