Current location - Education and Training Encyclopedia - Educational Knowledge - How to calculate the density of bar code? How many millimeters is 5 mils?
How to calculate the density of bar code? How many millimeters is 5 mils?
Barcodes are divided into one and two dimensions. The density of one-dimensional bar code refers to the width of the narrowest black bar or white bar. The density of two-dimensional code refers to the side length of the smallest black block or white block. These two narrowest image units are called modules. Density is usually measured by mil, which is called mill or mill in Chinese,1mil =11000 inch (inch) ≈ 0.0254mm (millimeter). So, if the density of a one-dimensional code is 5 mils, that is, the width of the narrowest black bar or white bar of a one-dimensional code is 5*0.0254mm =? 0.127mm. If the density of a QR code is 10 mil, that is, the side length of the smallest black block or white block of the QR code is10 * 0.0254mm = 0.254mm..

Because it is difficult to measure such a small length with a ruler, we can first measure the overall length of the bar code, then take photos to enlarge the bar code, then look at the pixels of the overall width of the bar code and the pixels of the module, and then apply the formula to calculate the bar code density: the side length of the module (that is, the bar code density) = (the total length of the bar code mm/ the pixels of the total length of the bar code * the pixels of the module) /0.0254.

The following example calculates the density of a two-dimensional code.

Total side length of QR code

In the above picture, the side length of the whole QR code is 10mm, and the side length of a single module is less than 1mm, so it is difficult to measure with a ruler and needs to be calculated by a formula.

Calculation steps:

1. Take a photo of the QR code and enlarge it as much as possible.

2. Use the drawing tool to measure the pixels of the whole QR code (1677 pixels) and the pixels of a single module (76 pixels) in the photo;

Module pixels of QR code and pixels of the whole code.

3. Because the side length of the QR code is proportional to the pixels of the QR code picture, we can calculate the side length of the module by measuring the side length of the QR code and the pixels of the picture of a single module.

The formula is: the side length of the module (that is, the bar code density) = (the side length of the two-dimensional code mm/ the pixel of the two-dimensional code * the pixel of the module) /0.0254, and the unit of the calculation result is mil. Finally, the function of dividing by 0.0254 is to convert the length unit into mil. If the length unit is not converted into mm, it is usually said that the density of bar codes is generally in mil.

Use the example above to calculate once:

Module side length (barcode density) =? 10mm/1677 * 76/0.0254 ≈17.84mm.

So the density of the QR code in the above picture is about 17.84 mils.

Use the bartender to make a two-dimensional code with the same content and the closest size, and the density is: 19. 17mil, which is close to the calculation result. Due to the errors in the tools for measuring objects and pictures, it is normal to have slight deviations in the results:

Use a bartender to check the density and size of the content.