Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Dot Peen to Data Matrix

Hello,

 

Does anybody know a way to convert dot peen image to data matrix using labview?

OR

a way to read encoded message in dot peen code using labview?  

 

VeMo

0 Kudos
Message 1 of 9
(1,058 Views)

You might want to try to improve the lighting so you get better contrast between the dot peens and the background.  Either a dark spot on a light background or light spot on a dark background.

 

I though about using convolution and a dot peen as the template to locate all the dot peens.  They are all bright on the left and dark in the center.

 

Similarly, use pattern matching to locate all the dot peens, then use those coordinates to create a new image with a large dot at each coordinate using draw functions.

 

If you can get to an image where the dot peens are easily separated from the background, you just need to run the 2D barcode reader tool.  That is the easy part once the image is clean enough.

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 9
(1,046 Views)

Hello, 

 

Thank you for your reply.

 

I tried converting the image to binary image with white background and black dots but since the image has dark areas at random spots other than dot peen holes, the image has a lot of dark/black spots than actual holes causing trouble in locating only dot peen holes. I am still new with labview so I don't know any other complicated vi's. If you have time, can you please elaborate a little on what you mean by convolution and dot peen as the template? 

 

I also tried pattern matching by taking a template image from the actual image but the issue is each dot peen hole is not exactly same so even the minor difference in pattern is not letting system find all the holes. 

 

 

0 Kudos
Message 3 of 9
(1,029 Views)

Convolution probably wouldn't work as an end strategy.  You would have to do further processing to find the points and turn them into useful spots for reading.

 

I tried pattern matching real quick.  I created a pattern from a random peen.  I was able to find all the spots when I dropped the minimum score to 400.  You could easily iterate through the locations of all the matches and redraw them in a picture.  For the picture, start with an empty picture, then use Draw Oval or Draw Rectangle to create a spot at each match location.  Once you are done, you can use picture to pixmap, extract the image data, and reshape it using the right and bottom dimension.  Then turn it into an image using array to image.  It really isn't as complicate as it sounds, and you can check it midway by displaying the picture it creates.  Once you have it back in an image, use the 2D barcode reader.

 

Another option would be to create an ROI for each spot, then merge ROIs and background.

 

Bruce

 

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 9
(1,011 Views)

I already have a program that can take an array of locations and paint squares at those locations so making a data matrix after finding all the dot peen holes will not be hard for me.

 

I am currently struggling with finding all the holes all the times. For example see attached program where you can upload main dot peen image first and then upload template image taken from the main image (both are attached) and it will only find 87 holes and not 88 which is incomplete data matrix. If I lower my match score, it will find over 100 locations because now it is showing me all the random stuff that is not correct. 

0 Kudos
Message 5 of 9
(1,002 Views)

86 out of 87 is plenty.  Datamatrix has redundant data in it, so if a few dots are wrong or missing it can still read it.  I would try it as is.  If I remember correctly, Datamatrix is designed to be able to correct 5% to 10% errors.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 9
(989 Views)

Hi Bruce,

 

I have tried it multiple times and it does not read in labview unless the data matrix is fully correct. if it is missing even one dot it does not read. I am trying to search for any option that allows labview to read redundant data matrix if it is missing one or two dots as you said but I am unable to locate any vi or any setting in the program that allows this kind of redundancy. 

 

Also, one other problem I am facing is that the program is looking for dot peen holes only if the template was taken from that same image. If you take a template from any other image and try to find dot peen holes on different image it will only find 40 or 50% holes and not all of them because it is looking for exact template. even with 500 match score it does not find more than 50 or 60% holes. That is where I am getting issues. 

 

Thanks 

0 Kudos
Message 7 of 9
(952 Views)

I would expect it to work even with a few errors, but I could be wrong.

 

I'm not sure what you could do about other images where the dot peen looks a little different.  This is where better lighting so that they all look about the same would help.

 

I have reached the limit of my knowledge on this.  I don't have any other ideas.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 8 of 9
(927 Views)

Thank you Bruce.

 

I will see if somebody else has any other ideas to find/highlight all the holes or convert dot peen to data matrix. 

0 Kudos
Message 9 of 9
(900 Views)