Image recognition and pattern recognition algorithms and advice

We have an application where we need to do take a colour image of a retail pack (rectangular drug package as the kind you might find in a pharmacy / superstore) and compare this against a stored set of images/profiles for this pack and return which face of the pack is identified by the photograph and it's orientation (i.e., rotated 0, 90, 180, 270 degrees). The image will always be taken directly above the pack and will be in a moderately controlled lighting environment however there will be some background detail visible in the image. Currently the dataset of comparisons can be constrained by the fact that we will know what pack we are looking at, just not which face is showing and the orientation of that face. To complicate matters further we need to be able to perform this comparison and match process rather rapidly (looking at sub-second completion time) and have a comparison database that can be portable between locations.

What I need, is any advice on this process, where to look for more details, suggestions on algorithms, techniques or, perhaps, just an honest suggestion that it's worth getting an experienced image processing developer involved. Alternatively if there are solutions ready made for this kind of application then this would be very useful too.
Who is Participating?
Here's some companies that may offer Computer Vision solutions for what you need:

Some background info on object recognition basics and some open source software links:

Intel's open source computer vision library:

There's a book called Handbook of Computer Vision Algorithms:

Anyway, Computer Vision stuff is pretty complex and there's hundreds of image processing and object recognition algorithms with various benefits/drawbacks - especially since you have the real-time constraint. If your project is essential to your business I would suggest contracting it to experts.
Jose ParrotGraphics ExpertCommented:
If the refference images are taken at same distance and same lens focal, that is, if the compared images are the same size, or, if different sizes but constant ratio, then the problem can be reduced to:
1. Chose a small portion of the scanned image (from the probe)
2. Compare with the 4 samples (one for each view)

For the comparaisons with n% or more (determined by try&errors) of success,
3. Make a wide comparaison.

If the packs have logos or even simply the product name, then an OCR can help a lot.

To do step 1, we must chose a refference point in the pack. We star the comparaison regarding such point.

This is what occur to me at first glace.
I'd like to know if what I talk makes sense in your case.
NickRyanAuthor Commented:
Hmmm... not sure where my last reply comment went (made a good few days ago)

Fippy_Darkpaw - thanks for the links and confirming my instincts that we should "contract it to the experts" (the reliability and speed of the solution will be critical to this part of our business).

JoseParrot - Good point about the OCR. However we'd like the system to be "self teaching", without having to identify specific match points on each pack. Initially there'll be a single image per pack and subsequent images will have to match this. I'll admit that there are issues with different faces of the same pack and an automated learning scheme, however we're aware of this more procedural, rather than functional issue.

Any more suggestions would be greatly appreciated...
To reduce complexity, use
- grayscale instad of color (if possible) or better black/white!
- same picture/object size
- scale to same object size if required
Try to identify special marks on each type of packaging (e.g. size of backage, ratio of sides, a logo or a barcode)
Maybe subtracting the images and comparing the differences will lead to an acceptable result.
For this you should use black/white images, otherwise this wold be very sensitive to lightning. Before subtracting the image one have to detect the outer bounds, orientate the sides, and scale the image.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.