Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Face Recognition and Thumbnail Creation

Status
Not open for further replies.

spacebass5000

Programmer
Nov 26, 2000
144
0
0
US
I have seen sites allow users to upload photos to display on their community profiles where the upload process creates a thumbnail for the user to display as an avatar or whatever. What I am curious about is, a few sites I have come across have been able to generate a thumbnail of a picture that gets cropped based on the user's face.

I want to delcare a fixed aspect ratio for my thumbs. I want all of the thumbs to be the same size. This is tough when you have a picture that is drastically different in dimensions when compared to the declared aspect ratio. This is why I would like to crop a thumb about the face featured in the photo.

Do you know how this is done?
 
oh, so what, I'm not supposed to take photos of black ppl?!?!?!

JUST KIDDING!!!

good idea, but yeah, really tricky...
 
Umm,
You look for contrasting areas to identify the foreground from the background or look for a range of tones that could be skin tones, whatever pigment they have.

That's how it has to be done. At some point you must analyse the pixels in the image to guess at the area you want.

It would be much easier just to resample the whole image down to a thumbnail size.

Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
Or... Here's something I might try doing (I've thought about doing this kinda thing before, just haven't implemented it)...

Upload the full image to the server, redirect the user to a page with a flash .swf, which loads the image (the uploaded image has to be a .jpg though - c# has conversion routines... i'm sure PHP does too if that's what you're using). In the full-size .jpg (that's really a .swf), maybe change the user's cursor to outlines for the cropped area (or do something along those lines, as you want the cropped area to be a fixed value). Once the user makes their selection, use flash to redirect the user to a "render and save" type page, which takes the x/y coords of the cropping. Before rendering, of course, you'll have to handle the cropping using either c# or php graphics libs...

Just a thought. Look Flash IS good for something ;)

-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
 
a few sites I have come across have been able to generate a thumbnail of a picture that gets cropped based on the user's face
Could it be a manual process? Maybe the system automatically resizes images that are a suitable size and aspect ratio, and places those which aren't in a queue for manual attention.

Automatic face recognition sounds like a long shot - there are just too many ways it could go wrong.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top