New! View global litigation for patent families

CN105760803A - Two-dimensional matrix code encoding method and card recording encoding pictures - Google Patents

Two-dimensional matrix code encoding method and card recording encoding pictures Download PDF

Info

Publication number
CN105760803A
CN105760803A CN 201610073104 CN201610073104A CN105760803A CN 105760803 A CN105760803 A CN 105760803A CN 201610073104 CN201610073104 CN 201610073104 CN 201610073104 A CN201610073104 A CN 201610073104A CN 105760803 A CN105760803 A CN 105760803A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
data
matrix
encoding
method
code
Prior art date
Application number
CN 201610073104
Other languages
Chinese (zh)
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

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06KRECOGNITION OF DATA; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06KRECOGNITION OF DATA; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes

Abstract

The present invention provides a two-dimensional matrix code encoding method. The method comprises the steps: obtaining a data matrix and three groups of data values after the data matrix is rotated, determining whether the CRC verification of three groups of the data values is consistent or not, and taking the only equal data value as a decoding result. On the basis of the rectangle code decoding in the prior art, the two-dimensional matrix code encoding method and the card recording encoding pictures add a direction essential factor and select the only correct data through the CRC verification in four directions so as to allow user to conveniently use with no need for focusing the card direction on the card.

Description

二维矩阵码的解码方法从及巧载有编码图片的卡牌 The decoding method of two-dimensional matrix codes containing coded clever and pictures from the card

技术领域 FIELD

[0001] 本发明设及图形处理和0penCV(0pen Source Computer Vision Library,开源计算机视觉库)识别的技术领域,特别地,设及一种二维矩阵码的编码方法W及记载有编码图片的卡牌。 [0001] invention provided and graphics and 0penCV present (0pen Source Computer Vision Library, open-source Computer Vision Library) identified technical field, in particular, the card is provided and a coding method according to a two-dimensional matrix codes, and W are coded picture brand.

背景技术 Background technique

[0002] 计算机视觉是一口研究如何使机器"看"的科学,更进一步的说,指用摄影机和电脑代替人眼对目标进行识别、跟踪和测量等机器视觉,并进一步做图形处理,使图片被处理成为更适合人眼观察或传送给仪器检测的图像。 [0002] Computer vision is the study of how to make a machine "look" of science, further he 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 picture It 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 dimensional scene is mapped to a = single or multiple images on, for example, = dimensional scene reconstruction.

[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 is to transport techniques 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技术包含了多媒体、S维建模、实时视频显示及控制、多传感器融合、实时跟踪及注册、场景融合等新技术与新手段。 [0004] AR technology includes multimedia, S-dimensional modeling, real-time video display and control, sensor fusion, real-time tracking and registration, fusion scene new technologies and new means. 而传统AR卡牌产品,仅单纯的实现将实物卡牌与虚拟模型结合的功能,再辅W简单的网络激活与单机交互的玩法。 The traditional AR card products, will achieve only a simple physical model combined with the virtual card function, and then supplemented with a simple stand-alone web-enabled gameplay interaction W. 因为AR的核屯、部分是图像分析系统,而当前市场上的产品多采用高通的化foria接口实现。 Because nuclear Tuen AR, in part, an image analysis system, and the current products on the market to use more of foria interface Qualcomm. 例如央数文化(上海)股份有限公司的梦境盒子、3D增强现实=维互动学习机、口袋动物立体学习卡等产品;广州创幻数码科技有限公司的超次元系列产品。 For example, the number of central culture (Shanghai) Co., Ltd. dream box, 3D augmented reality = 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. 并且,高通化foria解决方案基于图像识别,无法读取数据,并且在一帖中不能识别两个相同的标示图像,影响识别速度。 Further, the high Tonghua foria solutions based on image recognition, data can not be read, and does not recognize two identical reference images in a post, it affects the recognition rate.

发明内容 SUMMARY

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

[000引将数据矩阵的对应图形压缩到(n+2) X (n+2)像素,若图片上下左右四边的1个单位像素均为黑色,贝贩照图片白色像素知、黑色像素为0的原则,将图片还原为n X n数据矩阵瑪L ; [000 primers corresponding to the pattern compressed data matrix (n + 2) X (n + 2) pixels, if the four sides of the vertical and horizontal picture unit 1 are black pixels, white pixel image shellfish known as traders, black pixels 0 principle, the image data is reduced to n X n matrix Ma L;

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

[0010]将数据矩阵诚在同一平面内旋转S次,分别得到数据矩阵成i。 [0010] The data matrix S Cheng rotation times in the same plane, respectively, to obtain a data matrix i. 、成东;、成立:; 每次旋转的角度为90° ; , Naruto; established:; each rotation angle of 90 °;

[00川上述四个数据矩阵展开成数据形式,分别得到Dvo、Dvi、Dv2、Dv3; [00 Chuan the four expanded data matrix into a data form, respectively Dvo, Dvi, Dv2, Dv3;

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

[001引对Dvo、Dvi、Dv2、Dv3四个数据的前X位分别计算Y位CRC校验值,然后比对上述四个数据的后Y位是否分别和计算值相等;X = n2-Y,Y为8、16、32、64; [001 primers were calculated to Dvo, Dvi, Dv2, before the X-bit data Y Dv3 four bit CRC value, then the ratio is calculated separately and Y values ​​are equal to the above-described four-bit data; X = n2-Y , Y is 8,16,32,64;

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

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

[0016] 将Dvo、Dvi、Dv2、Dv3四个数据进行比对,取极值Dvf ; [0016] The Dvo, Dvi, Dv2, Dv3 four data comparison, Dvf extreme value;

[0017] 若在步骤D中,未在四个数据中找到唯一相等的数据,则将Dvf与曾经识别成功的码Dc进行二进制数据位匹配,设定两者之间的不同位数的个数小于m,则通过校验,取该Dvf 作为解码结果,〇<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 to check, as a result of decoding to take the Dvf, square <m <n.

[0018] 优选的,若码化已与虚拟物关联,则通过校验的Dvf与同一虚拟物关联。 [0018] Preferably, if the code has been associated with the virtual objects of associated check Dvf through the same virtual object.

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

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

[0021] AU从视频中截取图片; [0021] AU images taken from the video;

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

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

[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] 本申请还提供记载有根据上述的解码方法所针对的编码图片的卡牌,所述卡牌表面记载有编码图片,W及与所述编码图片所关联的角色形象、角色方向一致的图案;所述编码图片为数据矩阵的对应图形。 [0026] The present application further discloses provides image encoding, W, and character image associated with the encoded picture, the same coded picture decoding method as described above for the card, the card according to the role described surface direction pattern; the encoded image data corresponding matrix pattern.

[0027] 本发明具有W下有益效果: [0027] The present invention has the beneficial effects W:

[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] 图I是本发明优选实施例的编码流程示意图; [0033] Figure I is a preferred embodiment of the encoding process of the present invention, a schematic view;

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

具体实施方式 detailed description

[0035] W下结合附图对本发明的实施例进行详细说明,但是本发明可W根据权利要求限定和覆盖的多种不同方式实施。 [0035] The accompanying drawings in conjunction with embodiments of the present invention are described in detail under W, W according to the present invention may be defined by the claims, and many different embodiments of cover.

[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、黑色像素为0的原则,将图片还原为n Xn数据矩阵、裤瑟.,; [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 principle of black pixels 0, the image data matrix is ​​reduced to n Xn, Joseph pants,.;

[0039] 例如,在n =別寸,将图2中的图片压缩至IOX 10像素,判断图片上下左右四边的1个单位像素是黑色,将图片中间的8 X 8像素还原为数据矩阵.瑣;惠:: [0039] For example, when n = not inch, the FIG. 2 image compression to IOX 10 pixels, around Analyzing image vertical four sides of a unit pixel is black, the 8 X 8 pixel restore the picture in the middle of the data matrix. Suo ;benefit::

[0040] [0040]

Figure CN105760803AD00051

[0041 ] 其按行展开成数据的16进制表示为Dvq = O址E7E3CD5抓4F5B2C; [0041] expand into data row by hexadecimal notation Dvq = O address E7E3CD5 grip 4F5B2C;

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

[0043] 将步骤A获得的数据矩阵JCL在同一平面内旋转=次,分别得到数据矩阵、八诗。 [0043] The data matrix obtained in Step A = JCL rotation times in the same plane, respectively, to obtain data matrix, eight poetry. :每次旋转的角度为90% : Each angle of rotation of 90%

[0044] 例如,数据矩阵W ^旋转后得到如下S个数据矩阵: [0044] For example, the rotated data matrix W ^ S data matrix obtained as follows:

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

[0046] [0046]

Figure CN105760803AD00052

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

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

[0049] [0049]

[(K)加]其按行展开成数据的16进制表示为Dv2 = 0x34DAF2抓AB3C7E77; [(K) was added] to expand into data row by hexadecimal notation Dv2 = 0x34DAF2 grip AB3C7E77;

[0051 ]第=个数据矩阵为: [0051] = the first data matrix:

[0化2] [0 of 2]

Figure CN105760803AD00061

[0化3] 其巧打展升成数据的16进制表示为Dv3 = 0x196B97祀巧邸6378。 [0 of 3] exhibition or its clever play data into hexadecimal notation Dv3 = 0x196B97 Si Di Qiao 6378.

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

[0055] 对Dvo、Dvi、Dv2、Dv3四个数据的前X位分别计算Y位CRC校验值,然后比对上述四个数据的后Y位是否分别和计算值相等;X = n2-Y; [0055] Y are calculated bit CRC value Dvo, Dvi, Dv2, before Dv3 four bit data X, respectively, and then the ratio is calculated after the values ​​are equal to the four-bit data Y; X = n2-Y ;

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

[0057] Dvo的前56位数据的16进制表示为0址E7E3CD5BD4F5B; 8位CRC校验值为OlOl 1110, 与其Dvg的后8位不等; [0057] hexadecimal Dvo first 56 bits of address data is denoted as 0 E7E3CD5BD4F5B; ranging from 8 8-bit CRC value after OlOl 1110, the Dvg thereto;

[005引Dvi的前56位数据的16进制表示为0dEC6FDEF7AE9D8,8位CRC校验值为11010011, 与其Dvi的后8位不等; [005 lead the first 56 bits of data Dvi hexadecimal notation 11010011 0dEC6FDEF7AE9D8,8 bit CRC value, 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进制表示为0x196897祀巧BF63,8位CRC校验值为Ol 111000, 与其Dv3的后8位相等; Hexadecimal [0060] Dv3 first 56 bits of data to 0x196897 Si phase coincidence 8 111 000, and the subsequent bit CRC value BF63,8 Ol 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] 而该编码图片都可W在云端服务器与一个特定的卡牌角色形象关联,例如喷火龙。 [0063] and the picture can be encoded in the cloud server W is associated with a particular card character image, such as fire-breathing dragon. 则使用者在客户端解码该矩阵码图片,获得解码结果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] 所W,本申请还提供有记载有根据上述的编码方法制得的编码图片(解码方法所针对的编码图片)的卡牌,所述卡牌表面记载有编码图片,W及与所述编码图片所关联的角色形象、角色方向一致的图案。 [0064] The W, the present application discloses also provided (picture decoding method for encoding) of the card based on the encoding method of encoding images obtained, according to the card surface of the image encoding, W, and with the said character image associated with the coded picture, a pattern consistent with the role of direction. 例如,记载有如图2所示的图片,W及一只向下的喷火龙形象。 For example, it discloses a picture shown in FIG. 2, W, and a downwardly 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 Redundan巧Qieck,循环冗余校验码)校验码: [0066] A, adding CRC (Cyclic Redundan Qiao Qieck, 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.

[006引例如,在x = 56,Y = 8的情况: [006 cited example, x = 56, Y = 8 in the case of:

[0069] 随机取56 位数据为:0001100101101011100101110101111011110111101111110110 OOl 1,其16进制表示为0x19她97祀巧BF63; [0069] 56 randomly selected data: 0001100101101011100101110101111011110111101111110110 OOl 1, which is 0x19 in hexadecimal notation as Si her 97 skillfully BF63;

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

[0071] 合并后数据16进制表示为0x19她975EF7BF6378; [0071] After the combined data is 0x19 in hexadecimal notation her 975EF7BF6378;

[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:

[00巧]数据矩阵阶数为X与Y的和开方后取整,得到nXn数据矩阵鸣fx。 [Qiao 00] of order data matrix X and Y, and rounding the square root to obtain a data matrix nXn Ming fx. ;

[0076] 若XW<n2,高位用0补齐到n2位;然后按照从高位到低位的顺序,将补齐后的数据每n位为一行,组成一个n X n矩阵鼓fx。 [0076] When XW <n2, n2 to high filled with 0 bits; and data in order from high to low, the line is filled every n bits, n X-n matrix composed of a drum fx. .

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

Figure CN105760803AD00071

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

[0079] 0001100101101011100101110101111011110111101111110110001101111000 [0079] 0001100101101011100101110101111011110111101111110110001101111000

[0080] 转换后的原始矩阵文 [0080] After converting the original text matrix

Figure CN105760803AD00072

[0081 ] 其按行展开成数据的16进制表示为D〇= Oxl96B97祀巧BF6378; [0081] expand into data row by hexadecimal notation D〇 = Oxl96B97 Si Qiao BF6378;

[0082] C、旋转此数据矩阵=次,获得=个数据矩阵: [0082] C, the rotation time of this data matrix =, = a data matrix obtained:

[0083] 将上一步得到的所述n Xn数据矩阵、绵X、,在同一平面内旋转S次,分别得到风吏<。 [0083] n Xn to the data matrix obtained in the previous step, cotton times X ,, S rotating in the same plane, respectively wind officials <. 、A巧;每次旋转的角度为90°。 , A clever; 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] 例如:旋转后得到如下S个数据矩阵: [0084] For example: the rotation matrix data obtained as follows S:

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

Figure CN105760803AD00073

[00化]其按行展开成数据的16进制表示为化=0址E7E3CD5抓4F5B2C; [Of 00] which is expanded into data rows hexadecimal notation of address = 0 E7E3CD5 grip 4F5B2C;

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

Figure CN105760803AD00081

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

[0089] 第S个数据矩阵为: [0089] S-th matrix data:

Figure CN105760803AD00082

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

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

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

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

[0094] 例如; [0094] For example;

[0095] 化取出前56位,计算出8位CRC校验码为:01011110;化的后8位为00101100,比对不相同; [0095] 56 of the front removed, to calculate the 8-bit CRC code is: 01011110; of the 8 bits 00101100, is not the same alignment;

[0096] 化取出前56位,计算出8位CRC校验码为:11010011;化的后8位为10011000,比对不相同; [0096] 56 of the front removed, to calculate the 8-bit CRC code is: 11010011; of the 8 bits 10011000, is not the same alignment;

[0097] 化取出前56位,计算出8位CRC校验码为:00001001;化的后8位为01110111,比对不相同; [0097] 56 of the front removed, to calculate the 8-bit CRC code is: 00001001; of the 8 bits 01110111, is not the same alignment;

[0098] 为方便计算,可W将二进制数据格式转为十六进制数据格式进行计算。 [0098] For purposes of calculation, W may be converted to binary data format hexadecimal data format is calculated. 例如化= 0XEE7E3CD5BD4F5B2C,取出前56位Ox邸7E3CD5BD4F5B计算得到的CRC8校验码为Ox祀,而Di 的后8位的16进制表示为0x2C,与其CRC8校验码不相等。 Example of = 0XEE7E3CD5BD4F5B2C, before removing 56 Ox Di 7E3CD5BD4F5B CRC8 checksum calculated as Si Ox, after Di and the 8-bit hexadecimal notation 0x2C, CRC8 checksum are not equal thereto. 再依次同理判断化、〇3。 Similarly in turn determination of, 〇3.

[0099] 如此,保证只有Do的CRC校验可W通过;Di、D2、D3均不应该通过CRC校验;则嫂X、:通过了CRC合法性校验。 [0099] Thus, to ensure that only Do the CRC can by W; Di, D2, D3 should not pass the CRC check; then Mrs. X ,: legitimacy by the CRC check.

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

[0101] A令X。 [0101] A command X. 、j适、娩四个数据矩阵均不相等,则此矩阵码合法;如果存在相等的情况,则表示四个旋转矩阵存在对称情况,运样的矩阵码无法判断方向,不能使用。 , J suitable, not equal four data delivery matrix, then this matrix code is legal; if equal presence, indicates the presence of four symmetric case where the rotation matrix, matrix code sample transport direction can not be judged, can not be used.

[0102] 例如,从步骤B、C的数据矩阵表达式来看,四个数据矩阵均不相等;则、vfs、通过了对称校验。 [0102] For example, from step B, and C matrix expression of view data, four data matrix are not equal; is, VFS, 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%. 绝大多数编码是可W通过校验的,并不会造成计算冗余和繁琐。 W is encoded by a majority check, and will not cause redundant calculation and cumbersome.

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

[010引在诚%:、班XS、诚X、;、;碱..,四个数据矩阵即00、01、02、03四个数中取极值化为显示码; [010 :, classes cited in Cheng% XS, X-Cheng,;,; .. base, i.e., four data matrix 00,01,02,03 extreme value four numbers into the display code;

[0106] 在步骤D中处理了相等的情况,所W在Do、Di、化、〇3中必然存在极值。 [0106] The processing in the case where the equal step D, W in the Do, Di, of, 〇3 necessarily extremum. 在具体实施中,极值化可W为化、Dl、〇2、〇3四个数的最大值或者最小值。 In a particular embodiment, may be of extreme value of W is, Dl, 〇2, 〇3 maximum or minimum number of four.

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

[0108] 获得与化对应的数据矩阵>鸣知:; [0108] corresponding to the data obtained with the matrix of> Ming known:;

[0109] 图片的长和宽分别为n巧个单位,左右上下各留出一个单位设置为第一色,中间的n X n个单位按照城X,,中的数据填充,1填充第二色,0填充第一色。 [0109] The length and width of images are clever n units, each of the vertical and horizontal units are set to leave a first color, the n X-n intermediate filling unit according to the data X ,, in the city, filled with a second color , 0 fills the first color.

[0110] 例如,步骤D中确定的最大码为图片宽度W设定为500像素,按照填充规则生成的编码图片如图2所示。 [0110] For example, the maximum code determined in step D as image width W is set to 500 pixels, to generate coded image in accordance with the rules of filling shown in FIG.

[0111] W上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可W有各种更改和变化。 The [0111] W merely illustrate the preferred embodiments of the present invention, not intended to limit the present invention, those skilled in the art, the present invention may have various changes and variations W. 凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 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 (7)

1. 一种二维矩阵码的解码方法,其特征在于,包括步骤: A、获得数据矩阵将数据矩阵的对应图形压缩到(n+2)X(n+2)像素,若图片上下左右四边的1个单位像素均为黑色,则按照图片白色像素为1、黑色像素为0的原则,将图片还原为ηΧη数据矩阵 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 zero black pixels, the picture will revert to the data matrix ηΧη
Figure CN105760803AC00021
Β、获得数据矩阵旋转后的数据值将数据矩阵聚||@在同一平面内旋转三次,分别得到数据矩阵旋转的角度为90° ; 上述四个数据矩阵展开成数据形式,分别得到Dvq、Dvi、Dv2、 Dv3; C、 CRC校验确定四个数据的正确性对0仰、0^、0^、0^四个数据的前父位分别计算¥位0?(:校验值,然后比对上述四个数据的后Y位是否分别和计算值相等;X = n2-Y,Y为8、16、32、64; D、 取唯一通过检验的数据,作为解码结果。 Beta, to obtain data values ​​data matrix rotation matrix data polyethylene || @ three rotation in the same plane, each data matrix obtained is the rotation angle of 90 °; the four expanded data matrix into a data form, respectively Dvq, Dvi , Dv2, Dv3; C, CRC check to determine the correctness of the four data Yang 0, 0 ^ 0 ^ 0 ^ four data bits before the parent calculates ¥ bit 0 (: check value, then the ratio? whether the bits of the four Y data and the calculated value are equal; X = n2-Y, Y is 8,16,32,64; D, taking data only through the inspection, as a decoding result.
2. 根据权利要求1所述的一种二维矩阵码的编码方法,其特征在于,步骤D之后还包括: 将Dvo、Dvi、DV2、DV3四个数据进行比对,取极值Dvf ; 若在步骤D中,未在四个数据中找到唯一相等的数据,则将Dw与曾经识别成功的码Dc进行二进制数据位匹配,设定两者之间的不同位数的个数小于m,则通过校验,取该Dw作为解码结果,〇〈m〈n。 The encoding method of claim 1. A two-dimensional matrix as claimed in claim code, wherein, after the step D further comprises: Dvo, Dvi, DV2, DV3 four data comparison, Dvf extreme value; if , step D was not found in the data only in four equal data, binary data bits will Dw match was successful identification code Dc, setting the number of different bits between them is less than the number m, then to check, as a result of decoding to take the Dw, square <m <n.
3. 根据权利要求2所述的一种二维矩阵码的编码方法,其特征在于,若码Dc已与虚拟物关联,则通过fe验的Dvf与同一虚拟物关联。 The encoding method of claim 2 A two-dimensional matrix code claim, characterized in that, associated with the same virtual object, if Dvf code Dc is associated with the virtual object, through the inspection fe.
4. 根据权利要求2所述的一种二维矩阵码的编码方法,其特征在于,所述极值为最大值或者最小值。 The encoding method of claim 2 A two-dimensional matrix code claim, characterized in that the extremum is a maximum or minimum.
5. 根据权利要求1所述的一种二维矩阵码的编码方法,其特征在于,在步骤A之前还包括: A1、从视频中截取图片; A2、对图片进行去色、二值化并反色处理; A3、获得图像中的封闭形状,在封闭形状中搜索四边形; A4、四边形区域还原,获得数据矩阵的图形。 The encoding method of claim 1. A two-dimensional matrix as claimed in claim code, wherein prior to step A further comprises: A1, taken from the video image; A2, to color the picture, and binarization anti-color treatment; A3, closed shape image obtained in the search for a closed quadrangular shape; A4, quadrangular area reduction, to obtain pattern data matrix.
6. 根据权利要求1所述的编码方法,其特征在于,每一幅编码图片与一个特定的卡牌角色形象关联。 6. The coding method according to claim 1, characterized in that each one encoding a picture associated with a particular character card image.
7. 记载有根据权利要求1-6任一项所述的解码方法所针对的编码图片的卡牌,其特征在于,所述卡牌表面记载有编码图片,以及与所述编码图片所关联的角色形象、角色方向一致的图案;所述编码图片为数据矩阵的对应图形。 7. The encoder of claim discloses a picture decoding method according to any one of claims 1-6 for the card, wherein said card surface describes a picture coding, and the coded picture associated with the character image, a pattern consistent with the role of direction; the encoded image data corresponding matrix pattern.
CN 201610073104 2016-02-02 2016-02-02 Two-dimensional matrix code encoding method and card recording encoding pictures CN105760803A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201610073104 CN105760803A (en) 2016-02-02 2016-02-02 Two-dimensional matrix code encoding method and card recording encoding pictures

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201610073104 CN105760803A (en) 2016-02-02 2016-02-02 Two-dimensional matrix code encoding method and card recording encoding pictures

Publications (1)

Publication Number Publication Date
CN105760803A true true CN105760803A (en) 2016-07-13

Family

ID=56329905

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201610073104 CN105760803A (en) 2016-02-02 2016-02-02 Two-dimensional matrix code encoding method and card recording encoding pictures

Country Status (1)

Country Link
CN (1) CN105760803A (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

Similar Documents

Publication Publication Date Title
US20070291035A1 (en) Horizontal Perspective Representation
US20120162384A1 (en) Three-Dimensional Collaboration
US20100220891A1 (en) Augmented reality method and devices using a real time automatic tracking of marker-free textured planar geometrical objects in a video stream
US20120069051A1 (en) Method and System for Compositing an Augmented Reality Scene
US20040104935A1 (en) Virtual reality immersion system
US20090122058A1 (en) System and method for tracking three dimensional objects
Noh et al. A review on augmented reality for virtual heritage system
CN101101505A (en) Method and system for implementing three-dimensional enhanced reality
Gupta et al. DuploTrack: a real-time system for authoring and guiding duplo block assembly
CN102110379A (en) Multimedia reading matter giving readers enhanced feeling of reality
CN103366610A (en) Augmented-reality-based three-dimensional interactive learning system and method
JP2010026818A (en) Image processing program, image processor, and image processing method
CN102568026A (en) Three-dimensional enhancing realizing method for multi-viewpoint free stereo display
US20120268491A1 (en) Color Channels and Optical Markers
WO2004012141A2 (en) Virtual reality immersion system
Prince et al. 3-D live: real time interaction for mixed reality
Song et al. Semantic scene completion from a single depth image
Vasudevan et al. High-quality visualization for geographically distributed 3-d teleimmersive applications
Wither et al. Pictorial depth cues for outdoor augmented reality
WO2002069272A2 (en) Real-time virtual viewpoint in simulated reality environment
CN101923791A (en) Method for learning Chinese by combining reality enhancing technique and plane reading material
Clark et al. An interactive augmented reality coloring book
US8542250B2 (en) Entertainment device, system, and method
Lovett et al. Analogy with qualitative spatial representations can simulate solving Raven's Progressive Matrices
Miller et al. Interactive 3D model acquisition and tracking of building block structures

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination