Page 1 of 1
Face recognition
Posted: Tue Sep 30, 2003 9:28 am
by JayBird
I was browsing a website earlier today that had pictures of people that looked like famous people and it got me thinking.
Imagine a website where a user could upload an image of their face. The image is analysed and returns pictures of other users that look like you.
I haven't ever had the need to use this image functions in PHP, so i don't know what is possible, thats why i have posted here.
Maybe it would need to be combined with some kind of Java applet where people could identify their key points, like nose and eyes and ears.
Perhaps some number could be generated by the positioning of the points in relations to each other, and so returns images which have a very similar number!?!?
They are just a couple of my thoughts.
Just interested to peoples thoughts on whether this would actually be possible!?
Mark
Posted: Tue Sep 30, 2003 9:37 am
by Nay
I'm posting this again

. LOL, anyhow; maybe PHP can break apart the images into Pixels. Then compare the color, tone and positions to the other images from a database.
With millions of people - this is an
extremely slow process.
-Nay
Posted: Tue Sep 30, 2003 9:57 am
by JayBird
i think your idea is somewhat flored from the start.
Imagine the amount of different phtotos, all with different background colours and taken with differnet camera with different lighting. Comparing tones wouldn't be an option.
Face recognition usually analyses the position of main features on the face like your eyes (how far apart they are, where they are in relation to your nose). Position of ears etc etc...
This is the route i think this idea will need to go down.
Mark
Posted: Tue Sep 30, 2003 3:36 pm
by Cruzado_Mainfrm
what if i'm looking sideways? what if there's no enough light in the room? this is an extreme difficult task, to compare you to someone else, there would have to be millions of people's photos in a database, and will be so SLOW just cheking up ONE image... do you imagine the time it will take to look over millions of binary files? is GD that fast to do the job? can a java applet work nicely to achive a high percent of perfection while looping throught billons of bytes, just that quick?
Submit your image, we will send you the results as soon as we finish processing your image after... 4 days later, sorry, we couldn't find even a result
are you going to beat CIA,FBI or the police's fingerprint system?
Posted: Tue Sep 30, 2003 5:57 pm
by McGruff
Face recognition might not be such an impossible task.
You might look for gradients - perhaps ignoring colour altogether and concentrating on pixel brightness. From that you could build a gradient map.
The maps would (somehow) need to be scale-less to take account of different image sizes. Maybe each pixel - or 4x4 area or whatever the optimal unit is - would know where it was in relation to an origin and the other pixels, using percentages rather than any unit of measurement.
Gradient maps comparisons would need to take account of the fact that the origins won't match by default. Something akin to regex with gradients instead of string patterns. Maybe you would start by looking for a match for a short "string" and, if successful, look for progressively larger matches.
Also, even the same picture reproduced with different contrast would produce a different gradient map, so you'd need to somehow look at the changes in brightness "loosely", ie looking for matching gradients regardless of the brightness variance amplitude. Initially you could check to see if each neighbouring area is "up" "down" or "same" compared to a neighbour, then maybe factor in the amplitude in stages to attempt to find a stronger match.
The maths and not the programming would probably be the crucial aspect of the puzzle.
Posted: Tue Sep 30, 2003 9:06 pm
by Unipus
Posted: Tue Sep 30, 2003 11:53 pm
by phice
Face recognition will always be extremely hard to get it working exactly how you want it. related:
http://computer.howstuffworks.com/facia ... nition.htm
Posted: Wed Oct 01, 2003 10:33 am
by trollll
For the application Bech100 described, it wouldn't really have to worry about lots of different angles. It could do a quick test to locate facial features and spit out an error if you didn't have a basic head shot it could at least crop to. Wouldn't make much sense to compare with a database of pictures taken at completely different angles unless you planned to expand the application to use cameras in public.
At any rate, I think you have a very possible (albeit frightening) idea. Haven't done a lot of work with images using PHP, but it seems like you could pull it off without needing to resort to another language (unless it would really make more sense to do the actual recognition algorithms in Java or C++ for the sake of efficiency).
Posted: Thu Oct 09, 2003 8:56 pm
by stephenv
With facial recognition, you create a map of a face, and store the map coordinates in the db, then you compare against coordinates.
As it has been said, the face would have to be a front on shot, side shots would probably have to include an algorithm to determine how much of an angle the shot is at, anything over 20% would probably be really hard to calculate.
You would want to shrink the image so that the width or height is always the same, then map distances from features: head (width at eyes, width at mouth) eyes (outside, inside), nose (width height), mouth (width, center), and their location on the face.
Comparing this to a db would be a lookup process that determines percentage accuracy required. You would not want to deconstruct pictures in realtime.