Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top