CN105760803B - Two-dimensional matrix code decoding method and describes the coding picture cards - Google Patents

Two-dimensional matrix code decoding method and describes the coding picture cards Download PDF

Info

Publication number
CN105760803B
CN105760803B CN201610073104.4A CN201610073104A CN105760803B CN 105760803 B CN105760803 B CN 105760803B CN 201610073104 A CN201610073104 A CN 201610073104A CN 105760803 B CN105760803 B CN 105760803B
Authority
CN
China
Prior art keywords
data
matrix
decoding
code
image
Prior art date
Application number
CN201610073104.4A
Other languages
Chinese (zh)
Other versions
CN105760803A (en
Inventor
刘新宇
Original Assignee
湖南盛世龙腾网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 湖南盛世龙腾网络科技有限公司 filed Critical 湖南盛世龙腾网络科技有限公司
Priority to CN201610073104.4A priority Critical patent/CN105760803B/en
Publication of CN105760803A publication Critical patent/CN105760803A/en
Application granted granted Critical
Publication of CN105760803B publication Critical patent/CN105760803B/en

Links

Abstract

本发明提供了种二维矩阵码的解码方法,包括步骤:获得数据矩阵及旋转数据矩阵后的三组数据值,确定三组数据值的CRC校验是否致,取唯相等的数据值,作为解码结果。 The present invention provides a method of decoding a two-dimensional matrix code types, comprising the steps of: three sets of data values ​​and a rotation matrix data obtained after the data matrix, the CRC check to determine whether the three sets of data values ​​induced, taken equal to the data value CD, as decoding results. 本发明解码方法在现有矩形码解码的基础上,新增了方向要素,通过四个方向的CRC校验,选出唯正确的数据,使得用户在解码时无需关注卡牌上的卡牌方向,使用更为方便。 The present invention, in the decoding method of the conventional rectangular code decoding based on the new direction of the elements, the four directions by the CRC check, the only correct data is selected, so that the user does not focus on the direction of card at the time of decoding cards more convenient to use.

Description

二维矩阵码的解码方法以及记载有编码图片的卡牌 Two-dimensional matrix code decoding method and describes the coding picture cards

技术领域 FIELD

[0001] 本发明涉及图形处理和OpenCV (Open Source Computer Vision Library,开源计算机视觉库)识别的技术领域,特别地,涉及一种二维矩阵码的编码方法以及记载有编码图片的卡牌。 [0001] Technical Field The present disclosure relates to graphics processing and OpenCV (Open Source Computer Vision Library, open-source Computer Vision Library) identifying, in particular, to a two-dimensional matrix code encoding method, and discloses a coded picture cards.

背景技术 Background technique

[0002] 计算机视觉是一门研究如何使机器“看”的科学,更进一步的说,指用摄影机和电脑代替人眼对目标进行识别、跟踪和测量等机器视觉,并进一步做图形处理,使图片被处理成为更适合人眼观察或传送给仪器检测的图像。 [0002] Computer vision is the study of how a machine "look" of science, further said, referring to the human eye for target identification, tracking and measurement and machine vision with a camera instead of a computer, and the graphics do further processing, the image was processed to a more suitable for the human eye or an image transmitted to the detection equipment. 相关学科包括图像处理、模式识别、图像识另IJ、景物分析、图象理解等,还包括空间形状的描述、几何建模等过程。 Related disciplines including image processing, pattern recognition, image recognition of another IJ, scene analysis, image understanding, etc., described in further comprising a spatial shape, geometric modeling process. 计算机视觉的研究对象主要是映射到单幅或多幅图像上的三维场景,例如三维场景的重建。 Computer Vision research object primarily mapped to three-dimensional scene on a single or multiple images, for example, the reconstructed three-dimensional scene.

[0003] 其中,增强现实(Augmented Reality,AR)是一种实时地计算摄影机影像的位置及角度并加上相应图像的技术,这种技术的目标是在屏幕上把虚拟世界套在现实世界并进行互动,使得真实环境和虚拟物体实时叠加后形成的虚拟世界被人类感官所感知,从而达到超越现实的感官体验,在数码游戏领域运用广泛。 [0003] where Augmented Reality (Augmented Reality, AR) is a real-time camera image to calculate the position and angle of the image with the appropriate technology, the goal of this technology is on the screen to set the virtual world and the real world after the formation of the virtual world to interact, so that the real environment and virtual objects in real time superimposed be perceived by the human senses, so as to achieve beyond the reality of sensory experience, widely used in digital gaming.

[0004] AR技术包含了多媒体、三维建模、实时视频显示及控制、多传感器融合、实时跟踪及注册、场景融合等新技术与新手段。 [0004] AR technology includes multimedia, 3D modeling, real-time video display and control, sensor fusion, real-time tracking and registration, scene fusion of new technologies and new means. 而传统AR卡牌产品,仅单纯的实现将实物卡牌与虚拟模型结合的功能,再辅以简单的网络激活与单机交互的玩法。 The traditional AR card products, will achieve only a simple physical model combined with the virtual card functionality, supplemented by simple gameplay network activation and single interaction. 因为AR的核心部分是图像分析系统,而当前市场上的产品多采用高通的Vuforia接口实现。 Because the core of the AR is an image analysis system, and the current products on the market use more Vuforia interface Qualcomm. 例如央数文化(上海)股份有限公司的梦境盒子、3D增强现实三维互动学习机、口袋动物立体学习卡等产品;广州创幻数码科技有限公司的超次元系列产品。 For example, the number of central culture (Shanghai) Co., Ltd. dream box, 3D augmented reality three-dimensional interactive learning, learning cards and other three-dimensional pocket animal products; Guangzhou, Magic Digital Technology Co., Ltd. of junior yuan products. 其中,每张卡牌必须经过高通的图像识别网站转换成识别码后才能使用,操作繁琐;超次元系列产品在激活卡牌或有交互操作时,用户又需要重新扫描卡牌上的二维码,使得使用过程经常被打断,用户体验非常差。 Among them, each card must be converted to use after high-pass image recognition to identify a site code, complicated operation; junior yuan products when activating cards or interactive operation, the user and the need to re-scan the two-dimensional code on the card , making use of the process often interrupted, the user experience is very bad. 并且,高通Vuforia解决方案基于图像识别,无法读取数据,并且在一帧中不能识别两个相同的标示图像,影响识别速度。 And Qualcomm Vuforia solutions based on image recognition, data can not be read, and does not recognize two identical reference images in one frame, affect the recognition rate.

发明内容 SUMMARY

[0005] 本发明目的在于提供一种二维矩阵码的解码方法以及记载有编码图片的卡牌,以解决客户端需辨别卡牌方向才能识别卡牌的技术问题,并且可预先设置角色形象在游戏界面展示形象的特定方向。 [0005] The object of the present invention to provide a method for decoding a two-dimensional matrix code and card code describes a picture, to solve the technical problem the client needs to identify the direction of card identification card, and the role of the image may be set in advance the game interface shows the image of a particular direction.

[0006] 为实现上述目的,本发明提供了一种二维矩阵码的解码方法,包括步骤: [0006] To achieve the above object, the present invention provides a method of decoding a two-dimensional matrix code, comprising the steps of:

[0007] A、获得数据矩阵 [0007] A, to obtain a data matrix

[0008] 将数据矩阵的对应图形压缩到(n+2) X (n+2)像素,若图片上下左右四边的1个单位像素均为黑色,则按照图片白色像素为1、黑色像素为〇的原则,将图片还原为nXn数据矩阵 [0008] The matrix corresponding to the pattern data is compressed to (n + 2) X (n + 2) pixels, if the image around the four sides of a unit of vertical pixels are black, the white pixels in accordance with image 1, a black pixel is square principle, will restore nXn picture data matrix

Figure CN105760803BD00031

[0009] Β、获得数据矩阵旋转后的数据值 [0009] Β, data values ​​obtained rotation matrix data

[0010] 将数据矩阵. [0010] The data matrix.

Figure CN105760803BD00041

在同一平面内旋转三次,分别得到数据矩阵 Three times in the same rotating plane, respectively data matrix

Figure CN105760803BD00042

每次旋转的角度为90°; Each rotation angle of 90 °;

[0011]上述四个数据矩阵展开成数据形式,分别得到DVQ、DV1、DV2、DV3; [0011] The four data into expanded data matrix form, respectively DVQ, DV1, DV2, DV3;

[0012] C、CRC校验确定四个数据的正确性 [0012] C, CRC check to determine the correctness of the four data

[0013] 对〇仰、〇¥1、〇¥2、〇¥3四个数据的前乂位分别计算¥位0^校验值,然后比对上述四个数据的后Y位是否分别和计算值相等;Χ = η2-Υ,γ为8、16、32、64; [0013] The square Yang, ¥ billion. 1, 2 ¥ square, square ¥ qe. 3 four-bit data before calculate ¥ ^ 0 bit parity value, and then to the rear than the four-bit data Y, respectively, and whether the calculated the values ​​are equal; Χ = η2-Υ, γ is 8,16,32,64;

[0014] D、取唯一通过检验的数据,作为解码结果。 [0014] D, taking the only test data, as a decoding result.

[0015] 优选的,步骤D之后还包括: [0015] Preferably, after the step D further comprises:

[001 ό] 将Dvo、Dvi、DV2、DV3四个数据进行比对,取极值Dvf ; [001 ό] The Dvo, Dvi, DV2, DV3 four data comparison, Dvf extreme value;

[0017] 若在步骤D中,未在四个数据中找到唯一相等的数据,则将Dvf与曾经识别成功的码Dc进行二进制数据位匹配,设定两者之间的不同位数的个数小于m,则通过校验,取该Dw 作为解码结果,〇〈m〈n。 The number of [0017] When not found in four equal data unique data in step D, then once with Dvf successful identification code Dc binary data bits match, set the number of different bits between them less than m, then by checking, as to take the decoding result Dw, square <m <n.

[0018] 优选的,若码Dc已与虚拟物关联,则通过校验的Dw与同一虚拟物关联。 [0018] Preferably, if the code Dc is associated with the virtual object, the virtual object associated with the same check by Dw.

[0019] 优选的,所述极值为最大值或者最小值。 [0019] Preferably, the extremum is a maximum or minimum.

[0020] 优选的,在步骤A之前还包括: [0020] Preferably, before the step A further comprises:

[0021] Al、从视频中截取图片; [0021] Al, taken from the video image;

[0022] A2、对图片进行去色、二值化并反色处理; [0022] A2, to color the picture, and anti-color binarization process;

[0023] A3、获得图像中的封闭形状,在封闭形状中搜索四边形; [0023] A3, closed shape image obtained in the search for a closed quadrangular shape;

[0024] A4、四边形区域还原,获得数据矩阵的图形。 [0024] A4, quadrangular area reduction, to obtain pattern data matrix.

[0025] 优选的,每一幅编码图片与一个特定的卡牌角色形象关联。 [0025] Preferably, each one with a specific coded picture card image associated with the role.

[0026] 本申请还提供记载有根据上述的解码方法所针对的编码图片的卡牌,所述卡牌表面记载有编码图片,以及与所述编码图片所关联的角色形象、角色方向一致的图案;所述编码图片为数据矩阵的对应图形。 [0026] The present application discloses further provides the encoded image decoding method as described above for the card, the card surface describes a coded picture, as well as the role associated with the encoded image picture, a pattern consistent with the role of the direction ; the encoded image data corresponding matrix pattern.

[0027] 本发明具有以下有益效果: [0027] The present invention has the following advantages:

[0028] 本发明提供了一种无需在卡牌角色数据的编码上定义特定的方向识别,利用矩阵码解码过程中的特定规则(旋转数据矩阵获得四个数据矩阵,通过检验选出方向正确的数据矩阵数值),使用者通过数码终端上的常规图片识别,任意方向解码即可获取编码图片所对应的特定方向的卡牌角色形象。 [0028] The present invention provides a need to define a specific direction on the identification card coded character data, the use of a particular code rule matrix in the decoding process (the rotation matrix data obtained four data matrix, selected by checking the correct direction Numerical data matrix), the user can obtain the decoded image of the character card specific direction corresponding coded picture identified by a picture on a conventional digital terminal in any direction.

[0029] 也就是说,本发明解码方法在现有矩形码解码的基础上,新增了方向要素,通过四个方向的CRC校验,选出唯一正确的数据,使得用户在解码时无需关注卡牌上的卡牌方向, 使用更为方便。 [0029] That is, the decoding method of the present invention, in the conventional rectangular code decoding based on the new direction of the elements, the four directions by the CRC check, only correct data is selected, so that the user need not be concerned when decoding cards direction on the card, more convenient to use.

[0030] 并且,为让使用者更清晰地了解从卡牌编码图片上获得的角色形象,卡牌表面还记载了与编码图片所关联角色的形象、方向匹配的图形,给予所见即所得的用户体验。 [0030] and for allowing users to more clearly understand the role of the image obtained from the coded picture card, a card surface also describes the role associated with the coded picture image, graphic direction match, giving WYSIWYG user experience.

[0031] 除了上面所描述的目的、特征和优点之外,本发明还有其它的目的、特征和优点。 [0031] In addition to the above-described objects, features and advantages of the present invention as well as other objects, features and advantages. 下面将参照图,对本发明作进一步详细的说明。 Referring to FIG below, the present invention will be further described in detail.

附图说明 BRIEF DESCRIPTION

[0032] 构成本申请的一部分的附图用来提供对本发明的进一步理解,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。 [0032] The drawings constitute a part of this application are intended to provide further understanding of the invention, exemplary embodiments of the present invention are used to explain the present invention without unduly limiting the present invention. 在附图中: In the drawings:

[0033] 图1是本发明优选实施例的编码流程示意图; [0033] FIG. 1 is a schematic of a preferred embodiment of the encoding process of the present invention;

[0034] 图2是本发明优选实施例的编码图片示意图。 [0034] FIG. 2 is a schematic of a preferred embodiment of the coded picture present invention.

具体实施方式 Detailed ways

[0035] 以下结合附图对本发明的实施例进行详细说明,但是本发明可以根据权利要求限定和覆盖的多种不同方式实施。 [0035] The following embodiments in conjunction with the accompanying drawings of embodiments of the present invention will be described in detail, but the present invention can be a variety of different ways as defined and covered by the claims embodiment.

[0036] 参见图1,本发明提供了一种二维矩阵码的解码方法,包括步骤: [0036] Referring to Figure 1, the present invention provides a method of decoding a two-dimensional matrix code, comprising the steps of:

[0037] A、获得数据矩阵 [0037] A, to obtain a data matrix

[0038] 将数据矩阵的图形压缩到(n+2) X (n+2)像素,判断图片上下左右四边的1个单位像素是否为黑色,如果均为黑色则分析图片中间的nXn像素;按照图片白色像素为1、黑色像素为〇的原则,将图片还原为η X η数据矩阵 [0038] The pattern data is compressed to a matrix (n + 2) X (n + 2) pixels, determines the vertical and horizontal picture unit of the four sides of a pixel is black, if the middle of the picture are black pixels nXn the analysis; according to 1 white pixel image, the black square pixel principle, to restore a picture data matrix η X η

Figure CN105760803BD00051

[0039] 例如,在η = 8时,将图2中的图片压缩至IOX 10像素,判断图片上下左右四边的1个单位像素是黑色,将图片中间的8 X 8像素还原为数据矩阵 [0039] For example, when η = 8, in FIG. 2 will be compressed to IOX 10 image pixels, determines the vertical and horizontal picture unit of the four sides of a pixel is black, the 8 X 8 pixel image reduction of the intermediate data matrix

Figure CN105760803BD00052

[0040] [0040]

Figure CN105760803BD00053

[0041] 其按行展开成数据的16进制表示为Dvq = 0xEE7E3CD5BD4F5B2C; [0041] expand into data row by hexadecimal notation Dvq = 0xEE7E3CD5BD4F5B2C;

[0042] B、获得旋转后的数据值 [0042] B, the data value obtained after rotation

[0043] 将步骤A获得的数据矩阵 [0043] The data matrix obtained in Step A

Figure CN105760803BD00054

在同一平面内旋转三次,分别得到数据矩阵: Three rotating in the same plane, respectively, to obtain data matrix:

Figure CN105760803BD00055

; ;

Figure CN105760803BD00056

;每次旋转的角度为90°; ; Each rotation angle of 90 °;

[0044] 例如,数据矩阵 [0044] For example, the data matrix

Figure CN105760803BD00057

旋转后得到如下三个数据矩阵: Rotated data matrix to obtain the following three:

[0045] 第一个数据矩阵为: [0045] The first data matrix:

[0046] [0046]

Figure CN105760803BD00058

[0047] 其按行展开成数据的16进制表示为Dvi = 0xlEC6FDEF7AE9D698; [0047] expand into data row by hexadecimal notation Dvi = 0xlEC6FDEF7AE9D698;

[0048] 第二个数据矩阵为: [0048] The second data matrix:

[0049] [0049]

Figure CN105760803BD00061

[0050] 其按行展开成数据的16进制表示为Dv2 = 0x34DAF2BDAB3C7E77; [0050] expand into data row by hexadecimal notation Dv2 = 0x34DAF2BDAB3C7E77;

[0051] 第三个数据矩阵为: [0051] The third data matrix:

[0052] [0052]

Figure CN105760803BD00062

[0053] 其按行展开成数据的16进制表示为Dv3 = 0x196B975EF7BF6378。 [0053] expand into data row by hexadecimal notation Dv3 = 0x196B975EF7BF6378.

[0054] C、CRC校验确定四个数值的正确性 [0054] C, CRC check value to determine the correctness of the four

[0055] 对Dvo、Dv1、Dv2、Dv3四个数据的前X位分别计算Y位CRC校验值,然后比对上述四个数据的后Y位是否分别和计算值相等;Χ=η2-γ; [0055] The Dvo, first X bits Dv1, Dv2, Dv3 four-bit data Y are calculated CRC checksum, and if the calculated values ​​are equal, respectively, and the ratio Y of the four data bits; Χ = η2-γ ;

[0056] 例如,在X = 56, γ = 8的情况: [0056] For example, in the case of X = 56, γ = 8 is:

[0057] Dvo的前56位数据的16进制表示为0xEE7E3CD5BD4F5B; 8位CRC校验值为01011110, 与其Dvo的后8位不等; [0057] in hexadecimal notation Dvo first 56 bits of data for 0xEE7E3CD5BD4F5B; 8-bit CRC value is 01011110, ranging from 8 bits of Dvo thereto;

[0058] Dvi的前56位数据的16进制表示为0xlEC6H)EF7AE9D8,8位CRC校验值为11010011, 与其Dvi的后8位不等; [0058] in hexadecimal notation Dvi first 56 bits of data for 0xlEC6H) EF7AE9D8,8 bit CRC value is 11010011, ranging from 8 bits of Dvi thereto;

[0059] Dv2的前56位数据的16进制表示为0x34DAF2BDAB3C7E,8位CRC校验值为00001001, 与其Dv2的后8位不等; Hexadecimal [0059] Dv2 first 56 bits of data for 0x34DAF2BDAB3C7E, 8-bit CRC value is 00001001, Dv2 its range of 8 bits;

[0060] Dv3的前56位数据的16进制表示为0xl96B975EF7BF63,8位CRC校验值为01111000, 与其Dv3的后8位相等; Hexadecimal [0060] Dv3 first 56 bits of data for bit CRC value 0xl96B975EF7BF63,8 01111000, its phase after 8 Dv3 the like;

[0061] D、取唯一通过检验的数据,作为解码结果。 [0061] D, taking the only test data, as a decoding result.

[0062] 也就是取在检验中唯一相等的Dv3作为解码结果。 [0062] That is taken equal to the unique inspection Dv3 as a decoding result.

[0063] 而该编码图片都可以在云端服务器与一个特定的卡牌角色形象关联,例如喷火龙。 [0063] and the pictures are coded can be associated with a particular card character image, such as fire-breathing dragon in the cloud server. 则使用者在客户端解码该矩阵码图片,获得解码结果Dv3后,则会在相应系统中生成一个喷火龙的角色形象。 After the user at the client decodes the picture matrix code to obtain decoded result Dv3, it will generate a fire-breathing dragon of the role of the image in the corresponding system. 并且,由于该矩阵码图片携带了该形象的方向信息,生成的喷火龙的角色形象则会直接展现出特定方向,例如向下或向左。 In addition, since the matrix code carries a picture of the image orientation information, generated character image of a fire-breathing dragon will directly show a particular direction, such as downward or to the left.

[0064] 所以,本申请还提供有记载有根据上述的编码方法制得的编码图片(解码方法所针对的编码图片)的卡牌,所述卡牌表面记载有编码图片,以及与所述编码图片所关联的角色形象、角色方向一致的图案。 [0064] Therefore, the present application discloses also provided with the above-described encoding method obtained by coding picture (picture decoding method for encoding) of the card, the card surface according to image encoding, the encoding and roles associated with the image of the picture, a pattern consistent with the role of direction. 例如,记载有如图2所示的图片,以及一只向下的喷火龙形象。 For example, it discloses a picture shown in FIG. 2, and a downward Charizard image. 使用者在客户端解码该矩阵码图片后,则会在相应系统中生成一只向下的喷火龙的角色形象。 After the client user to decode the matrix code picture, it will generate a fire-breathing dragon down the role of the image in the corresponding system.

[0065] 可与上述编码方法相对应的一种二维矩阵码的编码方法,包括步骤: [0065] A two-dimensional matrix code encoding method and the encoding method may correspond to, comprising the steps of:

[0066] A、为二进制数据添加CRC (Cyclic Redundancy Check,循环冗余校验码)校验码: [0066] A, adding CRC (Cyclic Redundancy Check, cyclic redundancy check) checksum binary data:

[0067] 对X位二进制数据左移Y位,将二进制的Y位CRC校验码加入后,转换为加入CRC校验码的二进制数据,长度为X+Y;Y可为8、16、32、64。 [0067] The left Y X-bit binary data bits, the binary Y-bit CRC is added, the CRC is added to convert binary data, the length of X + Y; Y may be 16, 32 64.

[0068] 例如,在X = 56, Y = 8的情况: [0068] For example, in X = 56, Y = 8 in the case of:

[0069] 随机取56 位数据为:0001100101101011100101110101111011110111101111110110 0011,其16 进制表示为0X196B975EF7BF63; [0069] 56 randomly selected data: 0001100101101011100101110101111011110111101111110110 0011, which in hexadecimal notation is 0X196B975EF7BF63;

[0070] 其CRC8校验码为:01111000,其16进制表示为0x78; [0070] CRC8 checksum which is: 01111000, which is 0x78 in hexadecimal notation;

[0071] 合并后数据16进制表示为0xl96B975EF7BF6378; [0071] The combined data after hexadecimal notation 0xl96B975EF7BF6378;

[0072] 二进制表示为: [0072] binary representation:

[0073] 0001100101101011100101110101111011110111101111110110001101111000 [0073] 0001100101101011100101110101111011110111101111110110001101111000

[0074] B、加入CRC校验码的二进制数据转成数据矩阵形式: [0074] B, the CRC code added data into binary data in a matrix form:

[0075] 数据矩阵阶数为X与Y的和开方后取整,得到η X η数据矩阵 [0075] The order of the data matrix X and Y, and rounding the square root to obtain a data matrix η X η

Figure CN105760803BD00071

;

[0076] 若Χ+Υ<η2,高位用0补齐到η2位;然后按照从高位到低位的顺序,将补齐后的数据每η位为一行,组成一个η X η矩阵 [0076] When Χ + Υ <η2, high filled with 0 to [eta] 2 position; and in order from high to low, the data bit is filled per line [eta], to form a matrix η X η

Figure CN105760803BD00072

[0077] 例如:步骤A中,X = 56,Y = 8的情况,二进制矩阵阶数 [0077] For example: step A, X = 56, Y = 8 in the case, the order of the binary matrix

Figure CN105760803BD00073

[0078] 步骤A二进制数据: [0078] Step A binary data:

[0079] 0001100101101011100101110101111011110111101111110110001101111000 [0079] 0001100101101011100101110101111011110111101111110110001101111000

[0080] 转换后的原始矩阵为: Converted [0080] to the original matrix:

Figure CN105760803BD00074

[0081] 其按行展开成数据的16进制表示为Dq = 0x196B975EF7BF6378; [0081] expand into data row by hexadecimal notation Dq = 0x196B975EF7BF6378;

[0082] C、旋转此数据矩阵三次,获得三个数据矩阵: [0082] C, this rotation matrix data three times to obtain three data matrix:

[0083] 将上一步得到的所述nXn数据矩阵 [0083] The last step of the resultant data matrix nXn

Figure CN105760803BD00075

,在同一平面内旋转三次,分别得到 , Three times in the same rotating plane, respectively

Figure CN105760803BD00076

:每次旋转的角度为90 °。 : Each rotation angle of 90 °. 旋转的方向不受限制,顺时针或者逆时针旋转都不影响本申请实施例的实现。 Is not limited rotation direction, clockwise or counterclockwise rotation will not affect the implementation of the embodiments of the present application.

[0084] 例如: [0084] For example:

Figure CN105760803BD00077

;旋转后得到如下三个数据矩阵: ; Post-rotation data matrix to obtain the following three:

[0085] 第一个数据矩阵为: [0085] The first data matrix:

Figure CN105760803BD00078

[0086] 其按行展开成数据的16进制表示为D1=Oxeetescdsbdafsbsc; [0086] their expanded into a row of data in hexadecimal notation as D1 = Oxeetescdsbdafsbsc;

[0087] 第二个数据矩阵为: [0087] The second data matrix:

Figure CN105760803BD00081

[0088] 其按行展开成数据的16进制表示为D2 = 0xlEC6FDEF7AE9D698; [0088] expand into data row by hexadecimal notation D2 = 0xlEC6FDEF7AE9D698;

[0089] 第三个数据矩阵为: [0089] The third data matrix:

Figure CN105760803BD00082

[0090] 其按行展开成数据的16进制表示为D3 = 0x34DAF2BDAB3C7E77。 [0090] expand into data row by hexadecimal notation D3 = 0x34DAF2BDAB3C7E77.

[0091] D、校验合法性: [0091] D, check the legality of:

[0092] a) CRC合法性校验 [0092] a) CRC check legality

[0093] 对D1、D2、D3取出前X位,计算出Y位CRC校验码,然后分别和D1、D2、D3的后Y位比对,比对结果为没有任何一个通过CRC校验,则此矩阵码合法; [0093] The D1, D2, D3 taken place before the X, Y calculated bit CRC, respectively, and then D1, D2, D3 bits Y after alignment, no CRC check by a comparison result, this matrix code is legitimate;

[0094] 例如: [0094] For example:

[0095] D1取出前56位,计算出8位CRC校验码为= OlOimo5D1的后8位为00101100,比对不相同; [0095] 56 removed before D1, calculates the 8-bit CRC code is 8 bits = 00101100 OlOimo5D1 is, not the same alignment;

[0096] D2取出前56位,计算出8位CRC校验码为:11010011 ;D2的后8位为10011000,比对不相同; [0096] D2 taken before 56 calculates the 8-bit CRC code is: 11010011; 8 bits D2 is 10011000, the same does not match;

[0097] D3取出前56位,计算出8位CRC校验码为:00001001;D3的后8位为01110111,比对不相同; [0097] D3 taken before 56 calculates the 8-bit CRC code is: 00001001; 8 bits D3 is 01110111, is not the same alignment;

[0098] 为方便计算,可以将二进制数据格式转为十六进制数据格式进行计算。 [0098] For purposes of calculation, the data format may be binary format into hexadecimal data is calculated. 例如D1 = 0xEE7E3CD5BD4F5B2C,取出前56 位0xEE7E3CD5BD4F5B 计算得到的CRC8 校验码为0x5E,而Di 的后8位的16进制表示为0x2C,与其CRC8校验码不相等。 E.g. D1 = 0xEE7E3CD5BD4F5B2C, before removing the 56 computed 0xEE7E3CD5BD4F5B CRC8 checksum code is 0x5E, after Di and the 8-bit hexadecimal notation 0x2C, CRC8 checksum are not equal thereto. 再依次同理判断D2、D3。 Similarly in turn determines D2, D3.

[0099] 如此,保证只有Do的CRC校验可以通过;D1AJ3均不应该通过CRC校验;则; [0099] Thus, to ensure that only Do CRC check can; D1AJ3 should not pass the CRC check; then;

Figure CN105760803BD00083

通过了CRC合法性校验。 By checking the legitimacy of the CRC.

[0100] b)对称校验 [0100] b) Symmetric check

[0101] [0101]

Figure CN105760803BD00084

四个数据矩阵均不相等,则此矩阵码合法;如果存在相等的情况,则表示四个旋转矩阵存在对称情况,这样的矩阵码无法判断方向,不能使用。 Four data matrix are not equal, the matrix code is legal; if equal presence, indicates the presence of four symmetric case where the rotation matrix, such a matrix can not determine the direction code can not be used.

[0102] 例如,从步骤B、C的数据矩阵表达式来看,四个数据矩阵均不相等;则, [0102] For example, from step B, and C matrix expression of view data, four data matrix are not equal; then,

Figure CN105760803BD00085

通过了对称校验。 By checking the symmetry.

[0103] 上述CRC合法性校验和对称校验无先后顺序,先进行任意一个都不影响本实施例的实现。 [0103] The CRC checksum symmetrical legitimacy check in no particular order, a first arbitrary does not affect the implementation of the embodiments. 经过多次测试,当X = 56,Y = 8的情况,CRC合法性校验通过率为98.2 %。 After several tests, when X = 56, Y = 8 in the case of, CRC checksum legitimacy by 98.2%. 绝大多数编码是可以通过校验的,并不会造成计算冗余和繁琐。 The vast majority are encoded by check, and will not cause calculate redundant and tedious.

[0104] E、取极值,确定显示码 [0104] E, the extreme value, determining the display code

[0105] 在 [0105] In

Figure CN105760803BD00091

.四个数据矩阵即D()、D1、D2、D3四个数中取极值DF为显示码; . I.e. four data matrix D (), D1, D2, D3 of the four extreme value DF is the number of display code;

[0106] 在步骤D中处理了相等的情况,所以在Do、D1、D2、D3中必然存在极值。 [0106] In the case of an equal treatment step D, there is inevitably extremum Do, D1, D2, D3 in. 在具体实施中,极值Df可以为0〇、01、02、03四个数的最大值或者最小值。 In a specific embodiment, the extreme value may be 0〇 Df, maximum or minimum number of four 01,02,03.

[0107] F、生成编码图片 [0107] F, generate a coded picture

[0108] 获得与Df对应的数据矩阵 [0108] obtaining the corresponding data matrix Df

Figure CN105760803BD00092

;

[0109] 图片的长和宽分别为n+2个单位,左右上下各留出一个单位设置为第一色,中间的η X η个单位按照 [0109] The length and width of images are n + 2 units, left and right upper and lower units are set to leave a first color, the intermediate unit according η X η

Figure CN105760803BD00093

中的数据填充,1填充第二色,0填充第一色。 Data filling, a filled second color, the first color 0 is filled.

[0110] 例如,步骤D中确定的最大码为 [0110] For example, the maximum code is determined in Step D

Figure CN105760803BD00094

,图片宽度W设定为500像素,按照填充规则生成的编码图片如图2所不。 , Image Width W is set to 500 pixels, to generate coded image in accordance with the rules of filling 2 is not shown in FIG.

[0111] 以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。 [0111] The foregoing is only preferred embodiments of the present invention, it is not intended to limit the invention to those skilled in the art, the present invention may have various changes and variations. 凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 Any modification within the spirit and principle of the present invention, made, equivalent substitutions, improvements, etc., should be included within the scope of the present invention.

Claims (3)

1. 一种二维矩阵码的解码方法,其特征在于,包括步骤: A、获得数据矩阵将数据矩阵的对应图形压缩到(n+2) X (n+2)像素,若图片上下左右四边的1个单位像素均为黑色,则按照图片白色像素为1、黑色像素为O的原则,将图片还原为nXn数据矩阵 1. A method of decoding a two-dimensional matrix code, characterized by comprising the step of: A, to obtain a data matrix corresponding to the matrix pattern data is compressed to (n + 2) X (n + 2) pixels, if the image vertically about the four sides 1 unit pixels are black, the white pixels in accordance with image 1, the principle of black pixels O, the picture will revert to the data matrix nXn
Figure CN105760803BC00021
Β、获得数据矩阵旋转后的数据值将数据矩阵 Β, data matrix to obtain data values ​​rotation data matrix
Figure CN105760803BC00022
在同一平面内旋转三次,分别得到数据矩阵 Three times in the same rotating plane, respectively data matrix
Figure CN105760803BC00023
;每次旋转的角度为90°; 上述四个数据矩阵展开成数据形式,分别得到Dvq、Dvi、Dv2、Dv3; C、 CRC校验确定四个数据的正确性对0仰、0^、0^、0^四个数据的前父位分别计算¥位0?(:校验值,然后比对上述四个数据的后Y位是否分别和计算值相等;X = n2-Y,Y为8、16、32、64; D、 取唯一通过检验的数据,作为解码结果;步骤D之后还包括: 将Dvo、Dvi、Dv2、Dv3四个数据进行比对,取极值Dvf ; 若在步骤D中,未在四个数据中找到唯一相等的数据,则将Dw与曾经识别成功的码Dc进行二进制数据位匹配,设定两者之间的不同位数的个数小于m,则通过校验,取该Dw作为解码结果,〇〈m〈n。 ; Each rotation angle of 90 °; the four expanded data matrix into a data form, respectively Dvq, Dvi, Dv2, Dv3; C, CRC check on the correctness of the data to determine four Yang 0, 0 ^ 0 ^, 0 ^ four bits before the parent data were calculated ¥ bit 0 (: check value, then the alignment of the four-bit Y data and whether the calculated values ​​are equal, respectively; X = n2-Y, Y is 8? , 16,32,64; D, taking data only through the inspection, as a decoding result; after step D further comprises: Dvo, Dvi, Dv2, Dv3 four data comparison, Dvf extreme value; if in step D , the data is not found in four equal unique data, will Dw binary data bits match, set the number of different bits between them was less than m and successful identification code Dc, through calibration , the Dw taken as the decoding result, square <m <n.
2. 根据权利要求1所述的一种二维矩阵码的解码方法,其特征在于,若码Dc已与虚拟物关联,则通过fe验的Dvf与同一虚拟物关联。 The decoding method of claim 1. A two-dimensional matrix code as claimed in claim, characterized in that, associated with the same virtual object, if Dvf code Dc is associated with the virtual object, through the inspection fe.
3. 根据权利要求1所述的一种二维矩阵码的解码方法,其特征在于,所述极值为最大值或者最小值。 The decoding method of claim 1. A two-dimensional matrix code as claimed in claim, characterized in that the extremum is a maximum or minimum.
CN201610073104.4A 2016-02-02 2016-02-02 Two-dimensional matrix code decoding method and describes the coding picture cards CN105760803B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610073104.4A CN105760803B (en) 2016-02-02 2016-02-02 Two-dimensional matrix code decoding method and describes the coding picture cards

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610073104.4A CN105760803B (en) 2016-02-02 2016-02-02 Two-dimensional matrix code decoding method and describes the coding picture cards

Publications (2)

Publication Number Publication Date
CN105760803A CN105760803A (en) 2016-07-13
CN105760803B true CN105760803B (en) 2018-08-28

Family

ID=56329905

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610073104.4A CN105760803B (en) 2016-02-02 2016-02-02 Two-dimensional matrix code decoding method and describes the coding picture cards

Country Status (1)

Country Link
CN (1) CN105760803B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4924078A (en) * 1987-11-25 1990-05-08 Sant Anselmo Carl Identification symbol, system and method
JP4141742B2 (en) * 2002-05-31 2008-08-27 ベリテック インコーポレーテッド □ type identification code paper
CN101978380A (en) * 2008-01-29 2011-02-16 威泰克公司 Two-dimensional symbol and method for reading same
CN102930268A (en) * 2012-08-31 2013-02-13 西北工业大学 Accurate positioning method for data matrix code under pollution and multi-view situation
CN103310177A (en) * 2012-03-13 2013-09-18 西门子公司 Method and reader for capturing a plurality of two-dimensional codes which are presented in succession on a display apparatus
CN103544724A (en) * 2013-05-27 2014-01-29 华夏动漫集团有限公司 System and method for realizing fictional cartoon character on mobile intelligent terminal by augmented reality and card recognition technology
CN103839031A (en) * 2014-02-27 2014-06-04 杭州晟元芯片技术有限公司 Special embedded type two-dimensional code recognition method
CN104636780A (en) * 2015-01-30 2015-05-20 深圳市民德电子科技有限公司 Matrix type two-dimensional code and encoding method and decoding method thereof

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4924078A (en) * 1987-11-25 1990-05-08 Sant Anselmo Carl Identification symbol, system and method
JP4141742B2 (en) * 2002-05-31 2008-08-27 ベリテック インコーポレーテッド □ type identification code paper
CN101978380A (en) * 2008-01-29 2011-02-16 威泰克公司 Two-dimensional symbol and method for reading same
CN103310177A (en) * 2012-03-13 2013-09-18 西门子公司 Method and reader for capturing a plurality of two-dimensional codes which are presented in succession on a display apparatus
CN102930268A (en) * 2012-08-31 2013-02-13 西北工业大学 Accurate positioning method for data matrix code under pollution and multi-view situation
CN103544724A (en) * 2013-05-27 2014-01-29 华夏动漫集团有限公司 System and method for realizing fictional cartoon character on mobile intelligent terminal by augmented reality and card recognition technology
CN103839031A (en) * 2014-02-27 2014-06-04 杭州晟元芯片技术有限公司 Special embedded type two-dimensional code recognition method
CN104636780A (en) * 2015-01-30 2015-05-20 深圳市民德电子科技有限公司 Matrix type two-dimensional code and encoding method and decoding method thereof

Also Published As

Publication number Publication date
CN105760803A (en) 2016-07-13

Similar Documents

Publication Publication Date Title
Lin et al. A self-assessment stereo capture model applicable to the internet of things
CN102194105B (en) Proxy training data for human body tracking
AU2008270883B2 (en) Virtual interactive presence systems and methods
Kim Designing virtual reality systems
US20120162384A1 (en) Three-Dimensional Collaboration
JP2006072903A (en) Image compositing method and device
US20070291035A1 (en) Horizontal Perspective Representation
CN103366610A (en) Augmented-reality-based three-dimensional interactive learning system and method
US8514262B2 (en) Information processing apparatus and network conference system
CN102411783A (en) Automatically tracking user movement in a video chat application
US20090251460A1 (en) Systems and methods for incorporating reflection of a user and surrounding environment into a graphical user interface
KR101608253B1 (en) Image-based multi-view 3d face generation
CN103329553A (en) Composite video streaming using stateless compression
CN105659592A (en) Camera system for three-dimensional video
CN103810353A (en) Real scene mapping system and method in virtual reality
EP2156869A1 (en) Entertainment device and method of interaction
Clark et al. An interactive augmented reality coloring book
Carozza et al. Markerless vision‐based augmented reality for urban planning
JP2012501506A (en) Converting 3d video content that matches the viewer located
Wei et al. Fisheye video correction
JP5117452B2 (en) Marker recognition method and learning system based on augmented reality utilizing this using dynamic threshold
Vallino et al. Haptics in augmented reality
Li et al. A computational model that recovers the 3D shape of an object from a single 2D retinal representation
JP2010026818A (en) Image processing program, image processor, and image processing method
CN101520849B (en) Based on the image feature points extraction and classification tree method and system random AR

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
GR01