09-27-2014 07:10 PM
Hello,
I need to read all Data Matrix (DM) 2d barcodes, existing on an image with LV Vision, taken in account following considerations:
My most successful attempt:
Define a Bottom centered ROI covering 1/9 total image area (arbitrary size, and position). Little ROI area work fast but has a minor chance to enclose a whole DM.
Let IMAQ Read Data matrix Barcode 3, read first code inside ROI (slow process, if there are a lot of Data Matrix inside the ROI). By the way, I don’t know which is the Read Data matrix algorithm select criterion (first found, maximum score?)
Convert programmatically the read barcode in a template, masking Data region.
Find all data matrix by Geometric Pattern Matching2 or Pattern Matching 4, building an array of ROIs
Read barcodes inside each ROIs, previously generated.
This approach work well, but in many cases, GPM2 /PM4 doesn’t find ALL datamatrix or locate some “ghosts” (patterns other than Datamtrix codes) or some ROIs are improperly rotated.
Data matrix framework is a simple square with two solid bars L shaped (finder pattern) with a opposite second pair of L shaped dotted bars (timing patterns). Dots corresponding to data matrix cells, rows and columns (10 x 10 to 144 x 144). All DM, has identical frameworks therefore was a near ideal condition to do a GPM2 /PM4
Questions:
1] Some idea to locate the first DM fastest /secure?
2]Both IMAQ Read Data matrix Barcode 3 and Geometric Pattern Matching2 need an Edge Threshold parameter. A constant value may work for many contrast relationship, but not for all. Any way to calculate this parameter programmatically?
3] None of the two algorithms appears to be superior to another in the task of locating the datamatrix. Both have false positives and negatives, with similar or different types of images.
Pattern Matching 4 gives the impression of being more robust and requires less configuration parameters, but often fails in many cases when Matching2 Geometric Pattern works well.
I thought of using both simultaneously, but it does mean a significant increase in processing time.
Any LV example, VA script, idea, or suggestion for exposed or different algorithms, will be welcome. Thanks a lot!
Attached: Pictures sample codes
10-06-2014 01:00 PM
Hello,
Not one answer or suggestion to any of the questions.? Hey, it's a problem with some difficulty but I think it isn't impossible (I Hope)!
For example, my second question: is there any way to analyze the image to obtain an near optimal value, for IMAQ Read Data Matrix Barcode 3 and/or Geometric Pattern Matching2 Threshold Edge, parameter?
Any help is very appreciated,
Thanks