Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Need some help with image processing

I have an application where I am reading Code 128 barcodes.  Currently I process the images using IMAQ BCG Lookup with B=130, C=60, and G=0.75.  This works for about 96% of the images.  The other 4% of the images won't decode.  I've fiddled with the BCG settings, but can't get any better yield. 

 

The errors I'm getting are:

-1074396150  not a valid Code 128 barcode (~65% of failures)

-1074396142  not a valid linear barcode (~30% of failures)

-1074395277  doesn't pass checksum (~5% of failures)

 

I've attached a couple of images that won't decode.  These are as they came from the camera without any processing. I know it would be good to get higher resolution, but unfortunately, I am stuck with what I have.

 

I'm hoping someone with more vision experience than I can suggest a better way to process the images. 

 

Thanks

Download All
0 Kudos
Message 1 of 4
(4,689 Views)

Once I was playing with barcodes with low resolution, and I found that expanding them to twice the size with good interpolation sometimes fixed the problem.  That might be worthwhile to try.  You would just need to double the X dimension and use cubic interpolation.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 2 of 4
(4,686 Views)

Bruce,

Good idea.  By expanding by 2 before processing and using the same BCG parameters I was able to decode about half of the previous failures.  I also tried expanding by 3 and 1.5.  1.5 gave about the same results as 2  while 3 was not near as good as 2.  I will experiment with using different BCG parameters with the expanded image to see if I can get closer to 100%.

 

Thanks for the suggestion,

Steve

0 Kudos
Message 3 of 4
(4,680 Views)

You might want to try the BCG before the expansion, also.

 

There is only so much you can do with low resolution images.  The gaps between the bars are almost non-existant.  You might be able to do some sort of high pass filter horizontally to increase the contrast after expansion.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 4
(4,678 Views)