Firstly, I’ve been away from Xojo for 7 or 8 months but was always a database guy, not into graphics.
It seems facial recognition/detection software is popping up all over the place and I’d like to try my hand at developing something.
I’m first thinking at least getting to the point of detecting a face in a photograph. My problem is, where do I start? Some pseudo code to get me started would be most helpful. I’m assuming the guts of the coding would be around the Picture control and examination of pixels but after that I’m at a loss as to how to examine said pixels. Hey, my assumption may be way off as well, but any help would be appreciated.
This is built-in to Core Image and can be done in a few lines of code but obviously this confines you to OS X (and iOS). Still, depending on your needs, it might be less work than building your own in Xojo… (there are tonnes of tutorials out there or PM me)
For CoreImage Face Detection, I have classes in MBS Plugin. See example project “FaceDetection”.
But that’s for finding faces, not for detecting who belongs to that face.
Thanks for responses everyone, I should say I’m coming from a learning point of view so I don’t have any time constraints and plus it’s not my day job.
[quote=66574:@Christian Schmitz]For CoreImage Face Detection, I have classes in MBS Plugin. See example project “FaceDetection”.
But that’s for finding faces, not for detecting who belongs to that face.[/quote]
I clicked on the ‘Answer’ button by mistake, not sure how to remove it. I was wanting to click on the ‘Quote’ button.
I checked your website but I’m unable to find any information regarding Face Detection. Can you supply a link which explains this function along with any other related functions?
I’ve made a simple implementation of the first algorithm on that page (the average hash) and it’s remarkably accurate for something so simple. It’s great at finding identical or very similar images. I guess for face recognition you may need to implement the more complex pHash version as it’s better at dealing with differences in images. For my needs the average hash is OK as it’s good at finding identical (even varying in size) or very similar images.
I guess you’re going to need to first find the faces in the image (using CoreImage face detection through MBS perhaps?) and then make a Perceptual Hash of the face area. Then you can compare the hashes and see the % difference between them.
I’ve made a simple implementation of the first algorithm on that page (the average hash) and it’s remarkably accurate for something so simple. It’s great at finding identical or very similar images. I guess for face recognition you may need to implement the more complex pHash version as it’s better at dealing with differences in images. For my needs the average hash is OK as it’s good at finding identical (even varying in size) or very similar images.
I guess you’re going to need to first find the faces in the image (using CoreImage face detection through MBS perhaps?) and then make a Perceptual Hash of the face area. Then you can compare the hashes and see the % difference between them.
Hope this helps, I’d be interested in hearing how you progress![/quote]
I mentioned this style of algorithm in another post. It’s fantastic for image comparison purposes. A problem is that the fingerprint is of the image itself and not of the face, though.
I was wondering this as well because it is actually far more difficult than people think. I had a client who wanted to do facial recognition for children and they looked at how it would be possible. You will find (quick Google search) a growing number of libraries that do it but be aware that the vast majority of them do it badly and the risk of false-positives is massive. They will all work ok if you have a consistent solid background, you have lighting exactly correct with no shadows and you have the person looking directly at the camera. Many of the libraries will put a wire-frame outline on the screen you are looking at to line up your eyes, nose etc to it so that they can increase the accuracy but the really impressive solutions cost a lot of money.
I have several real-time camera-based projects completed that use OpenCV in both mswindows and Linux. I suppose I could run both executables concurrently and pass info through files, but I was hoping to do something cleaner, with only one executable and common graphic window(s)…