Hongke Sharing | Revealing the secrets of the AR world: from the origin of QR codes to the wonderful integration of data recognition and pose technology!

Introduction: To explore the magical world of AR, we will start with the birth of QR codes. In this ocean of technology, how do QR codes help AR achieve data acquisition and pose recognition? Let us uncover this mysterious veil together!

1. The origin of QR code

QR code is a technology that stores data in graphics and was invented by Masahiro Hara in 1994. There is another interesting anecdote here. Teng Hongyuan gave up applying for a patent after inventing the QR code. He said this: "This kind of technology can actually be realized by just looking for a network tool, so I won't accept such a simple thing." Patent fees." This is also one of the reasons why QR codes are widely used.


In 1999, Hiroshi Kato and others took the lead in linking AR technology with QR codes. Combining QR code technology, they developed ARToolKit, an AR tool that is still widely used today. Let’s switch back to the topic and talk about how QR codes are used in AR.

2. Working principle of QR code

QR codes can provide two pieces of information for AR: ID and pose. Let us introduce them one by one next.

1.ID identification

First, we need to agree on the size of the QR code:
There are 40 sizes of QR codes, which is the number of small squares in each row/column of the QR code. In the official documentation, the size is named Version. There is a linear relationship between size and Version: Version 1 is a 21×21 matrix, Version 2 is a 25×25 matrix, and the size increases by 4 for each additional Version. Next, we will divide the area for the QR code and encode it:
 Each part of the QR code has its own role and can basically be divided into three types: positioning, functional data, and data content. Section:

1)Localization area:

Positioning pattern: used to mark the size of the QR code rectangle; three positioning patterns can be used to identify and determine the position and direction of a QR code rectangle

Positioning pattern separator: Use a white border to distinguish the positioning pattern from other areas;

Correction graphics: Only required in Version 2 and above, used to correct the deformation of the QR code

2)functional number position

Format information: exists in all sizes and stores formatted data

Version information: For Version 7 and above, two 3×6 areas need to be reserved to store part of the version information;

3)Data content: The remaining part stores the binary data content, for example, black square represents 1, white square represents 0, in addition The data content also includes completion characters, error correction codes, terminators, etc.

Please check here

Input image, capture image via camera

Image binarization, the image is binarized through graphics algorithm, that is, the image is turned into a black and white image.

Extract a continuous region with a certain area

Extract the outline of a rectangular area

Analyze the pattern inside the rectangular area and identify the logo content
From this, the camera can "recognize" the QR code and the content of the QR code, and convert the QR code to The IDs in the functional data are extracted. These IDs can be websites, a login application, or strings that activate a certain function of the device

2.Pose recognition

In addition, QR codes can also help AR devices perform pose recognition. What is pose recognition? It is to let the device know the distance and relative posture relationship between itself and the QR code, that is, how far away is the QR code from me? Does the QR code tilt left and right, or tilt forward and backward?
The pose recognition process is similar to ID recognition, but the difference is that after extracting the outline of each area, the most needed information for pose recognition is the vertices of the four corners of the QR code area. Coordinates (Xi​,Yi​).

First, we use a schematic diagram to represent the coordinate system of the camera, the image coordinate system (the coordinate system of the plane figure captured by the camera), and the identification coordinate system (the coordinate system where the QR code is located in reality)

The points of the image coordinate system that we captured through the camera (Xi​,Yi a>​), and the camera’s built-in correction matrixK, the rotation transformation matrix can be obtainedR and translation vectort, where, R represents the rotation of the QR code relative to the camera, t represents the translation of the QR code relative to the camera
The approximate solution process is as follows:

Combining the four formulas obtained from the four vertices of the QR code in the image coordinate system, we can obtain the matrixR and t to obtain the rotational orientation and translational orientation of the QR code, which can also be used to implement various AR applications.

3. Various QR codes

The above is a brief introduction to the working principle of QR codes. In real life, the forms of QR codes are also constantly changing. In addition to the QR codes we see every day, there are now anti-blocking QR codes and infrared invisible QR codes. QR codes, random dot QR codes, microlens sheet QR codes, etc. These new QR codes can also be combined with AR to help us better interact with objects in the real world.

references

[1]: Copyright statement: This article is an original article by CSDN blogger "Qi Xiaoxia" and follows the CC 4.0 BY-SA copyright agreement. Please attach the original source link and this statement when reprinting. Original link: QR code generation principle and parsing code 

[2]: "The Definitive Guide to Augmented Reality (AR) Technology"

Guess you like

Origin blog.csdn.net/hongkearvr/article/details/134631196