Algorithm Was Not Able to Locate the Data Matrix Error in VBAI

Updated Apr 27, 2023

Reported In


  • Vision Builder for Automated Inspection

Issue Details

I am using Vision Builder for Automated Inspection to read 2D barcodes, but when I try to read the barcode using the Read 2D Barcode step, the program throws this error:

Algorithm Was Not Able to Locate the Data Matrix or Code not found

How do I solve this?


In order to correctly use the Read 2D Barcode step in Vision Builder for Automated Inspection, it is important to give it a clear 2D barcode image as an input. If a blurry, noisy or low-resolution image is fed into the function, the step will likely not be able to recognize the code, leading to this error. To resolve the error, try the following:
  • Use the Suggest Values option, so that the function itself suggests the values of the parameters used in the algorithm.
  • If the step still does not read the barcode after using the Suggest Values option, modify the settings of the step manually until you find a configuration that works. For instance, if you already know what is the expected size of the matrix, you can help the algorithm by specifying the matrix size. You can also specify the minimum and maximum expected barcode size in pixels, so that the algorithm never excludes a matrix candidate because it is too small or too big.
For a complete reference of all the Read 2D Barcode settings, open the help document in the Vision Builder For Automated Inspection environment by going to Help >> Online Help... and then search by the name of the step (Read 2D Barcode).
  • As mentioned before, the algorithm might not work well with blurry, noisy or low-resolution images. To enhance a bad-quality image, consider using a Vision Assistant step to change the contrast, gamma and brightness properties of the image before feeding it into the Read 2D Barcode step. Adjust these properties as necessary until the step can automatically detect and read the barcode.

Additional Information

For optimal results, it's important to ensure repeatability of the lighting conditions under which the images are taken as much as possible. If the images vary too much between themselves, it will be harder for the algorithm to detect the codes.