1

I am creating an app, its main functionality is, a user can input image which includes a face of a person. Using that input image, I need to check(Compare), Whether the input image is matching with the list of images I have. I mean the face in the input image, The list may contain more 100000 images.

How can we do this in PHP ?

rano
  • 5,496
  • 4
  • 36
  • 62
phpqa.in
  • 549
  • 2
  • 7
  • 16
  • 1
    Something similar to what Google uses for image searches? – asprin Jul 26 '12 at 11:29
  • You would have to scan those images and get LIKE and MATCH data of vectors - circular and oval shapes - detecting color patterns and hair .. pending how advanced; there must be an API already out for this (IBM) but I do not if it is PHP - Java yes (passport machines etc) – TheBlackBenzKid Jul 26 '12 at 11:30

2 Answers2

2

OpenCV does face regonition. You can call OpenCV directly from PHP or you can try the OpenCV for PHP project.

There is also a long list of other face recognition libraries on this question: Face recognition Library

Community
  • 1
  • 1
Christian
  • 1,810
  • 15
  • 26
  • @phpqa.in You should upvote answers that you find good/helpful. And accept the one that really solves your problem. – Noufal Ibrahim Jul 26 '12 at 16:44
  • Hi, Christian I have tried to install the build you have mentioned, but the module is not properly in the my system, Its showing some discrepancy errors, while doing the 'make test' functions – phpqa.in Aug 06 '12 at 04:45
  • 1
    First link is expired. – M at Sep 18 '17 at 05:42
  • using python programming. we can do this by using face_recoginiton library. – Chandan Jan 27 '21 at 13:42
0

Though it might actually be possible to do that in php that language certainly is a bad choice for the problem. What you are probably really looking for is:

1.) some pattern matching software that can recognize similarities in images. Since that involves graphics processing such software is typicall not coded in a scripting language like php but in something more efficient like c or c++.

2.) some primitive php code controlling the face recognition, the comparision running in another process.

arkascha
  • 37,875
  • 7
  • 50
  • 85
  • 6
    -1. This is not really an answer. Just a criticism of the choice of language. – Noufal Ibrahim Jul 26 '12 at 11:35
  • just wanted to note, scripting language doesn't mean it's not compiled, or it's not efficient. actually, this phrase can be quite confusing, so it's better not to use it. – Luka Ramishvili Jul 26 '12 at 11:39
  • @Noufal Ibrahim That is not really true: I DO point out a possible path to a solution. – arkascha Jul 26 '12 at 11:40
  • @NoufalIbrahim he actually suggested an usable approach - to have PHP call the C++ library (though C would be way better). But if you have the luxury to run your own server (or VPS), then why not choose Python, Ruby or Common Lisp (which is best for AI). They are more powerful and Common Lisp is at least as efficient as C++. – Luka Ramishvili Jul 26 '12 at 11:42
  • :-) Why don't you guys read before commenting ? I mentioned c and c++. – arkascha Jul 26 '12 at 11:44
  • Shifting the language and using some FFI like thing are all fine. Those are details. The question is "how" to do it. I wouldn't have put the -1 if there was atleast a mention of a library that actual does it. The second comment to the question offers some more meat than this answer. – Noufal Ibrahim Jul 26 '12 at 11:45
  • @Noufal Ibrahim That is actually a good point. Criticism accepted. – arkascha Jul 26 '12 at 11:46