Matrix codes: definition, construction principle, properties, parameters, advantages and disadvantages. Data Matrix - working with clinical data

The so-called Bar-codes have been used all over the world for quite a long time, yes, yes, these are such pictures with stripes of different lengths and thicknesses that are glued to goods in the nearest supermarket ^_^ In general, Bar-codes are different, but for us the most interesting will be the so-called QR code (from Quick Response - Quick Response), the most widely used on the Internet. it two-dimensional code, unlike stripes on goods, hence its very important property: information capacity. In general, I will not quote Wikipedia, those who are interested will read it themselves. There is enough big number ways of presenting QR codes on the Web, the most common are server-side image generation. However, my readers know how much I dislike such solutions.

Briefly about Bar codes

QR code

There are 4 main classes of information representation through QR code, which differ in the type of stored data and the maximum volume:

  • Numeric information only - up to 7089 digits
  • Alphanumeric information - up to 4296 characters
  • Binary data (8-bit bytes) - up to 2953 bytes
  • Kanji/Kana - up to 1817 characters

QR code has the following levels of error correction, characterized by the amount of information to recover (from larger to smaller):

  • H(high) - 30%
  • Q(uality) - 25%
  • M(edium) - 15%
  • L(low) - 7%

Error Correction Algorithm Based on Code Reed-Solomon.

In addition, there are several versions of data presentation (1-40), which are distinguished by the maximum amount of stored information and, accordingly, the size of the matrix.

datamatrix code

It's a different type two-dimensional code, less common on the Internet, but more compact. The code also provides for the storage of information for recovery up to 30%. Unlike QR, the application area does not have to be square.

So let's get started

Of course, I didn’t want to write an implementation of the code generation algorithm, so after googling, I found a quite suitable JavaScript encoding implementation from Kazuhiko Arase http://www.d-project.com/qrcode/index.html. Only one type of encoding is implemented here: 8-bit bytes, that is, any data is parsed as it is into bytes, in the same form they are read by scanners. Thus, we can encode any unicode string and any sane scanner should decode it correctly. In addition, in this implementation, the standard is supported up to version 10 inclusive.

A little later I got jQuery plugin , based on this development by the valiant Japanese https://github.com/jeromeetienne/jquery-qrcode . But the representation in it was realized exclusively through Canvas, and hardcore developers are required to write cross-browser wherever possible.

FROM datamatrix with codes, everything was more complicated, until I came across the jQuery plugin BarCode http://barcode-coder.com/en/barcode-jquery-plugin-201.html , which just contained the DataMatrix encoder from HOUREZ Jonathan. However, the plugin itself seemed to me too monstrous and difficult to expand in order to somehow use it.

Implementation

So it was decided to implement various rendering engines Bar codes depending on the support on the client side of certain features, also support various types encoders:

;(function($)( var $$ = $.barcode = ( defs: ( // Default options type:false // Code type ), clas: "bar-code", // CSS class conv: function(s )( // String conversion function return unescape(encodeURIComponent(s)); ), type: (), // Code types engine: () // Renderers ), T = function(t)( // Code type validator if( !$$.type[t])( for(var i in $$.type)( t = i; break; ) ) return t; ), R = Math.floor; // Rounding function $.fn.bar_code = function(opts)( // Plugin implementation return this.each(function()( var self = $(this); if(!self.hasClass($$.clas))( self.addClass($$.clas); // Set class ) var opt = $.extend(true, ( // Initialize options width: self.innerWidth(), height: self.innerHeight(), text: self.text() ), $$.defs, opts ), gene, inst, val = $$.conv(opt.text); // Data conversion opt.type = T(opt.type); // Init type self.empty(); if(!(gene = $ $.type))( // Finding the encoder return; ) if(!(inst = gene.init(opt, val)))( // Initializing eczems plar encoder return; ) var cnt = gene.read.call(inst), // Matrix dimensions est = [ // Matrix element dimensions R(opt.width/cnt), R(opt.height/cnt) ], p = ( // Adjustment padding w:opt.width-est*cnt, h:opt.height-est*cnt ); if(p.w > 0.01 || p.h > 0.01)( var cst = ( // Container padding width:opt.width-p.w, height:opt.height-p.h, paddingLeft:R(0.5*p.w), paddingTop:R(0.5 *p.h) ); cst.paddingRight=p.w-cst.paddingLeft; cst.paddingBottom=p.h-cst.paddingTop; self.css(cst); ) for(var n in $$.engine)( // Search for a suitable renderer if ($$.engine[n].check())( $$.engine[n].render.call(self, function(col, row)( // This lambda essentially queries the state of the matrix element return gene.read. call(inst, col, row); ), cnt, est); break; ) ) )); ); /* Renderers */ /* Code types */ ));

As it turned out, in many crooked browsers, such as the hated Internet Exploder and Opera, non-integer pixels work quite strangely, therefore, for compatibility, the sizes of each element of the matrix had to be rounded to a smaller integer, in order to avoid the matrix going beyond the area. For this reason, the matrix had to be indented from the container.

rendering

Now let's implement render engines. Since the use of Canvas will be a higher priority for us, let's start with it:

$$.engine.canvas = ( check: function()( // Check accessibility try( return !!window.CanvasRenderingContext2D && !!document.createElement("canvas"); )catch(e)( return false; ) ), render: function(chk, cnt, est)( // Rendering // First we need to get the colors to make the image look like CSS var st = this.append(" ").find("span"), c = st.eq(0).css("backgroundColor"), d = st.eq(1).css("backgroundColor"), w = est.width, h = est.height; this.empty(); // Now Initialize Canvas var can = this.append(" ").find("canvas").get(0), ctx = can.getContext("2d"); can.width = cnt*est; can.height = cnt*est; // And color the matrix for(var y=0;y< cnt; y++){ for(var x = 0; x < cnt; x++){ ctx.fillStyle = chk(x, y) ? d: c; ctx.fillRect(x*est, y*est, est, est); } } } };

If Canvas is not available, we will stupidly generate a matrix HTML elements, it's slower, but it works:

$$.engine.html = ( check: function()( return true; ), render: function(chk, cnt, est)( var tab = ""; for(var y = 0; y< cnt; y++){ for(var x = 0; x < cnt; x++){ tab += ""; ) ) this.append(tab).find("span").css(( width:est, height:est )); ) );

After testing in IE, as usual, it turned out that it doesn’t work there at all as intended, so for lack of desire to figure it out, we’ll write a table engine:

$$.engine.table = ( check: function()( return true; //$.browser.msie; ), render: function(chk, cnt, est)( var tab = ""; for(var y = 0 y< cnt; y++){ tab += ""; for(var x = 0; x< cnt; x++){ tab += ""; ) tab += ""; ) this.append("

"+tab+"
").find("table").css(( width:est*cnt, height:est*cnt )).find("td").css(( width:est, height:est )); ) );

As you can see, everything turned out quite trivially. All that's left is to write the stylesheet:

Bar-code( /* Container */ overflow: hidden; margin: 10px; padding: 0; width: 100px; height: 100px; background: #fff; /* Background color. If you have a solid fill, you can not set this property */ ) .bar-code *( /* All elements by default */ display: inline-block; float: left; border: 0; padding: 0; margin: 0; border-collapse: collapse; ) .bar- code .dark( /* Darkened elements */ background: #000; /* You can set any color, the main thing is that it should be well different from the background, experiment */ )

I'm resetting some properties here just in case you don't have to if everything looks great.

Encoders

As mentioned above, we implement the generation QR codes, using the encoder from Kazuhiko Arase, also to the heap and for the sake of example, add a generator datamatrix codes is an alternative to QR codes, but less common on the Internet and supported by fewer scanners. In the script, we will check if the encoder is available and only then initialize the engine.

Kazuhiko's encoder requires the obligatory indication of the code type, that is, a number from 0 to 10, which, together with the error correction level, makes up the code version, however different types codes are capable of storing different amounts of information, so I decided to implement automatic selection of the type corresponding to the data if the type is not specified. So, QR coder will look like this:

If(window.QRCode)( $$.defs.QR = ( // Default option values ​​level: "H", // Default level type: 0 // Default type // 1..10 // my extension : 0 or null - autoselection ); var QRAutoType = function(val, errorCorrectLevel)( // Automatically select the appropriate type for(var typeNumber = 1; typeNumber<= 10; typeNumber++){ var dataList = , buffer = new QRBitBuffer(), rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel), totalDataCount = 0; for(var i = 0; i < dataList.length; i++){ var data = dataList[i]; buffer.put(data.mode, 4); buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber)); data.write(buffer); } for (var i = 0; i < rsBlocks.length; i++) { totalDataCount += rsBlocks[i].dataCount; } if(buffer.getLengthInBits() <= totalDataCount * 8){ return typeNumber; } } return 10; }; $$.type.QR = { init: function(opt, val){ if(typeof opt.level == "string"){ opt.level = QRErrorCorrectLevel; } if(typeof opt.level != "number"){ opt.level = QRErrorCorrectLevel[$$.defs.QR.level]; } if(typeof opt.type != "number" || opt.type < 1 || opt.type >10)( // Automatic selection of the appropriate type opt.type = QRAutoType(val, opt.level); ) var qrc = new QRCode(opt.type, opt.level); // Encoder instance try( qrc.addData(val); // Feed data qrc.make(); )catch(err)( return false; ) return qrc; ), read: function(col, row)( if(arguments.length == 2)( return this.isDark(row, col); ) var cnt = this.getModuleCount(); return ; ) ); )

For encoding type datamatrix borrow the algorithm from HOUREZ Jonathan from the jQuery BarCode project. The encoder script with minor changes will be in the attachment, I will not give it here, but I will give the encoder code:

If(window.DataMatrix)( $$.defs.DM = ( // Default option values ​​rect: false // Area ); $$.type.DM = ( init: function(opt, val)( var dmc = DataMatrix .getDigit(val, opt.rect); return dmc; ), read: function(col, row)( if(arguments.length == 2)( return this; ) return ; ) ); )

We round, more precisely we square

And now about using the plug-in that we got. Let's create a test.html file with the following content:

jQuery Barcode test

jQuery Barcode test

hello world!
Hello World!!
Hello World!
http://website/


We have shown three matrices with code: regular size, large and small. Try, scan, enjoy :-]

And finally, I want to say that if there is no device with a camera and a code reader at hand, then you can use zbar-om. The package is available in any distribution, and it contains two utilities: zbarimg and zbarcam, the purpose of which, I think, is not difficult to guess.

Here's what happened to me:

On this, in principle, and all.

July 13, 2017

×

On July 11, the Data MATRIX team held a Biotech Tuesday meeting in Boston. About two hundred guests came to exchange the latest industry news and introduce each other to new partners.

Data MATRIX thanks all the participants who were able to join our team on this day. We hope that many of them have discovered new business opportunities. “It was a great meeting, it was great to meet representatives of such a large number of companies. The communication and interaction of the guests was great! It was the best Biotech Tuesday I've been to,” said one of the guests.

Stay connected and join the next Data MATRIX meeting!

07 June 2017

The Future of Clinical Research: Data MATRIX meeting

×

On June 02, DI Telegraph (Moscow, Tverskaya st., 7) hosted a meeting of pharmaceutical industry specialists “The Future of Clinical Research: People and Technologies”. More than 100 people took part in it.

The first part of the event was devoted to the discussion of software solutions for clinical trials. Data MATRIX CEO Ivan Dobromyslov presented an overview of these products, talked about how modern regulatory and management requirements affect software, and considered the features of patient-centered research. He also described in detail the new opportunities for research using mobile devices and the specifics of working in projects with large databases.

Christina Leus, Executive Director of Data MATRIX, presented project management in the MATRIX Cloud system at all stages: project creation, team assignment, inclusion of research centers, creation and deployment of an electronic CRF, maintaining a traceable product in the Pharmacovigilance module, working with a budget, planning project tasks and control over their execution. On May 31, 2017, the Data MATRIX team organized a meeting with industry colleagues in the brewery of the Belgian commune of Gembloux.

Representatives of Data MATRIX spoke about the services for collecting and processing data from clinical trials using a self-developed fully validated MATRIX EDC/IWRS application. Data MATRIX works with Phase I-IV trials and observational programs to help clients with data processing, patient randomization, statistical analysis, and more.

At the end of the presentation of Data MATRIX, representatives of European biotech companies were invited to a tour of the brewery, after which the guests of the event were able to discuss professional issues while tasting local beer and cheese.

Data MATRIX thanks all the guests of the meeting and hopes to see them in the near future.

Last update: 12/06/2011

The barcode has been improved many times. The main task of modifications is to increase the amount of encrypted information with a decrease in the area of ​​the code itself. If a strip barcode uses a one-dimensional coding system, then a two-dimensional one is decoded in horizontally and vertically. Before a conventional barcode, a two-dimensional one has a couple of significant advantages: a significantly larger amount of stored information and the ability to recover up to 30% of damaged data.

The DataMatrix standards, invented in 1989, and the QR code (“QuickResponse”, i.e. “Quick Response”), developed in 1994 by the Japanese company Denso Wave Inc., are currently the most widely used. The key difference between QR over Data Matrix is ​​the ability to work with Japanese kana characters.
The two-dimensional code can be applied in various ways - inkjet printing, engraving, laser, electrolytic methods, etc. Depending on the method of application, the code may remain on the element throughout its entire use cycle.


QR code

QR code is a kind of matrix code (2D-barcode) created by Denso-Wave Corporation of Japan in 1994. "QR" is an abbreviation for "Quick Response", "Quick response", with this name the creators wanted to show that the QR code allows you to quickly convey your content to the user. QR codes are very common in Japan, where they are the most popular type of 2D codes.
As early as the beginning of 2000, QR codes became widespread in Japan and other Asian countries. You can find them on business cards, magazines, newspapers, flyers, posters, bulletin boards, food, websites, etc. Europe and America are also trying to keep up.

Although QR codes were originally used to account for parts in mechanical engineering, they are now being used more widely, both for commercial accounting systems and for quickly delivering information to mobile phone users. QR codes can store contact information, text, phone numbers, e-mail addresses and hypertext links. Users with a camera phone and the appropriate software can scan the QR code, which will open a QR-encoded hyperlink, or add the encoded contact to their address book. The convenience of using a QR code is obvious - instead of remembering a long link or an e-mail address, just point your phone's camera at the QR code, and the link will be added to your favorites.

QR code capacity

At first glance, it may seem that a QR code is not capable of storing a lot of information, and is only suitable for encoding short strings, such as a URL or e-mail. In fact, the capacity of a QR code is not so small:

As you can see, more than 2 KB of text can be encoded in a QR code, which greatly expands the range of its applications, especially considering the convenience and speed of information delivery to the end user.

Error correction in QR codes

QR codes use the Reed-Solomon algorithm for error correction. This allows you to easily read codes that are somehow damaged - overwritten, crossed out, etc. QR codes have 4 levels of error correction, which differ in the amount of information to recover and, accordingly, the amount of useful information that can be restored if the code is damaged. The levels of correction and the corresponding percentages of information that can be recovered are as follows:

L 7%
M 15%
Q 25%
H 30%

datamatrix code

The DataMatrix barcode, in turn, is 30-60% smaller in area than a QR containing identical data.

DataMatrix is ​​a typical representative of the family of 2D barcodes that allows you to encode up to 3Kb of information. DataMatrix, like all other similar barcodes, contains recovery information that allows you to recover encoded information in case of partial damage to the code.

Each DataMatrix code contains two solid intersecting L-shaped lines to orient the reader, the other two code boundaries consist of alternating black and white dots and serve to indicate the dimensions of the code to the reader.

DataMatrix code features:

  • Standardization (ISO/IES16022 international standard adopted, Russian standard being prepared)
  • Large information capacity (more than 2000 letters or 3000 numbers)
  • High recognition and decoding speed
  • Low requirements for the quality of the surface on which the mark is applied
  • Recognition does not depend on the background of the image
  • The symbol can have two shapes - a square and a rectangle, this makes it easier to fit the label into the space available on the product

The most common use of the DataMatrix is ​​marking small objects such as microchips, since the DataMatrix allows 50 characters to be encoded in a 2-3 mm2 image that can be read without problems. In general, the size of the code is limited only technologically, as in the case of any other 2D code, but since DataMatrix is ​​an open standardized code, many companies use it for their own purposes. This may explain its wide distribution.

DataMatrix codes are made up of modules stacked with each other. In total, up to 3116 ASCII characters can be encoded using DataMatrix. Codes must contain an even number of modules vertically and horizontally. Most DataMatrixes are square, but in general you can use rectangular codes. All codes use the ECC200 error correction standard, which in turn uses the Reed-Solomon algorithm to encode/decode data. This allows you to recover up to 30% of useful information in case of code damage. DataMatrix codes are gradually becoming commonplace on envelopes and parcels. The code can be quickly read by the scanner, which allows you to track correspondence quite efficiently.

In industry, DataMatrix is ​​used to label various elements.

Microsoft Tag

Microsoft Tag is a two-dimensional color barcode (High Capacity Color Barcode). Unlike QR and DataMatrix codes, this type is much better recognized. Even defocused code (often mobile phone cameras without autofocus) can be read.

Microsoft Tag stores its own number with a length of 13 bytes + 1 control bit. The recognition program sends this number to the server, which issues the information stored in this code.

Advantages of Microsoft Tag, compared to QR and DataMatrix codes

  • Store more information on the same physical size
  • Only small circles in the centers of the triangles and the ends of the synchronization lines contain information. Therefore, Microsoft Tag with pictures is also possible.
  • You can track how many users "read" the code (thanks to Live statistics)

Cons of Microsoft Tag compared to QR and DataMatrix codes

  • Internet connection required (because all information encrypted in the code is located on Microsoft Tag servers)
  • A color printing device is required (although black and white code can also be generated)

Creating your own code is available (Windows Live account required).

You can download the recognition program for mobile devices

Creating your own code

There are several ways to create a QR code with any textual information:

1) Through online services

The most simple and convenient way. Just go to a special site, choose the type of code (QR or DataMatrix), choose what the code will contain (just text, Internet address, e-mail address, business card, code size).

QuickMarkreader [LOGIN and PASSWORD = w3bsit3-dns.com]
BeeTagg QR Reader

2) Through programs on the PC

How to correctly read the code through a mobile phone?

1) Run the program on the cell.

2) When the camera is activated, aim it at the 2D code. Recommended distance (for small codes) - 15 cm!

3) Using digital zoom, zoom in on the code so that it is clearly and completely visible on the display (digital zoom works better than reducing the distance to the code)

4) The program will automatically recognize the code and give the result

If it didn't work the first time, try again, changing the distance and magnification to the code

Tips:

1) Scan in good light.

2) Do not shake your phone too much when scanning.

3) Place the code at an angle of 90" to the phone, i.e. one of the four sides of the square (it doesn't matter which one).

4) Try to place the phone at the same height as the code.

How to create highly readable code?

1) Try to create code without overloading it with unnecessary information (especially small code)

2) If you need to encode a lot of information - make the code larger.

3) Print the code with maximum quality - to be as clear as possible (especially important for inkjet printers).

4) If you printed the code and want to cut it out from the sheet, leave margins - somewhere 2 mm on each side (margins are built in automatically on qrcoder.ru)

5) After creating the finished version - check it with several programs from your mobile.

In contact with

What is a 2D barcode? Many believe that this is a synonym for "QR-code". However, in reality, this is not entirely true - there are many more types of two-dimensional barcodes. It is about them that we will talk in this article.

I want to warn you right away that this time there will be quite a lot of text, and few color pictures. Yes, and the topic is quite specific, and not everyone will be interested. Moreover, recently there was already an article on the site Vitaly Buzdalov about QR codes, where all the main points were clearly and concisely described -

Unfortunately, WorldPress does not allow you to embed youtube videos in the text of the article (or I did not figure out how to do it). Because of this, I had to insert a picture, when clicked on, the video itself will open.

The main advantage of any barcode is ease of use. Two-dimensional codes are no exception, everything works on the principle of “pointed - shot - read” and does not require any special explanations. The scanner programs themselves usually have a standard set of functions, and do not need a detailed review either. Therefore, it turned out to be a review of the varieties of two-dimensional barcodes themselves, rather than programs for their recognition. There is no exclusive information in the article, all data is taken from open sources.

The article is divided into two parts - theoretical (types of 2D codes, their features and methods of application) and practical (programs for scanning and generating codes, generator sites, etc.)

THEORY

All barcodes can be divided into two types: linear and two-dimensional.

Linear barcode is code that reads in one direction. These barcodes are very simple and cheap to use.

Bernard Silver and Joseph Woodland can be considered the authors of the first linear barcode. In 1948, they happened upon a conversation between the president of a large chain of grocery companies and the dean of Drexel University's Institute of Technology, who were discussing the creation of a system that automatically reads product information.

The idea of ​​a barcode was born not at once. Initially, several other options were tried, such as labels applied with ultraviolet ink, etc. But for various reasons, all these ideas were not viable. The idea of ​​the barcode itself was inspired by Joseph Woodland's Morse code. According to him, he simply expanded the dots and dashes down and made narrow and wide lines out of them.

In 1951, they showed their invention to IBM, but it was revered that its implementation would require too sophisticated equipment. This was partly true - laser scanners did not yet exist and reading barcodes was quite difficult. In fact, Joseph and Silver's idea was over ten years ahead of its time.

For the first time, barcodes were shown to the general public only in 1971 at a retail conference. They were applied to lottery tokens and did not consist of lines, but of circles. In the future, the round version of barcodes was abandoned - when they were printed, the paint was often smeared and they became unreadable.

The first commercial barcode format was developed in 1972 and was called UPC - Universal Product Code. Since then, barcode formats have been improved and changed many times. Today there are more than 300 barcoding standards.

The main disadvantage of linear barcodes is the small amount of encoded information. It was to overcome this shortcoming that the 2D barcodes.

Site generator— http://barcode.tec-it.com
Scanner program Accusoft Barcode Scanner

PDF417 was developed by Symbol Technologies in 1991. The name PDF comes from "Portable Data File". The number "417" reflects the structure of the code - the barcode has a length of 17 modules, consisting of 4 "strokes" and "spaces". In fact, such blocks are a one-dimensional barcode.

In theory, this should make it easier to read and decode. And most likely, for special scanners, this is exactly the way it is. But there are often problems with scanner programs for mobile devices. In any case, I have such codes are read at best every other time. However, it is not the code itself that is to blame, but only scanner programs.

The code can be found on goods, documents, tickets. If I'm not mistaken, this is the one used on AeroExpress tickets. True, I could not read it with a scanner program. Often it can be seen in stores, in particular on bottles of alcoholic products.


datamatrix

Site generator— http://www.qrcc.ru/generator.php
Scanner program— Barcode Scanner

The DataMatrix code was invented by International Data Matrix, which was later merged into Acuity CiMatrix and bought by Siemens in 2005. The development of the DataMatrix code was significantly influenced by the PDF-417 multi-line barcode that preceded it. The Data Matrix is ​​currently described by the relevant ISO standards. The code can be used freely, without any royalties.

The code is a two-dimensional matrix of black and white dots or modules. The code must contain an even number of such modules both vertically and horizontally. DataMatrix code can consist of one or more blocks. Each block necessarily contains two solid intersecting lines in the form of the letter L - the so-called "search pattern", which helps to understand the orientation of the code for the reader. The other two sides of the block consist of alternating black and white dots, which indicate to the reader the size of the code. The code uses an error correction standard based on the Reed-Solomon algorithm. In case of damage to the code, this will restore up to 30% of useful information.

The main advantage of this variety of two-dimensional codes is its ultra-small size. With the DataMatrix, you can fit 50 characters of information into an area of ​​two square millimeters. At the same time, the code can be applied to the surface in a huge number of ways: this is inkjet printing, and engraving, and laser, and much more. In addition, the code has two possible shapes: a square and a rectangle. This allows even more efficient use of the area available for code placement.

All this makes DataMatix an excellent code for marking small objects, such as microchips. And that is why Data Matrix is ​​very actively used in industry. In particular, it is actively used by such large companies as Intel, AMD, BMW, Mercedes Benz, Siemens, Philips, NASA, Vodaphoone. In many countries, it is also used to sort mail, but I don’t know how this is in Russia. However, slowly it begins to appear with us. For example, the current sick leave format provides a special field for placing the Data Matrix code:

“To simplify the procedure for machine processing of data from the hospital, a field was added to the upper left corner of the form for imprinting a two-dimensional barcode in the Data Matrix format containing the same information as the leaflet itself, and this barcode must be able to be imprinted to the previously completed form separately, even if the form has already been folded several times”

Information taken from the FSS website. Of course, while the presence of such a code is not mandatory, but in the future the situation may change.


While the DataMatrix is ​​a firm favorite in the industry, another type of 2D barcode, the QR code, is far more common in everyday life.

QR code

Site generator– http://qrcc.ru/generator.php
Scanner program– Barcode Scanner

QR code is another kind of matrix code. Its name comes from the English "Quick Response" - "Quick Response". It was created by Denso-Wave in 1994 in Japan. And it is in Japan that it is most widely used. According to surveys, more than half of all mobile phone users in this country use it. This is primarily due to the fact that, unlike many competitors, he understands kana characters.

The name "QR Code" itself is a registered trademark of Denso Wave Incorporated. However, its use is free for both individuals and legal entities and is not subject to any licenses.

Code sizes can vary quite widely: from 11 modules in the Micro QR (M1) version to 177×177 modules in Version 40 QR code. As far as I know, there are no official standards for QR codes. Below are examples of QR codes of different versions, taken from Wikipedia.



As you can see, any QR code contains several required elements. First of all, these are three large "squares" surrounded by empty space. It is by them that the scanner program determines the position of the code and corrects the distortion of perspective. In addition, the code contains another smaller "square". It serves to determine the orientation of service areas. It is worth noting that the Micro QR version uses only one positioning mark. Like many other barcodes, a QR code requires free space around the code itself. For the full version of the code, it is 4 modules, for the micro version - two modules.

As in DataMatrix, the QR code uses an error correction method based on the Reed-Solomon algorithm. This makes it easy to read even a damaged or dirty QR code. There are four levels of error correction. They differ in the amount of information available for recovery - L (7%), M (15%), Q (25%), H (30%). Thanks to this “margin of safety”, you can place an arbitrary image or text on the QR code. And if the service areas are not affected, the code will still remain readable. True, it should be understood that in this case, the further possibility of error correction greatly decreases.

You can read more about marking QR codes on the website eng. Wikipedia. In addition, on habrahabr.ru about how you can manually read the QR code

QR codes have quite a few uses. First of all, they are very actively used in advertising and marketing. Starting from a banal link to a commercial posted on a billboard and ending with entire interactive stands. For example, in the video below you can see the Tesco booth located in the subway of South Korea.


With the help of a mobile phone, people can order the right product on the go, which will be delivered to them by a courier just in time for their arrival home. Such interactive stands allowed the company to increase profits from the delivery of goods by 130%.


I wonder how much sales have increased? =)

QR codes are no less widespread in tourism. For example, QR codes are increasingly placed on tourist sites. In the simplest case, such code will contain a short help about the object in different languages ​​or a link to Wikipedia. But there are more interesting options - for example, by reading the QR code, you can see what this object looked like 100 years ago. An example is the city of Lviv, where more than a hundred tourist sites are marked with QR codes. Information is available, for example, on this site. Similar solutions are often used in museums. One click - and you are on a web page containing all the information about the exhibit you are interested in.

Separately, I want to note one very original solution, in which by scanning the same QR code, each user will automatically get to the article in their native language. This was made possible thanks to the QRpedia project. You can read more about it here: http://ru.wikipedia.org/wiki/QRpedia

QR codes can be increasingly encountered when issuing tickets. This year, both Russia and Ukraine were going to introduce QR codes on railway tickets. This will make it possible to order a ticket via the Internet and simply print the QR code (or simply open it on the screen of a mobile phone) to pass through the turnstile or to present it to the conductor. Unfortunately, I don’t know if such a system is already working in Russian Railways, but I can say for sure that this is exactly how things are in AeroExpress. I spent several minutes ordering a ticket via the Internet, after which I didn’t even have to print it - the turnstile successfully read the code from the phone screen. True, the code there is not used by QR, but rather by PDF417.

There are hundreds of applications of QR codes, they are increasingly beginning to penetrate into our daily lives. For example, just the other day, for the first time, I saw a business card with a QR code “live”. And it turned out to be a really very convenient thing, which eliminates the need to enter all the contact data manually. It is enough to scan the QR code and all contact data in your phone: first name, last name, company, position, e-mail, work and mobile phones. I don’t know how such business cards will take root, but, in my opinion, the idea is excellent. Of course, the ideas of using QR codes do not end there. There are many other options - tattoos with a QR code containing a link to a page in the social. networks, key rings with a QR code, in which the name and phone number of the owner are encrypted, a QR code with a link to an audio congratulation on a gift ... The use of QR codes is well illustrated.

A two-dimensional code of this format is beginning to be used in Sberbank (Source - http://www.arendamest.ru/qr-kod-v-terminalach-sberbanka)

Why has it become so popular against the backdrop of the already fairly common Data Matrix? I do not know the exact answer to this question, but it seems to me that the main thing is its recognition. Unlike the somewhat faceless Data Matrix, it has its own face, looks more interesting, and is easier to draw the attention of potential users to. Considering that it is most often used in marketing, this turned out to be very important. And the strengths of the Data Matrix (smaller size, ISO standard) here, on the contrary, practically do not matter.

Finally, I will cite the data of a survey conducted in 2012 by J'son & Partners Consulting, SMARTEST and WapStart in Russia. According to him, a third of respondents (33%) are aware of QR codes - they know and understand how this technology can be used. 59% do not know about QR codes, and 8% are misinformed (they make mistakes in knowing the technology). 23% of users have already scanned QR codes with their phone, and almost half of them (48%) do it constantly or have done such manipulations many times. Most of the users of QR codes (84%) went to the website after reading them; one third (33%) were able to read a person's contact details and save them to their phone; 28% received advertising; 21% - other content (music, pictures, presentations, etc.) and 8% - video. Only 6% indicated that QR technology helped them check in for a flight or event.

As we can see, although in Russia QR codes are not yet as widespread as in many other countries, nevertheless, they are gradually becoming popular in our country.

Aztec Code

Site generator— http://barcode.tec-it.com/
Scanner program Accusoft Barcode Scanner

The code structure consists of the following elements: "target", orientation elements, anchor grid, data layers. The scanner program recognizes the code by the presence of a “target”, determines its center and corners. Next, the program calculates the distance between the corners of the target and their angles of inclination. Based on this data, the angle of inclination and rotation of the code relative to the phone's camera is calculated. It is worth noting that the code can be recognized not only with large distortions from the tilt angle and orientation of the camera, but even with mirror reflection.

More information about the Aztec Code decoding algorithm can be found on the odamis.ru website at the following link. As in the case of the QR code, Aztec has its own compact version.

Like DataMatrix, Aztec code can be used where the area for coding is very limited. This is primarily due to the fact that it does not require free space around the code. But, unlike DataMatrix, Aztec code can only be square. The side of the square contains from 15 to 151 modules. Code can be combined into blocks. Of course, like other types of codes, Aztec code supports data correction according to the Reed-Solomon principle. At the same time, it allows you to configure data redundancy from 5% to 95%.

In many countries, this code is used by railway companies in electronic tickets. In addition, it has been selected by the International Air Transport Association for e-ticketing. In particular, according to Wikipedia, it is used on electronic tickets of the Russian airline S7 Airlines. Below is a quote from off. site s7.ru:

“At the airport of your departure, there must be a special device that recognizes the 2D barcode of the mobile boarding pass. It is located before entering the security control area and works as follows: it reads the mobile boarding pass's 2D barcode information from your phone's screen, and then prints the boarding pass on paper.

Unfortunately, the type of 2D barcode is not specified in this message, but I think that Wikipedia was not mistaken.

Microsoft tag (High Capacity Color Barcode - HCCB)

Site generator - http://tag.microsoft.com
Scanner - Microsoft Tag

This barcode was specially developed by Microsoft for mobile cameras. This provides a number of advantages when scanning and decoding code. For example, the code can be decrypted even if it is out of focus, which is very important for simple phone cameras without autofocus.


Microsoft Tag is quite different from most of its counterparts. The first thing that immediately catches your eye: unlike QR, Data Matrix and other monochrome codes, it can be in color. In addition to white, three more colors are used: Yellow, Magenta, Cyan. This choice of colors avoids decoding errors due to poor color reproduction of the CMYK printer. Additional colors allow you to "shove" more information into the code without changing its size. However, the barcode also has a black and white version.


The second, no less important difference: the barcode does not contain the data itself, but only a link to them (13 bytes + 1 control). The data itself is stored on a Microsoft server. The obvious disadvantage of this solution is that it is impossible to use such a code without access to the Internet. On the other hand, it also provides additional opportunities: you can edit the information “attached” to the code at any time, you can find out the number of code readings, you can set the code validity period.

In addition, Microsoft Tag has great customization options. In a barcode of this format, all information is encoded in colored dots in the centers of triangles. The rest of the field can be anything. This allows you to make the barcode truly unique. The main thing is not to overdo it, otherwise no one except you will understand at all that this is a barcode.

. . . . . .

Microsoft Tag is much less common than its counterparts. However, in some places it is gradually beginning to come into use. For example, in Tatarstan, according to the news, the government has obliged the owners of the tourist and sports facilities of the Universiade to post such barcodes to access the relevant Internet sites. The news slipped, in particular, on this site. In addition, using the same codes, you can pay for state. services.

This technique left me with mixed feelings. When the mention of the Microsoft Tag first caught my eye, I brushed it off without going into details. A barcode that requires internet access to decode? This is not for Russian realities. Yes, and printing a color code is more difficult than black and white. Initially, it seemed to me that with such shortcomings, all the advantages of this code no longer matter. But let's think for a moment, what kind of information is most often encoded in a 2D barcode? In most cases, this is a link to a resource on the Internet. It can be anything: a company website, a commercial, an article about a historical object, but in any case, without Internet access, this link has no practical value. And here Microsoft Tag looks like a very winning option. Information can be changed or updated at any time without changing the code itself, collect view statistics, etc. Microsoft Tag certainly has potential, but whether Microsoft can realize it is an open question.

Looking ahead

In the beginning, linear barcodes appeared. Then 2D. What can await us in the future?

The idea of ​​the MIT Media Lab, bokode, looks very interesting. The name comes from the words bokeh and barcode. The prototype was shown back in 2009. The diameter of the label of this code was only a few square millimeters. The tag itself consists of an LED with a special mask and a special lens. Information enters the reader in the form of streams of light passing through the mask on the LED.
Such a code is capable of transmitting thousands of times more information than linear barcodes. In addition, it can be read from a distance of several meters (the theoretical limit is 20 meters).
More information can be found on the BBC website or by watching a video from the MIT Media Lab itself:


PRACTICE

Site-generator http://qrcc.ru

One of the popular 2D barcode generators. Allows you to create QR, Micro QR and DataMatrix codes. The interface of the site is intuitive, and I think it makes no sense to dwell on it in detail. At the top you can select the type of code. In the left column, specify the type of content. At the bottom, you can select additional options: the icon that will be displayed on the code, the text above and below the code, the colors of the text and the code itself.


Unlike many similar sites, qrcc.ru supports a large number of different types of data. Of course, data of any type can simply be encoded as plain text. But in this case, the smartphone will not be able to automatically recognize their type and understand what to do with them. As an example, I will give two codes with the same text.




The site allows you to generate data of the following types:
Business card (VCARD)- after scanning the code, the user will have the opportunity to create a contact with all the data in the phone book in one click.

Free text- just a data set, the scanner program will respond to it in a standard way

Phone call- after scanning the code, the program will offer to save the number you entered in the address book or call it.

SMS message- the scanner program will prompt the user to send the text specified by him, the number specified by him in the form of SMS or MMS messages

E-mail address- the user will be able to either send a letter to this address, or add it to the phone book. The same will happen if you encode the e-mail address in the usual way, as "arbitrary text".

Email message- contains the fields "E-mail recipient", "Subject" and "Text". Prompts the user to send the message they entered to the appropriate address.

Scheduled Event(VCALENDAR)- allows you to enter the name, start and end of the event. When scanning such a code, it will be possible to import this event into the calendar.

WIFI— allows you to enter the network SSID, password, and encryption type. After scanning such a code, the smartphone will prompt you to connect to this network.

Site-generator http://barcode.tec-it.com

Another good generator site. Allows you to create dozens of different types of codes, both linear and two-dimensional. It has a more confusing interface, but offers more options.


At the top of the site, you must select the type of code. Offers the following options:

1D codes. This includes 12 types of linear barcodes such as Code-128, Code-11 and others. Each code specifies the valid data type (numbers only, full ASCII, etc.). By opening the "additional barcode options" section, you can configure such parameters as code color, orientation, silence zone (space around the barcode).

2D codes. This includes codes such as QR, DataMatrix, Aztec, Codablock-F, PDF417, MaxiCode, MicroPDF417, Micro QR. The code settings are similar to the previous category, but in the "additional parameters" the "error correction" option has been added (so far it is supported only by the QR code). It allows you to manually specify the level of correction - L, M, Q, H

Mobile Tag- like http://qrcc.ru , allows you to create codes for mobile phones with different data types. Allows you to create three types of codes - QR, DataMatrix, Aztec. Supports several new types of codes, such as sending a tweet, "like" on Facebook, searching for an application in Android Market and others.

Then there are many more different categories of line codes: UAN\UPC(used on products in stores), ISBN(books and other printed matter), postal codes, etc. At the end of the list are " business cards" (supported by QR and DataMatrix), " Developments» (also QR and DataMatrix), WI-FI codes(QR and DataMatrix) - in these paragraphs everything is similar to qrcc.ru

Site generator http://tag.microsoft.com

tag.microsoft.com is noticeably different from the previous resources we reviewed. And first of all, this is due to the features of the Microsoft Tag format. The site itself contains a lot of reference material both on the features of this code format and on working with the generator itself. Unfortunately, the information is only available in English.

The site requires a Microsoft account. If you don't have it, you will have to register. Next, go to "My Tag" - "Tag manager". To create a new tag, select "Create a tag" in the top left corner of the manager.


Tag Title- the name of the label, which will be displayed under the barcode itself in the "history" of the scanner program

Tag type— label type. The following types of tags are supported: URL (link), App Download (application download, allows you to set separate download links for each platform), Free Text (arbitrary text, up to 1000 characters), vCard (you can either download a ready-made vCard or enter data contact manually), Dialer (telephone number entry)

Tag Notes— label description, up to 200 characters long. The description is displayed only on the site in the manager itself. The user will not see it.

Upload Thumbnail— label sketch upload, recommended size — 200 x 200, JPEG, GIF, PNG formats

start date- the date from which the label will start working

end date— end date of the label. You can choose the option "No End Date"

Data entry field— depends on the label type you choose.

After entering all the data, save the label by clicking on the "Save" button. The created label is now displayed in the manager. If necessary, it can be edited or deleted at any time. In addition, you can always see a graph of the number of views. Now download the created label by clicking on the blue “Download” arrow on the right.

Before loading a tag, you must select the encoding format for it. Available options: Tag Barcode(standard Microsoft Tag with triangle pattern), Custom Tag Barcode(Microsoft Tag, on which only the dots themselves are marked, in which information is encoded), QR code, NFC URL. Here you can also choose the file format and the size of the code itself. If you use Microsoft Tag, you can choose its monochrome version.

When scanning a QR code with a regular scanner program, a simple link like tagr.com/xxx will be displayed. To access the information itself, you need to open it in a browser. When scanning the code with the "native" Microsoft Tag program, the data will be downloaded from the MS server automatically. In this case, additional information will also be displayed, such as the name of the tag, the picture of the tag in the "history", etc. In general, the use of a QR code in this case is completely inappropriate.

You can read more about scanning Microsoft Tag codes in the description of the scanner itself. I will only say a few words about the Custom Tag Barcode format. As I already wrote, the Microsoft Tag format has a huge potential for customization. In fact, the code can be recolored as you like, the main thing is not to change the color of the dots that carry information and not to climb into the service areas. In this case, the points themselves can be part of the picture, they do not need to be somehow distinguished from the background surrounding them.

The easiest way is to open the downloaded file in Photoshop or any other editor that can work with layers. We don’t touch the dotted layer itself, just create another one under it and do whatever we want with it. You can learn more about Microsoft Tag customization (eng.)

Software scanners

Barcode Scanner

Supported 2D code formats: QR, DataMatrix
The program is free. It has a paid version with support for additional formats.

I would like to start with the classics of the genre - the Barcode Scanner program (Zxing from Google).
Some people think this scanner is too simple, but I personally really like it. The program has everything you need to perform its main function and no extra "bells and whistles". A sort of Linux way. Some people like this approach, some don't.

Accusoft Barcode Scanner

Supported 2D code formats: QR, DataMatrix, Aztec and PDF417

As practice has shown, many scanners in Play.Market are based on Barcode Scanner, or rather Zxing from Google - . Therefore, they mostly have a very similar interface and functionality. An example is Accusoft Barcode Scanner, which is essentially a clone of Barcode Scanner. The main difference is additional support for Aztec and PDF417 codes.

QR Droid

It was this program that was mentioned in a recent article by Vitaly Buzdalov. It also uses the Zxing libraries, but has more functionality. For example, it is possible to preview links, edit SMS from the program itself, assign default actions for different types of codes, etc.


Whether it is necessary or not, everyone decides for himself. In addition, the program has a fairly functional code generator.




In addition to the standard actions for generating and reading codes, the program offers a number of other useful functions. For example, through it you can quickly create a short link. This can be very useful in order to avoid unnecessary "bloat" of the QR code. In addition, you will always have the opportunity to see the statistics of clicks on such a link. Another example: you can upload an image to the Internet and immediately generate a link to it in the form of a QR code.

Microsoft Tag

A scanner primarily designed to work with Microsoft Tag and QR codes from tag.microsoft.com. With ordinary QR codes, the program works much worse. As an example, you can look at the following screenshot, which shows the result of decoding a QR code like "sms".


While a regular scanner offers to send a text message, the Microsoft Tag scanner simply displays the entire set of encoded data.

At the top of the program window is the "Scan" button, in the center - a list of scan history marks. Tags are represented as icons that have been assigned by the author of the code. The name of the tag is also displayed here. Ordinary QR codes that do not have names and icons are not displayed in the list. Of course, tags from the history list can be reopened.


The screenshot below will show the result of scanning codes with encoded text and with an encoded link to Android.MR




findings

Of course, it is impossible to talk about all types of barcodes, programs for reading them and resources within the framework of one article. Therefore, I have mentioned only some of them, which, in my opinion, are the most relevant.

In the comments to the last article about QR codes, some readers expressed the opinion that due to the advent of NFC, two-dimensional barcodes will soon disappear. It seems to me that this will not happen. These are two different technologies, the use of which overlaps only partially. NFC is more convenient for transferring information. Sometimes it is used for this directly, sometimes it is used only to establish a connection using a faster protocol. But printing an NFC tag at home will be problematic for a very long time. Because of this, NFC is unlikely to be used, say, on e-tickets. Yes, and posting on ads is futile - in order to count it, everyone will be forced to come close to such an ad, which is not always possible. Of course, if you wish, you can come up with and implement any scenario. The only question is, is it worth it?

A data matrix a two-dimensional matrix barcode containing black and white cells arranged in a square or rectangular array. Both text and arbitrary data can be encoded.
The amount of encoded data depends on the size of the symbol used. The symbol contains error correction codes: even if the symbol is partially damaged, it can be read. The Data Matrix symbol can store up to 2335 alphanumeric characters.

Note: This symbology does not display human-readable text.

data matrix symbols can encode text in several different ways. Use the Encoding combo box to define the most appropriate encoding algorithm for the text you want to encode:

  • (Mixed): The default value. Encoding data using a combination of all of the modes below, depending on the type of data found. This mode usually gives the best results.
  • Ascii: Specifies the encoding for all 256 characters of the standard ASCII table. Best result for numeric characters and ASCII characters from 0 to 127.
  • C40: Specifies the encoding for numbers, letters, and a few special characters. Best result for digits and alphanumeric codes containing only uppercase letters.
  • Text: Specifies the encoding for numbers, letters, and a few special characters. Best result for digits and alphanumeric codes containing only lowercase letters.
  • X12: Specifies the character encoding from the ANSI X12 set.
  • Edifact: Sets the encoding for characters with ASCII codes in the range 32 to 94. The encoding is deprecated, added for compatibility.
  • Base 256: A special encoding for arbitrary data in the range of 0 to 255. The encoding algorithm allows you to encode any value from 0x00 to 0xFF (decimal 0 ~ 255). To use this encoding, you must enter a string containing two-digit hexadecimal values ​​separated by a space, for example: 32 FA 56 E8 12 ... etc.