How to select camera and software for Barcode and DMC code reading
This article explains how to read barcodes and DMC codes (Datamatrix codes) with the most cost-effective machine vision camera solution. Additionally, we clarify the difference between Barcodes and DMC codes by discussing the pros and cons. We also provide a formula that helps you to calculate the required resolution, and give practical examples reading barcodes and DMC codes.

Table of contents
Barcode versus DMC codes
The best choice for code reading with industrial machine vision cameras is to use DMC code instead of Barcodes. DMC codes can be read using lower resolution cameras while using the same field of view as Barcodes. Therefore, when reading DMC codes, you can use cheaper cameras. This also means that with DMC codes you can inspect a bigger field of view with the same hardware and price.
DMC code is a matrix of dots, also called a datamatrix. The dot size is specified as module size. For machine vision algorithms, it is easier to read these dots than very thin lines, which barcodes are made of.
The resolution required is determined from the proportion between the field of view area we want to inspect at once (so within one frame / image), and the size of the smallest detail.
DMC codes are also much compacter than Barcodes, so it reduces the required label size. Here an example of a BARCODE and a DMC code label containing the exact same information.

DMC Code Example

Price considerations for code reading
For camera resolutions above 1.6MP, the shutter type has a significant influence on the price of the industrial camera. A rolling shutter can be used only when camera and object are still, whilst a global shutter can be used when there is movement. If you want to read more detailed information about the difference between the rolling shutter and the global shutter, read the shutter type in-depth article on our knowledge center.
How to calculate the required camera resolution for Barcode
To calculate the resolution needed to inspect barcode labels, we need to know the width of the thinnest line of the barcode we want to see and the size of the field of view.
To reduce the resolution needed, we can either increase the size of the thinnest line of the barcode or decrease the field of view.
How to calculate the required camera resolution for DMC Code
To calculate the resolution needed to inspect DMC code labels, we need to know the size of the smallest dot / square (module size) of the datamatrix and the size of the field of view.
To reduce the resolution needed, we can either increase the module size of the DMC code or decrease the field of view.
Minimum resolution versus recommended resolution for code reading
Resolution is key for stable, robust DMC code and barcode reading. In this example we calculate the system setup in 2 scenarios: minimum resolution and recommended resolution.
With minimum resolution we want a minimum of 1.5 pixels per linewidth (barcode) or 1.5 pixel per dot (DMC code). If all parameters are optimal (label quality, light, geometry, etc.) or you take multiple images of the same code. This could work stable.
The recommended resolution is at least 2 pixels per linewidth (barcode) or 2 pixel per dot (DMC). The best solution is 3 pixels. The more pixels per linewidth / dot means that the camera resolution is higher than required. The total setup will be more expensive. However more pixels will also result in easier, faster, better, and more stable reading of the DMC codes and barcodes.
Formulas for calculating resolution
There is a formula for calculating the resolution you can use:
Camera resolution = Field of view / systemresolution
Systemresolution = (Thinnestline or modulesize) / (minimum or recommended resolution per thinnestline or modulesize).
E.g.: Which camera do I need to detect a barcode with thinnest line of 1mm in a field of view of 1000*600mm. We go for the recommended resolution.
Systemresolution = 1mm/2pixels= 0.5 mm/pixel
Horizontal camera resolution = 1000 mm (horizontal FOV) / 0.5mm (systemresolution) = 2000pixels
Vertical camera resolution = 600 mm (vertical FOV) / 0.5mm (systemresolution) = 1200pixels
Our system will need a camera with a resolution of at least 2000*1200 pixels = 2.4MP camera.
If the object is standing still, so rolling shutter camera, we would recommend the 6MP camera MER2-630-60U3M for approx. 276euro (including lens). If the object is moving, we recommend the 3MP global shutter camera MER2-302-56U3M for approx. 472euro (including lens).
The importance of image processing software in machine vision barcode / DMC label reading
Software choice is crucial in DMC code and barcode reading. It plays a critical role in the system’s performance to recognize and read codes. As a general rule, the better the software algorithms, the better codes can be recognized, read and decoded.
The power of aurora vision software
In Aurora Vision Image processing software you can make a very powerful algorithm for code reading with just 2 tools and 5 minutes of time. One tool for acquiring the image and another tool for detecting the barcode or DMC code.
The tools are very fast and powerful. In all our tests, we achieved far better reading success ratio on difficult images compared to customers that are using open-source code reading algorithms. Especially when there is limited resolution or difficult lighting situation (reflections for example).
On the right side is an example of reading barcodes in Aurora Vision Studio.

Code reading application in practice
As mentioned, reducing the field of view will reduce the required camera resolution. If the field of view is very wide compared to its height, one smart way to setup a system is to capture several images by means of moving the cameras or the products.
For instance, if your field of view where barcodes or DMC are to be detected is 10 x 2 meter, you could move one camera on a trolley and grab 5 pictures of 2x2meters, rather than use 5 cameras
Line scan cameras vs area scan cameras for code reading
Our customers frequently ask what the difference is between Line scan cameras or Area scan cameras to detect barcodes.
With Line scan cameras an image is reconstructed in software line-by-line for inspection, this happens when an object passes under the sensor. Line scan cameras are preferred when using a conveyor belt to move the products below the camera. For line scan cameras it is very important to know when to capture each pixel line, because it depends on the speed of the object that is passing. Often encoders are used. A line scan camera is very expensive, and encoders are needed to make a stable solution.
Area-scan cameras are much cheaper, more flexible, and easier to install. They can read barcodes and DMC codes in very different environments. Therefore > 95% of the applications for barcode or DMC code reading use an area scan camera.
Conclusion
If you want a cost-effective code reading solution, we recommend using DMC codes. The datamatrix is readable with a lower resolution camera and low-resolution cameras are cheaper than high resolution cameras. If you do want to read barcodes or further lower the price of your DMC code reading solution, we recommend using a rolling shutter, if possible, since these are cheaper than global shutter cameras.
You can also reduce the resolution needed by either increasing the size of the thinnest line / dot or decrease the field of view. The field of view can also be decreased by using multiple cameras covering the total field of view.
Get notified about knowledge center articles?
Do you find our knowledge center articles helpful? Make sure to follow VA Imaging on LinkedIn as we will post new articles there as soon as they are released.