views:

940

answers:

7

Can anyone tell me how to detect faces in a static picture using Ruby or Javascript?

A: 

Face detection is done using intensive memory based algorithms, which actually go through the image data to detect face like patterns. They may be many facial recognition / Pattern recoginition algorithms and APIS available for free (or for a fee) which you can use/implement with Ruby or Javascript.

Rishav Rastogi
**Javascript!?**
voyager
I have nothing against javascript, but using it for *face recognition* is like trying to screw a nail.
voyager
JQuery is better. `$('image.png').getFaces();`
Welbog
@Welbog: Oh! Of course, but I think you have a bug. Shouldn't it be `$('#faces img').getFaces();` ?
voyager
palani
@palani: It's a joke. @voyager: Look, man. I've never used JQuery. I don't know its syntax very well.
Welbog
@Welbog: don't worry, I just needed a smart come back and thats all I could nit pick ;)
voyager
javascript to query the api or something, its upto the dev. i don't recommend though to implement the algorithms
Rishav Rastogi
A: 

Unless you have a large amount of time to spend on this (at least a month) then definitely look at existing algorithms instead of developing your own.

philwilks
+1  A: 

Collect a lot of cash and contact these guys for a good solution!

Wikipedia has a good article about this which also explains why you're trying to do something that is still extremely complex to do.

FRGC is also interesting... If you do find a solution, you can take part in this challenge.

Workshop Alex
yes.. .thats the way to go..:D
Rishav Rastogi
+7  A: 

If you are going to try and write something from scratch, there is a great explanation of the process on the Carnegie Mellon Website - neat graphics too.

However, your best bet is probably trying to hook into the Opensource Computer Vision project. Here is a good tutorial on using OpenCV for facial recognition.

Mike Buckbee
+2  A: 

Javascript Neural Nets have been used for OCR so should be possible if much harder for faces.

edeverett
+4  A: 

It looks like you are new to programming. Perhaps you have an advanced mathematics degree? If you really don't understand that the notion JQuery can detect faces is a joke, you need to learn a lot before you will be ready to detect faces. If you're lucky you can find an easy out-of-the-box solution. Unfortunately, face recognition is in the class of problems that tend to lack easy out of the box solutions. JavaScript is right out.

http://rubyforge.org/projects/opencv/ is a Ruby binding to OpenCV. The pitiful documentation (autogenerated API docs only) at http://doc.blueruby.mydns.jp/opencv/ mentions a face_detect.rb that might be helpful. As with most bindings, you should also consult the documentation for the original library e.g. http://opencv.willowgarage.com/wiki/FaceDetection

You should also understand that face detection (where are the faces in this photo?) is a different and easier problem than face recognition (whose face is it).

joeforker
See it's nothing wrong... if something is not known,frankly tell i am not knowing this...
palani
I admire your enthusiasm, I just want to warn you that face recognition is a difficult problem.
joeforker
+2  A: 

Detecting faces reliably is one of the hard problems in Computer Science. Realistically, there's no practical way for you to do it using Ruby, JavaScript or any other application language using current technology. If you tell us why you need to detect faces then we might be able to suggest a practical alternative approach.

John Topley