NYCPHP Meetup

NYPHP.org

[nycphp-talk] Autodetecting a Portion of an Image for a Thumbnail

Chuck Reeves chuck.reeves at gmail.com
Thu Dec 2 10:32:41 EST 2010


I worked an a company that did a lot of image processing.  Here are some
things you need to be aware of going into this:

- More the one person in the picture
- The image can be rotated 90 or 180 degrees
- Mosaic of Faces that create a master face:
http://www.funny-games.biz/images/pictures/846-bush-mosaic.jpg
- Some one uploads a Van Gogh:
http://www.parisprovencevangogh.com/wp-content/uploads/2010/08/van_gogh_3.jpg
- Facial Hair
- Profiles
- JPG's get a little crazy with the compression which can cause GD to freak
out (depending on which version of GD you are running). Also if you use
apache, some versions have memory issues with Image Magick (The memory wont
be released until that thread dies which can be a long time if you have many
requests trying to analyze images)

Start off by reading up on the algorithms that you will need to know:
http://www.face-rec.org/algorithms/  Once you know that you have the face
(or a face for that manner) you can then decide how to create the thumbnail.


One simple option might be to have the user select which portion of the
picture will be used to for the thumb nail.  Lets say I have a pic of me on
the right and 4 friends on the left.  Your script might pick out one of my 4
friends to the right of me which renders that thumbnail useless to me.  I
really want that pic to be my thumbnail so now I go in and crop the pick to
include only me which forces me to leave your site.  If you had the option
for me to drag the thumbnail box to the portion of the pic, I would have
stayed.

Thank You
Chuck Reeves




On Thu, Dec 2, 2010 at 10:14 AM, Randal Rust <randalrust at gmail.com> wrote:

> I am writing an thumbnail generation script and I'm looking high and
> low to find out if there is a way to detect an area of an image to use
> as a default thumbnail. For example, if I upload a portrait of Robert
> E. Lee the script will automatically detect the area around his head
> for the thumbnail.
>
> Any thoughts?
>
> --
> Randal Rust
> R.Squared Communications
> www.r2communications.com
> www.facebook.com/r2communications
> 614-370-0036
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20101202/05f2f97c/attachment.html>


More information about the talk mailing list