05-22-2017 02:39 AM
In the attached image I have four Code 128 and two Code 39. I have problem detecting them without down sampling the image first. Since I want to grade the bar codes I don't want to down sample since the code quality is reduced then. I noticed this from that sometimes the bar codes are found without down sampling an then the grade is higher for those. Down sampling a factor 2 sometimes work , down sampling a factor 4 always works. I crop the image around the bar code but this doesn't help.
I'm using IMAQ Read Barcode 2, and have tried to change the parameter Min Bar Width with no result.
Best regards
Karin Hellqvist
Certified LabVIEW Architect
Solved! Go to Solution.
05-23-2017 12:39 AM
try to do some preprocessing to reach appropriate image try to use thershoulding to separate bar from back ground
05-24-2017 09:53 AM
Thanks, Hatef for you answer. I have tired thresholding the image but that doesn't help. Also it I do that I will lost the information needed for the grading of the barcode I want to perform.
The issue is somehow related to the number of pixels between bars and across each bar.
05-24-2017 10:45 AM
Can you make it a two step process? Reduce the image size and locate the barcode, then scale the found ROI to grade the original barcode?
If it won't read the original barcode when it is trimmed, there must be something wrong in the search parameters. I don't know the parameters well enough to help with that, though.
Bruce
05-24-2017 04:32 PM
if thresholding could not separate your barcode well so barcode algorithm will not work well elso because it work on threshold base method
so I thing you have to change your lighting system or use some preprocessing algorithm
05-28-2017 03:46 AM
Bruce, I don't relly understand how you mean by two step process. I do reduce the image size by croping the image around the barcode. Which way do you mean resize the image? adn what do you mean by scale?
Yes, I think also there's something wrong with the search parameters but I can't find what. If it's at all possible to do with this image resolution.
Hatef, there is no problem separating the bars in the barcode by thresholding. I attached the image in my first post. The image quality is good enough for the algorithm to find the barcodes. And the algorithm does find the barcodes after downsampling the image.
05-28-2017 04:20 AM
so if I could understand well this time
your problem is down sampling of image that some time cause to lost bar code? if it is your problem it could relate to method of down sampling that need to calculate average of neighborhood pixel around each pixel for down sample pixel in new image these neighborhood if consist black and white part will be attach bar together and destroy the bars space and stick them together
05-28-2017 10:23 AM
I meant downsampling to locate the barcode, then using that information to locate and analyze it in the original image.
Bruce
05-29-2017 08:56 AM
Hatef, no that's not my problem. If i don't downsample it doesn't work. If i downsample it works.
Bruce, I tried similar to what you're saying. I know all the time where my barcodes are, and crop around them to reduce the image size. Unfortunately this doesn't help.
06-22-2017 08:23 AM
I got some help from NI Support who help me find the setting Minimum Edge Strength which I needed to lower to 20. This is due to my blurry image quality.
I think I maybe need to change my lightning to use from above instead of from below to get this improved. I know if I would like to grade according to the standards the lightning should be from above. Also my camera has manual focus and aperture, which makes it a bit hard to get better image quality.