Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Automated barcode recognition from an image with NI Vision.

Hello,

I would like to know if someone can help me with some obstacles I've run into.  I need labview to recognize barcodes from an already acquired image automatically.

My flow chart is as follows:
1. Image is acquired.
2. Look for instances of different barcodes in the image.  //Note: there may be more than one barcode in the image, but are all of the same type.
3a. Display and labels (a simple numerical order) the barcodes located in the image one by one. //Note: I know by using the Vision Assistant, the pattern matching/geometric matching functions give them labels automatically if I'm dealing with regular patterns and shapes.
3b. Asks the user which of the labeled barcodes to translate.
4. Translates the barcodes.

Currently, I have taken the NI course on Machine Vision and Image Processing, however I'm still not too familiar with the automated inspection capabilities of labview and the vision development module. I know that I can use the Vision Assistant Express VI to translate barcodes from an image simply by using the barcode reader function and selecting the ROI (region of interest) manually. I know that the pattern matching/geometric matching functions are able to identify individual shapes and objects in an image. However, those functions seem to be unable to recognize barcodes that are slightly different since they're a different shape even with the minimum matching score set to a relatively low number.

My questions are as follows:
1. How do I "teach" the machine to recognize barcodes as a "type" of thing I want to recognize in an image (what sort of functions and VI's would I use) so I can do an automated inspection similar to pattern matching and geometric matching?
2. With the instances found, how would I retrieve the ROI information from each of the barcodes found so I can separately display them?

Any input and help is greatly appreciated. If someone can point out references or examples I can look up that would be great as well.
Thanks for taking the time to read this,
JY


Message Edited by JY86 on 07-29-2008 03:42 PM
0 Kudos
Message 1 of 5
(4,092 Views)
Hello JY,

Without really delving into it myself, I can only offer a few suggestions. 

1. How do I "teach" the machine to recognize barcodes as a "type" of thing I want to recognize in an image (what sort of functions and VI's would I use) so I can do an automated inspection similar to pattern matching and geometric matching?


As for "finding" something that looks like a barcode, I think Pattern Matching is going to be your best bet.  But perhaps Shape Matching would work as well. 

Once you find what could be a barcode, you could mask that ROI and attempt to read the barcode. 

2. With the instances found, how would I retrieve the ROI information from each of the barcodes found so I can separately display them?

Pattern Match will report the X,Y center of your pattern.  Of course only a perfect 1000 score match could you expect your X,Y to be exactly in the center of your match.  But it should be fairly close.  If you know the expected size of your barcode, you could extrapolate it from the center point.

Good luck with your project. 
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 2 of 5
(4,082 Views)
Thanks Patrick,

I'll test around with the settings from your advice for question 2, since I need a better grasp of how the parameters work myself.

However, my main problem is still "finding" something that looks like a barcode. Unfortunately, shape matching doesn't do the job nor does pattern matching (since different barcodes are different patterns, even when the minimum matching score is set relatively low). Geometric matching does not work either because it takes up too much resources and my computer comes to a halt even when I'm only creating a template. Are there any other ways or references I can look up for this so that labview can recognize that something looks like a barcode in an image?

Thanks,
JY
0 Kudos
Message 3 of 5
(4,078 Views)
Pattern matching can be very tricky.  Especially if you have inconsistent image quality or poor lighting.  

If you can narrow down the search areas that will help.  But if you're looking for multiple hard to match patterns in any number, placement, or orientation, you've working on a tall order.  

Pattern matching is usually about the highest "level" tool of any of the machine vision solutions I've worked with.  Mileage varies.

In past LabVIEW projects I've used a few tricks to improve results.  Like using up to a dozen similar images as patterns when results were low.  I would run through all of them and pick the one with the highest score.  Probably not the most elegant solution, and definitely not the fastest.  But eventually it worked well enough for that application.

If you haven't already read through it, I'd suggest having a look here.  http://digital.ni.com/manuals.nsf/websearch/80CC7F2386F7701F8625731500701D23

Some good reading there.  As well, it really is worth going through the examples both in Vision Assistant and LabVIEW.  If you have Vision Builder, go through those examples too.  I've found a lot of good stuff there when I needed it.

 
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 4 of 5
(4,069 Views)

Thanks Patrick,

I'll download that manual and try giving pattern matching my best shot.

Your tips are very helpful for an inexperienced user like me.

 

Thanks again,

JY

 

0 Kudos
Message 5 of 5
(4,058 Views)