Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

finding barcode in a image

Hello,

 

I have a NI1742 smart camera and Labview Machine Vision to read a barcode. Seemed like a straight forward thing at first, but I'm facing some issues.

 

I used IMAQ read barcode.

 

The code works fine as long as the barcode is the only thing on the view of the camera and there are no other number/letter on the view. Also, it does not work if the bacode is not 100% horizontal. 

 

In real life, I will have both the restrictions. How do I go about solving it. I was thinking about pattern recognizing the barcode and creating a picture with only the barcode and then tilting it to make it horizontal but that is a lot of work to do programmically. Is this the only way? If so, is there any example available to do that?

 

Or, is there any other way to eliminate the issues, or solve the issues?

 

Thanks.

0 Kudos
Message 1 of 7
(6,122 Views)

Hi there,

 

First, what type of barcode are you reading?  Some of the more advanced barcode VI's give you more search options, and you may be able to use these. 

 

Since the barcode VI doesn't give the option to search for rotated images, I'd recommend doing the process that you'd described.  The coding for it shouldn't be too difficultif you've got Vision Assistant.  All you would need to do is find that barcode (using pattern matching), take the rotated amount (an output from pattern matching), then use the Geometry to straighten it out.  When you pass the particle pattern found to the Barcode reader, it should already have the numbers removed. 

 

Cheers 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 2 of 7
(6,099 Views)

Hello chancenator, 

 

i am doing exactly the same thing. The only difference is that im using a basler camera and NI Vision assistant. The problems i face are quiet similar. First of all i have make sure that the barcode is the only thing in front of the camera while using vision assistant. I take a snap manually. import that snap in process images apply barcode VI.  Then i have to manually select the ROI around the barcode. Then the barcode is finally read. 

 

This is a far cry from what i am actually trying to do. I want the VI to select the ROI around the barcode itself. This would require pattern matching. I would be very glad if you would elaborate pattern matching any furthur.

 

Secondly, i need to do things automatically, i dont need a snap or atleast a long wait to import that snap in process images and then proceed. Kindly let me know what can be done. 

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 3 of 7
(6,082 Views)

Using a pattern match is not a great solution as the pattern will alter as the barcode changes. Most barcodes are printed on a contrasting background, normally white. Threshold for this to find the label. You can now use the bounding rectangle to generate an ROI or one corner to generate a fixture. Using the orientation of the particle is now valid to generate an X, Y and rotation coordinate reference space. Feed this to the barcode tool, which can be set up to work with a rotated rectangle ROI. This will allow you to read barcodes in the image with rotation. Be aware that some codes will require the full resolution of the camera, these are typically commercial codes as opposed to industrial ones which are more tolerant of resolution

 

Mike 

Message 4 of 7
(6,071 Views)

I am not familar with the smart camera. But I know somthing about barcode reader. In general, the barcode scanner can easily read barcode from 4 directions. So I can understand why it stops working when the bacode is not 100% horizontal. But as for your first issue that it did not read when there are other number/letter on the view, I have no idea of what is going on.

 

0 Kudos
Message 5 of 7
(5,375 Views)

Dear every1

 

i am having a very big problem t recognise my barcode

sir i am using vision assistant

but not when i am putting the barcode string into an output data

i am getting this type of error

 can some1 explain me why please

0 Kudos
Message 6 of 7
(5,178 Views)

Hello,

 

Since this is an old post, you may want to create a new thread in order to increase your question's visibility to the community. I also suggest posting some more detail about your code and steps you've taken so that we can have a better idea about what may be going wrong.

 

-Erik S

0 Kudos
Message 7 of 7
(5,152 Views)