LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

i want to read a barcode from a image

"I want to read a barcode which is part of a big image on which i have to work on,i am not able to read the barcode as i have to give the correct ROI,which in my case has to be set dynamically,can any body help me in this"
0 Kudos
Message 1 of 11
(3,927 Views)
Vicky,

The easiest way you will proceed on this is to use some pattern recognition or coordinate systems in order to identify where the barcode is; then you will programmatically create a ROI around the barcode and read it. IMAQ Vision has the functions necessary for identifying coordinate systems or making pattern recognition, according to the coordinates then you will build a rectangle ROI of the proportions of the barcode and input this ROI into the barcode function.
The IMAQ Vision Concepts Manual is a good resource of information, I really advise you to check it out. As well as the shipping examples of Vision.

Best regards,

Nestor Sanchez

IMAQ/Motion Support
National Instruments
Nestor
0 Kudos
Message 2 of 11
(3,927 Views)
G'Day Vicki,

I future, try to keep you additions to quesitons all on one thred - this one has exploded to (as far as I can see) four separate questions now, and it becomes difficult for us to help you if you are splitting it up. Use the "Comment on Answer" button on the original question in future, and then we can keep everything in one place.

cheers,
crelf




Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 3 of 11
(3,927 Views)
I tried doing this but ,there is not constitency in it,it degrads as the process goes on,can u suggest any other way out
0 Kudos
Message 4 of 11
(3,927 Views)
sorry i dint know abt this
surely i shall do it next time
vicky
0 Kudos
Message 5 of 11
(3,927 Views)
Well, it took a bit of mucking around, but I've put together a VI for you that searches the image for the barcode label, and then reads the barcode - it's actually more involved than I had first imagined!

I'm current writing a book called "Image Acquisition and Processing with LabVIEW" - would you mind if I included this solution in it (inlcuding your source image)?

hope that helps!

cheers,
Christopher

Christopher G. Relf
Certified LabVIEW Developer

Christopher.Relf@mBox.com.au
International Voicemail & Fax: +61 2 8080 8132
Australian Voicemail & Fax: (02) 8080 8132

---
EULA
1) This is a private email, and although the views expressed within it may not be purely my own, unless specifically referenced I do not suggest they are necessari
ly associated with anyone else including, but not limited to, my employer(s).
2) This email has NOT been scanned for virii - attached file(s), if any, are provided as is. By copying, detaching and/or opening attached files, you agree to indemnify the sender of such responsibility.
3) Because e-mail can be altered electronically, the integrity of this communication cannot be guaranteed.




Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 6 of 11
(3,927 Views)
This is vivek,from india,i had put up a question in the NI developers zone regarding reading a barcode from a image,Thankz for your solution,but i have a problem in this,the images i am finding the barcode are energy meter images ,so they may be of different types and shapes,so i need to find this barcode form any image i feed in,i amattaching another imae for your reference which is of a different type,there are around 30 different types which i have to work on.i had tried one more solution of doing some pattern matching on this image with a barcode template and have a low score for the search ,once it finds the image ,set the roi from this image and feed it to the barcode reader,but it is not finding it in all images.
thanks for your help
0 Kudos
Message 7 of 11
(3,927 Views)
Can you please post up the VIs you have already written?




Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 8 of 11
(3,927 Views)
I am attaching the vi that i had created,plz use the template given and INPUT image as image 11260003.jpg

regards
vicky
0 Kudos
Message 9 of 11
(3,927 Views)
I've got an idea - you know that the barcode will have numbers below it, and the number is physically longer than the barcode itself, so try this: make 10 templates - one for each digit (0,1,2...9), and then search (pattern match) for each of the templates (I notice that there aren't any other numerals in you image that are anywhere near the same as the barcode numerals). They should all have roughly the same y postion (the barcode label is stuck roughly parallel to the bottom of the image), so that will give you a y position to use (make the ROI Ytop about 60pixels less than the Ynumbers, and the ROI Ybottom about 30pixel less than Ynumbers). The searches will also return x positions for each of the pattern matches - the one matc
h with the lowest x position is the one closest to the left, and the the one with the highest x position is the furthers to the right. This means you will have absolute positions that you can build a relative ROI with! Does this make sense?

One other method - after you've done the pattern match described above, you not just arrange thier values in the order of their respective X poisitions - this will build the number for you.

cheers,
Christopher




Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 10 of 11
(3,927 Views)