Image recognition and pattern recognition algorithms and advice

Posted on 2007-07-30
Last Modified: 2012-08-14
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.
Question by:NickRyan
    LVL 4

    Accepted Solution

    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.
    LVL 18

    Expert Comment

    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.
    LVL 1

    Author Comment

    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...
    LVL 6

    Expert Comment

    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.


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    This algorithm (in C#) will resize any image down to a given size while maintaining the original aspect ratio. The maximum width and max height are both optional but if neither are given, the original image is returned. This example is designed t…
    Okay. So what exactly is the problem here? How often have we come across situations where we need to know if two strings are 'similar' but not necessarily the same? I have, plenty of times. Until recently, I thought any functionality like that wo…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now