LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read a barcode from a digital camera into labview

Hello All,

 

Ive been working on a barcode reader project. My employer wants to create a barcode reader which rather than using a scanner would acquire the barcode using a digital camera/usb camera. The little that i know till now suggests that there are certain barcode series that labview can automatically read itself once the image has been acquired. We just need to acquire the image the correct way and then the labview will read the barcode from it and the information stored in the barcode will be generated from the hard drive of the computer.

 

P.S. My concepts might be way off the actual theory. Please bear wimme if im lost. 

 

 

Regards
Asad Tirmizi
Design Engineer
Institute of Avionics and Aeronautics

" Its never too late to be, what u want to be"
Using LabVIEW 8.2
0 Kudos
Message 1 of 18
(12,064 Views)

Have a look through the examples:

National Instruments\LabVIEW\examples\vision
+ 2. Functions\2D Barcodes
- 2D Barcode.vi
+ 3. Applications
- Barcode.vi 

 

Barcode Example

 

I would recommend you do a search on the NI website for 'imaq read barcode' or 'vision barcode image' etc. to find more examples and help.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 2 of 18
(12,062 Views)

Hello All,

 

Courtesy to AdnanZ i was able to understand the basics of reading the barcode. I downloaded the Vision toolkit from Labview and used the barcode example that comes with it. I have understood the VI except for the ROI part and there are certain more issues that i need to resolve in it before i proceed .

 

Please find the VI attached, I have also attached the image of VI block diagram. My queries in the order of there urgency are as under.

 

  • The problem starts with the ROI part. If you see the second flat sequence structure. The example sets the Region of Interest by using a property node and feeding it with a string array. There is also a waveform data type array feeding the "ROI color" part of the property node. Property nodes are there to set or get characteristics of certain types of data. I cannot understand its purpose here. Moreover how can i set the Region of interest according to my own liking. I can see a relation between setting the ROI and the values in the arrays. But by which criterion are these values set. Is it with hit n trial.
  • The code works perfect with the images stored as default in the example. But when i tried to add up my own images of barcodes downloaded from internet. It wasnt able to detect those barcodes. The code bydefault reads EAN-13 barcodes. I  downloaded a few EAN 13 barcodes from the internet and fed them into the folder from which the program reads. But that dint happen. I think this is because the ROI is not set correctly. Though i am not sure about it.

 

Regards
Asad Tirmizi
Design Engineer
Institute of Avionics and Aeronautics

" Its never too late to be, what u want to be"
Using LabVIEW 8.2
Download All
Message 3 of 18
(11,999 Views)

Any one ?  Some one ?

Regards
Asad Tirmizi
Design Engineer
Institute of Avionics and Aeronautics

" Its never too late to be, what u want to be"
Using LabVIEW 8.2
0 Kudos
Message 4 of 18
(11,992 Views)

Hello Asad,

 

I will take a look at your VIs and post on this thread soon. 

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 5 of 18
(11,957 Views)

Thank You so much for your consideration. i will be greatful if u can elaborate the relation between the string input to the ROI property node.

Message Edited by Virtual_Hornet on 10-20-2009 01:27 AM
Regards
Asad Tirmizi
Design Engineer
Institute of Avionics and Aeronautics

" Its never too late to be, what u want to be"
Using LabVIEW 8.2
0 Kudos
Message 6 of 18
(11,928 Views)
Vivek, what does ROI mean?
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 7 of 18
(11,925 Views)

Dear parthabe.

 

ROI means Region of Interest.  I need to set it right in order to extract the information out of the right spot. For example if i have an inventory of propeller blades with the bar code inscribed at their Hi pitch end i would need Labview to extract only the hi pitch end of my props cropping out the rest of the image for furthur processing.

 

Regards
Asad Tirmizi
Design Engineer
Institute of Avionics and Aeronautics

" Its never too late to be, what u want to be"
Using LabVIEW 8.2
Message 8 of 18
(11,918 Views)

You can define customized ROI in lot of ways.

 

1. Use a threshold--> particle analysis---> get bounding box ----> convert to ROI 

 

2. draw ROI using "Imaq select rectangle"--> Rectangle to roi

 

3. Template matching (with a score of 500) -->get bounding box--->convert to roi

0 Kudos
Message 9 of 18
(11,892 Views)

Hello Asad,

 

The datatypes used for ROI and ROI color are not a string array and a waveform.  Both are clusters. To see exactly what datatype is contained within these clusters, browse over ROI and ROI color in the property node and look at the Context Help window. This will detail the datatype as well as what that data represents. For the ROI Color property, the three numbers in the cluster refer to Red, Green and Blue values. For the ROI property, the cluster contains Global Rectangle and Contours information. I would suggest changing the values being sent to the ROI property to see how it changes the ROI in the Image Display control.

 

As long as the barcode is within the ROI specified, you should be able to see the code reading. Hope this helps.

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 10 of 18
(11,873 Views)