Is it possible to use PHP to compare an uploaded picture to other pictures in a database?
For example: to search wines by comparing a picture of a wine bottle against a catalog of labels
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is possible, but you’ll have to write most of the code yourself. I strongly suggest you read up on feature recognition, as you’ll need to borrow a few algorithms from there.
The basic idea is to find recognizable “landmarks” in a picture (like the vertices of the picture on the bottle) and to then match based on this, taking into account the fact that the picture might not be taken from the same angle, in the same luminosity, or with the same hue.
There is an extremely good C library called openCV, and I am wondering if someone made a port to PHP from it. It has most of the algorithms you want (I used it for my final year research project mapping crystal structures), so it’s worth having a look into, even if just for the maths behind it.