Two-dimensional code principle-appetizer Tip

Source: Internet
Author: User

What is the principle of QR code? Do not know from when, our life suddenly is full of two-dimensional code, look at the page to sweep two-dimensional code, plus friends to sweep the two-dimensional code, now even downstairs sell strawberry Big Uncle all support sweep code to pay, then, you have not thought, this very strange long two-dimensional code, in the end how to come? What is the principle of it? You'll know when you're finished.

In fact, before introducing the principle of two-dimensional code you may have guessed that the two-dimensional code is to translate the information into black and white squares, and then fill in the big box, which is a bit like the middle school test with the answer card, is to turn information into a machine can scan the pattern, a second can know how many points you have. Of course, the principle of two-dimensional code and answer card is not quite the same, this will be discussed later.

Let's start with the QR code brother----barcode. That is, the time-out cashier sweep the black and white bar, the computer in the horizontal direction to identify the uneven thickness of black and white, you can find the information hidden in the product number, compared to the only one dimension to carry information on the bar code, "Two-dimensional code" in the horizontal vertical two dimensions are carrying information, also made a block-like appearance Barcode and QR Code this pair of good brothers, in fact, is to give numbers, letters, symbols and other characters in a dress, they dressed up as a mobile phone camera can be recognized by the black and white bar or block. So, the most critical question is, how do these characters turn into this two-dimensional code pattern?

This refers to the "binary" of a great invention of human epoch-making significance. The numbers we normally use. characters, characters and other characters, although the wind is completely different, but the wit of the human invention of a method, so that they can be unified into 0 and 1 composed of binary digital sequence, the process of the conversion is called coding, there are several sets of universal coding rules, we use an example today to feel, Coding is going on. For example, AB, a two-letter character, according to the code rules, each individual English letter has a unique decimal number corresponding to it, and a string like AB to the corresponding number on the basis of the operation, and the result of the operation is converted to binary, it becomes "000111001101" This number, oh yes, the entire computer and Internet civilization is based on this binary encoding, you now see the video, whether in your computer or mobile phone, in fact, is just a bunch of 0 and 1.

We go back to the generation principle of the two-dimensional code, after the characters become only 0 and 1 of the sequence of numbers, in a series of optimization algorithm (here self-brain to complement a series of optimization algorithms), the final binary encoding is obtained. In the last string of code, a 0 corresponds to a ' white small square ', a 1 corresponding to a ' small black square ', we put these small squares into a group of 8 into a large block, this is a complete, can be recognized by the mobile phone camera QR code pattern.

If you want to ask why all the two-dimensional code angle has 3 large squares, in fact, these 3 exactly the same box is used to give the camera positioning, do not believe you sweep, is not whether the sweep, reverse sweep or oblique sweep results are the same?

This article is from the "Potato" blog, please be sure to keep this source http://zhaoyulin.blog.51cto.com/11665101/1787665

Two-dimensional code principle-appetizer Tip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.