WO2019214291A1 - 三维码生成和解析方法 - Google Patents

三维码生成和解析方法 Download PDF

Info

Publication number
WO2019214291A1
WO2019214291A1 PCT/CN2019/072372 CN2019072372W WO2019214291A1 WO 2019214291 A1 WO2019214291 A1 WO 2019214291A1 CN 2019072372 W CN2019072372 W CN 2019072372W WO 2019214291 A1 WO2019214291 A1 WO 2019214291A1
Authority
WO
WIPO (PCT)
Prior art keywords
dimensional code
carrier
color
dimensional
area
Prior art date
Application number
PCT/CN2019/072372
Other languages
English (en)
French (fr)
Inventor
李峰
尹春芳
Original Assignee
Li Feng
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 Li Feng filed Critical Li Feng
Publication of WO2019214291A1 publication Critical patent/WO2019214291A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; 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 OR COUNTING
    • G06KGRAPHICAL DATA READING; 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/06046Constructional details
    • G06K19/06159Constructional details the marking being relief type, e.g. three-dimensional bar codes engraved in a support

Definitions

  • This article refers to but is not limited to codec technology, especially three-dimensional code generation and analysis methods.
  • QR codes were introduced in Japan in the 1990s and are now widely used worldwide.
  • the two-dimensional code has many advantages such as large information capacity, wide coding range, and high decoding reliability.
  • the two-dimensional code belongs to a planar figure and is easily copied, so there is still a great defect in anti-counterfeiting.
  • the three-dimensional code generation and analysis method can overcome the defects that the two-dimensional code is easily copied, improve the anti-counterfeiting function, and expand the information capacity.
  • a three-dimensional code generation method may include:
  • the plurality of carriers provided with the two-dimensional code are superimposed in a preset order, and the regions of the two-dimensional codes on the different carriers are superimposed after being superimposed; wherein the colors of the two-dimensional codes on each carrier superimposed are different, and The information represented is at least partially different;
  • the first region is a color of the two-dimensional code on the carrier and the two-dimensional code on the other carrier a superimposed region, the second region being an area in which the two-dimensional code on the carrier does not overlap with the two-dimensional code on any other carrier;
  • the processing of the plurality of carriers superimposed on each other to cause the color of the second region on each of the carriers to be presented includes:
  • the region corresponding to the second region is hollowed out, so that the color of the second region is superimposed
  • the top layer of the carrier is presented.
  • the method may further include: determining, after the plurality of carriers provided with the two-dimensional code are superimposed in a preset order, the two-dimensional code on each carrier according to the object to be encoded;
  • Determining the two-dimensional code on each carrier according to the object to be encoded may include:
  • the version of the code is determined according to the character length of the sub-object, and each of the first two-dimensional codes is respectively determined as a two-dimensional code on a different carrier according to a one-to-one correspondence.
  • the method for generating a three-dimensional code may further include: after determining the two-dimensional code on each carrier according to the object to be encoded, setting the two-dimensional code corresponding to each carrier in different set colors. On each carrier.
  • the setting the two-dimensional code corresponding to each carrier on each carrier in different set colors may include:
  • acquiring the composite color of the color of the first region on the plurality of carriers superimposed on each other may include:
  • the RGB values of the first pixel corresponding to the same position on the multi-layer carrier are combined, and the color corresponding to the synthesized RGB value is set as the color at the position of the first pixel.
  • the method may further include:
  • the cover layer is correspondingly covered on the uppermost layer of the plurality of carriers that are physically superposed, and forms a three-dimensional code together with the plurality of carriers.
  • the two-dimensional code is a fast response QR code.
  • the color of the two-dimensional code on each carrier is a set color; the set color includes: red, green, or blue.
  • the RGB values of the pixels corresponding to each of the plurality of two-dimensional codes having the same area and the same version are less than or equal to 180.
  • the three-dimensional code parsing method is configured to parse the three-dimensional code generated by the foregoing three-dimensional code generating method, and the three-dimensional code parsing method may include:
  • the decoding information of the three-dimensional code is obtained according to the character information corresponding to the plurality of set color two-dimensional codes.
  • determining the plurality of set colors that make up the current three-dimensional code may include:
  • a plurality of set colors constituting the current three-dimensional code are determined according to the RGB values of the pixels in the positioning area.
  • extracting a plurality of set color two-dimensional codes from the three-dimensional code on a basis of each of the set colors may include: performing the following steps when extracting each set color two-dimensional code:
  • a computer readable storage medium storing computer executable instructions that, when executed by a processor, implement the three-dimensional code generation method and the three-dimensional code analysis method.
  • the method for generating a three-dimensional code may include: superimposing a plurality of carriers provided with the two-dimensional code in a preset order, and superimposing the regions where the two-dimensional codes on the different carriers are overlapped; wherein the carriers are superimposed The color of the upper two-dimensional code is different, and the information represented is at least partially different; respectively, the first region and the second region formed on each carrier after superposition are determined; wherein, for any carrier to be superimposed, the first region is The two-dimensional code on the carrier has a color superimposed area with the two-dimensional code on the other carrier, and the second area is a region in which the two-dimensional code on the carrier does not overlap with the two-dimensional code on any other carrier; a composite color of the color of the first region on the plurality of stacked carriers and presented, and processing a plurality of carriers stacked on each other to cause the color of the second region on each of the carriers to be presented The three-dimensional code of the three-dimensional structure.
  • FIG. 1 is a flowchart of a method for generating a three-dimensional code according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a two-dimensional code of a set color corresponding to three set colors of pure red, pure green, and pure blue according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of physical superposition of a plurality of set color two-dimensional codes according to an embodiment of the present invention
  • 4(a) is a schematic diagram showing a physical superposition method of a pure red two-dimensional code and a pure green two-dimensional code according to an embodiment of the present invention
  • 4(b) is a schematic diagram showing the color distribution of the obtained three-dimensional code after physical superposition of the pure red two-dimensional code and the pure green two-dimensional code according to the embodiment of the present invention
  • 5(a) is a schematic diagram showing a physical superposition method of a pure red two-dimensional code, a pure green two-dimensional code, and a pure blue two-dimensional code according to an embodiment of the present invention
  • FIG. 5(b) is a schematic diagram showing a color distribution of a three-dimensional code obtained by physically superimposing a pure red two-dimensional code, a pure green two-dimensional code, and a pure blue two-dimensional code according to an embodiment of the present invention
  • FIG. 6 is a schematic view of a cover layer according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of a method for setting a color of a first region on a carrier of an uppermost layer to a plurality of color combinations of a set color superimposed on each other according to an embodiment of the present invention
  • FIG. 8 is a flowchart of a method for analyzing a three-dimensional code according to an embodiment of the present invention.
  • the embodiment of the present invention provides a three-dimensional code generation method. As shown in FIG. 1, the method may include S101-S104:
  • the plurality of carriers provided with the two-dimensional code are superimposed in a preset order, and the regions where the two-dimensional codes on the different carriers are overlapped are superimposed; wherein the colors of the two-dimensional codes on the carriers that are superimposed are different, and The information represented is at least partially different.
  • the generated plurality of set color two-dimensional codes are required to be carried by the carrier, and then the carriers of the plurality of set color two-dimensional codes are superimposed, so that The color two-dimensional code is set to form a three-dimensional structure, thereby obtaining a three-dimensional code having a three-dimensional structure, and the superimposed schematic view is as shown in FIG.
  • the carrier may include, but is not limited to, paper, sheets of one or more materials (e.g., wood chips, metal sheets, plastic sheets, sheets of synthetic materials, etc.) as well as solid coatings and the like.
  • materials e.g., wood chips, metal sheets, plastic sheets, sheets of synthetic materials, etc.
  • the method may further include: acquiring, after the plurality of carriers provided with the two-dimensional code are superimposed in a preset order, the two-dimensional code on each carrier according to the object to be encoded.
  • the object to be encoded may be any information including a webpage link and identity information, and one or more two-dimensional images may be generated according to the object to be encoded and any existing two-dimensional code generation rule. And arranging the one or more two-dimensional codes on the carrier of the two-dimensional code to acquire the three-dimensional code by superposition of the plurality of carriers.
  • the two-dimensional code on each carrier means that color patch regions are disposed on the carrier, and the patch regions and the blank regions/white regions are organized and interleaved according to certain rules to form two on each carrier.
  • the dimension code is shown in the two-dimensional code in Figure 2.
  • the two-dimensional code may be a fast response QR code.
  • the above-described two-dimensional code may be any type of two-dimensional code currently existing, and there is no limitation on its type.
  • the two-dimensional code may include: a stripe two-dimensional code and a matrix two-dimensional code including but not limited to a QR code.
  • the embodiment of the present invention will be described by taking a QR code as an example.
  • the preset color may be a primary color that has not been subjected to any color synthesis, for example, It can be three primary colors of RGB, namely red (R), green (G), and blue (B).
  • the three primary colors of the computer are red (R), green (G), and blue (B), that is, each pixel has an RGB value, which can represent a colorful world, just because each The pixel values of the pixels are different.
  • RGB value (0,0,0) means that the proportion of red, green and blue is the lowest, RGB value (0,0,0) represents black; conversely, when RGB value is (255,255,255) That is, the content of red, green and blue reaches the highest value, and the color represented by the RGB value (255, 255, 255) is white.
  • the RGB value is (255, 0, 0)
  • (0, 255, 0) means pure green
  • (0, 0, 255) means pure blue. Therefore, we have presented a variety of colors because of the change in RGB values.
  • acquiring the two-dimensional code on each carrier according to the object to be encoded may include:
  • the version of the code is determined according to the character length of the sub-object, and each of the first two-dimensional codes is respectively determined as a two-dimensional code on a different carrier according to a one-to-one correspondence.
  • the density of the two-dimensional code pattern of the same area is closely related to the version of the two-dimensional code, and the longer the content is carried, the higher the version number is required.
  • the different version numbers may cause the position of the graphic symbols on the same area to be deviated, so that they cannot be accurately fused, and thus cannot be decoded. Therefore, the plurality of set color two-dimensional codes generated in the embodiment of the present invention need to have the same area and the same version.
  • the character length of the object to be encoded is small, and the information of the object to be encoded can be carried by using the second version code of the lower version, the entire character of the object to be encoded can be directly used.
  • a plurality of set color two-dimensional codes having the same area and the same version, that is, the first two-dimensional code described above are respectively generated.
  • the object to be encoded may be equally divided according to the length of the character to be encoded, that is, the current object to be encoded is equally divided into a plurality of sub-objects having the same character length, wherein the plurality of sub-objects The composite of the character length of the object is equal to the character length of the original encoded object before the equalization.
  • halving the object to be encoded according to the character length of the object to be encoded may ensure that a plurality of sub-objects may be encoded with the same version of the two-dimensional code to generate a plurality of different set colors, the same area, and the same The version of the two-dimensional code, that is, the second two-dimensional code described above.
  • the color of the two-dimensional code on each carrier is a set color; the set color may include: red, green, or blue (RGB three primary colors).
  • the set color for generating the set color two-dimensional code may be any two or three of three primary colors of red, green, and blue. That is, the generated plurality of set color two-dimensional codes may be two or three, so as to superimpose the two-dimensional codes of any two set colors in the subsequent scheme, or two-dimensionally set the three colors. The code is superimposed.
  • the method for generating a three-dimensional code may further include: after determining the two-dimensional code on each carrier according to the object to be encoded, setting the two-dimensional code corresponding to each carrier in different set colors. On each carrier.
  • the setting the two-dimensional code corresponding to each carrier on each carrier in different set colors may include:
  • the two-dimensional code is composed of a plurality of color patches arranged in a specific pattern, and the distribution of the color patches may be used to represent specific information.
  • setting the two-dimensional code on the carrier may mean: distributing the color block of the two-dimensional code [corresponding to the part where the two-dimensional code is colored] on the carrier, the color block and the white/blank area. Interphase, so that the two-dimensional code can be revealed.
  • FIG. 2 there are three schematic diagrams for setting a color two-dimensional code pattern.
  • the content of the three-dimensional code is carried by the plurality of two-dimensional code patterns by the above-described scheme.
  • the superimposed order of the plurality of carriers may be customized according to an application scenario, actual needs, or personal preference, and the order of the overlay is not limited.
  • a pure red two-dimensional code may be stacked on the upper layer
  • a pure green two-dimensional code may be stacked on the lower layer
  • a pure red two-dimensional code may be stacked on the upper layer
  • the superimposing order may be randomly determined, or the superimposing order may be artificially specified in advance.
  • S102 respectively determining a first region and a second region formed on each carrier after superposition; wherein, for any carrier to be superimposed, the first region is a two-dimensional code on the carrier and a two-dimensional code on the other carrier exists The area in which the color is superimposed, and the second area is an area in which the two-dimensional code on the carrier is not superimposed with the color of the two-dimensional code on any other carrier.
  • Other vectors refer to any one or more of the vectors involved in the superposition except for the vector.
  • the pure red two-dimensional code and the pure green two-dimensional code are still taken as an example to illustrate the physical superposition process of two set color two-dimensional codes, as shown in FIG. 4( a ), which is pure red two-dimensional code.
  • FIG. 4( a ) A schematic diagram of a physical superposition method of a code and a pure green two-dimensional code
  • FIG. 4(b) is a schematic diagram of a color distribution of the obtained three-dimensional code after physical superposition.
  • the yellow color in the three-dimensional code pattern of the structure is superposed by red and green, that is, the first region described above, and the structure is also pure in the three-dimensional code pattern.
  • the red and pure green parts which means that this area has not been superimposed, ie the second area mentioned above.
  • a pure red two-dimensional code, a pure green two-dimensional code, and a pure blue two-dimensional code are taken as an example to illustrate a physical superposition process of three set color two-dimensional codes, as shown in FIG. 5( a ).
  • a schematic diagram of a physical superposition method of a pure red two-dimensional code, a pure green two-dimensional code, and a pure blue two-dimensional code is a schematic diagram of a color distribution of the obtained three-dimensional code after physical superposition.
  • the gray (light gray) in the three-dimensional code pattern of the structure is a superposition of three set colors (pure red, pure green, pure blue), and yellow, Purple and cyan are pure red and pure green, pure red and pure blue, respectively, and a superposition of pure blue and pure green.
  • the RGB values of the pixels corresponding to each of the plurality of two-dimensional codes having the same area and the same version are less than or equal to 180.
  • the background color of the three-dimensional code is usually white, so if three-dimensional When there are three superimposed parts of the set color (usually appearing in the positioning area), the structure 3D code cannot be positioned and parsed. Therefore, in order to ensure that the three setting colors are merged and can be distinguished from white,
  • the fixed color content should not be higher than 70%, that is, about 180 (180 in the present application). In the implementation, the set color content can be appropriately adjusted according to actual needs.
  • the superimposed regions of the three set colors (pure red, pure green, and pure blue) in the above embodiment are gray (light gray).
  • the storage capacity of the structured three-dimensional code can be at least 2 to 3 times that of the conventional two-dimensional code, and the information capacity of the conventional two-dimensional code is expanded. .
  • the color of different regions on the three-dimensional code can be obtained by the above-mentioned superposition, and since the three-dimensional code of the embodiment of the present invention is obtained by physical superposition of a plurality of carriers of the set color two-dimensional code, When the superposition is performed, the corresponding first region on the surface of the three-dimensional code does not directly present the superimposed color. Similarly, the set color of the second region on the non-topmost carrier is due to the carrier above the carrier. The occlusion is not directly presented. Therefore, in order to reflect the information carried by the three-dimensional code through a plurality of colors, the carrier of the three-dimensional code needs to be processed to make the composite color of the first region and the set color of the second region. Both can be presented intuitively to the user.
  • acquiring the synthesized colors of the colors of the first regions on the plurality of carriers superimposed on each other and presenting may include: performing the following operations for each of the first regions:
  • the set color of the mth first region on all the carriers is determined, and all the determined set colors are color-combined, and the synthesized color is set at the uppermost layer.
  • m is a positive integer.
  • first, for the composite color of the first region it may be directly presented by the uppermost carrier, for example, the color after the synthesis may be set by re-coloring (eg, printing, spraying, hot stamping, etc.)
  • the first region on the surface of the upper carrier in other embodiments, a cover layer may be added to the surface of the uppermost carrier to present the synthesized color through the overlay, the embodiment may be as follows:
  • the method may further include:
  • the cover layer is correspondingly covered on the uppermost layer of the plurality of carriers that are physically superposed, and forms a three-dimensional code together with the plurality of carriers.
  • the second region is hollowed out in preparation for subsequent presentation of the set color of the second region on each carrier.
  • FIG. 6 a schematic view of the cover layer is shown in FIG. 6 , and the material and implementation method of the cover layer are not limited in the present application.
  • the cover layer may be a layer of a film having a color, or may be the same material and area as the carrier, and a new carrier having a synthetic color disposed in the first region portion.
  • the processing the plurality of carriers stacked on each other to cause the color of the second region on each of the carriers to be presented may include:
  • the region corresponding to the second region is hollowed out, so that the color of the second region is superimposed
  • the top layer of the carrier is presented.
  • the number of layers a of the carrier of the set color of the nth second region on all carriers is determined, and each carrier above the carrier is The nth second region is set to be hollowed out to present a set color of the nth second region of the layer a in the body; wherein a and n are positive integers.
  • determine the number of layers in which the carrier of the set color of the nth second region is located on all carriers, and the nth second in the carrier above the carrier The locale is set to be hollow; where m and n are positive integers.
  • the numbers from the uppermost layer to the lowermost carrier are 1, 2, and 3, respectively, if the upper region includes the first region X, and the second region Y1, Y2, and Y3, Then, the set colors of the first region X in the carriers 1, 2, 3 may be superimposed and disposed on the first region X on the carrier 1; and for the second region Y1, if the second region in the carrier 2 If there is a color at Y1, the second region Y1 in the carrier 1 can be set to be hollow; for the second region Y2, if the second region Y2 in the carrier 3 has a color, the carrier 1 and the carrier 2 can be The second region Y2 is set to be hollowed out; for the second region Y3, if the second region Y1 in the carrier 1 has a color, since the carrier 1 is the uppermost carrier, no layer of the carrier may be subjected to the hollowing treatment.
  • the composite color of the first area needs to be acquired first, which can be implemented by the following scheme:
  • the synthesized colors of the colors of the first regions on the plurality of carriers superimposed on each other may include S201-S204:
  • the solution of the embodiment is to traverse the position of the pixel as a main line, and the traversing process is to respectively obtain corresponding set color pixel features from the same position of the set color two-dimensional code, and then synthesize a new one.
  • Structure 3D code pixel values For example, the RGB values of the pixels on the same pixel of the three set color codes that are superimposed on each other are (180, 0, 0), (0, 180, 0) and (255, 255, 255), respectively. 255, 255, 255) indicates that the current position is blank, that is, the current pixel position is a superposition of pure red and pure green, so the RGB value at the position of the pixel on the structure three-dimensional code is (180, 180, 0).
  • the RGB values of the pixels on the same pixel of the three sets of mutually set color two-dimensional codes are (180, 0, 0), (0, 180, 0) and (0, 0, 180), respectively. Representing the three set colors of pure red, pure green and pure blue respectively, then the RGB value of the synthesized structure three-dimensional code pixel is (180, 180, 180). This is a gray close to white, that is, the aforementioned light grey.
  • the color presentation method of the second region will be described below. Since the three-dimensional code having a three-dimensional structure is to be obtained in the embodiment of the present invention, it is required to adopt a three-dimensional structure for rendering in the color rendering process, and if the color of the second region is implemented as described above.
  • the method of regional color is still basically a two-dimensional code, not a three-dimensional code.
  • the multi-layered carriers stacked on each other may be processed in a color representation of the second region by means of engraving (including, for example, but not limited to, laser engraving, hand engraving) such that each layer of the carrier
  • the set color of the first area can be presented.
  • a second region of each layer of the carrier can be obtained (except for the bottommost carrier, since the bottommost carrier does not obscure the color of the second region on the other carrier, so the engraving process is not performed on the bottommost carrier)
  • the white area in the second area is engraved to make it hollow, so that the set color on the next layer of the carrier is presented through the hollow.
  • the region in which the white color is present in the second region is engraved because the white color region is still superimposed with the color at the same position on the other layer carrier. It is the set color on the other layer carrier, so it is equivalent to the part of the color not superimposed, and white does not reflect or carry any encoding information when generating the corresponding set color QR code, therefore, white can be regarded as transparent Or the occlusion portion of the color set on the lower carrier, the white portion of the second region on the carrier should be engraved.
  • the aforementioned first region and the second region are identical in position on each layer of the carrier, or the first region and the second region on each layer of the carrier are completely corresponding.
  • the local encoding rule of the structured three-dimensional code is completely compatible with the traditional two-dimensional code, and the cross-section of the structural three-dimensional code is composed of a multi-color layer material, and different colors are presented by different depths of the engraving, making full use of
  • the multi-color layer characteristic of the structural three-dimensional code realizes that a structural three-dimensional code is a combination of multiple two-dimensional codes in terms of information carrying capacity, so that the information carrying capacity of the structural three-dimensional code is multiplied, and the structural three-dimensional code cannot It is copied and has strong anti-counterfeiting capabilities.
  • the embodiment of the present invention further provides a three-dimensional code parsing method, as shown in FIG. 8 , for parsing the three-dimensional code generated by the foregoing three-dimensional code generating method, and the three-dimensional code parsing method may include S301-S304:
  • determining the plurality of set colors that make up the current three-dimensional code may include:
  • a plurality of set colors constituting the current three-dimensional code are determined according to the RGB values of the pixels in the positioning area.
  • the purpose of the link is to accurately determine which of the two sets of set color QR codes are superimposed, and by determining a plurality of set colors included in the three-dimensional code, Each set color is positioned on a two-dimensional code having the same area and the same version to obtain a two-dimensional code for each set color.
  • the three-dimensional code in the embodiment of the present invention is implemented by the superposition of the two-dimensional code, the characteristics of the two-dimensional code exist.
  • the positioning area is a feature that each of the set color two-dimensional codes exists, and each set color The corresponding set color is inevitably present in the positioning area of the two-dimensional code.
  • the obtained positioning area of the three-dimensional code is also necessarily a superimposed area of a plurality of set colors, so All the set colors included in the three-dimensional code can be parsed by the color at the positioning area.
  • the image recognition method can be used to retrieve the positioning area of the structured three-dimensional code, and the RGB values of the pixels in the positioning area can be analyzed to know which kinds of set colors the structural three-dimensional code is composed of. For example, if the RGB value is (180, 180, 0), the structure three-dimensional code is composed of two colors: pure red and pure green; RGB values (0, 180, 180) mean that the structure three-dimensional code consists of pure green and Pure blue is the two color settings; similarly, if the RGB value is (180, 180, 180), it means that the structure three-dimensional code pattern consists of three colors: pure red, pure green, and pure blue.
  • the color in actual applications, due to equipment or the like, the color usually has a certain deviation, so before determining the set color of the three-dimensional code by the RGB value, it is first necessary to judge the deviation of the color. For example, you can find pixels with RGB values higher than 200, and the values of these pixels should be 255, which should be white, so that the difference can be found. Based on these differences, batch color correction can be performed. The process of correcting the deviation adjusts the RGB value of the pixel to one of 0, 255 or 180, so that other links can be guaranteed to proceed normally.
  • extracting a plurality of set color two-dimensional codes from the three-dimensional code on a basis of each of the set colors may include: performing the following steps when extracting each set color two-dimensional code:
  • each pixel point containing the set color is determined from the current structure three-dimensional code, in a In the two-dimensional code whose area and version are the same, if the position of the pixel in the three-dimensional code containing the set color is respectively corresponding to the two-dimensional code, and the pixel points are set to the set color, and the The two-dimensional code is set to be white at the other pixel position set to the set color, and the obtained two-dimensional code is the set color two-dimensional code corresponding to the set color.
  • the same version refers to a plurality of set color two-dimensional codes that are superimposed with the original three-dimensional code of the structure.
  • the version is exactly the same, not the version of the 3D code itself.
  • the set color two-dimensional code completely follows the two-dimensional code (such as QR code) decoding rule, only the conventional two-dimensional code decoding rule is used for decoding, and details are not described herein again.
  • the two-dimensional code such as QR code
  • the obtained sets of character information are inversely processed, and the corresponding decoded information can be synthesized.
  • each set of character information currently obtained is the decoding information of the three-dimensional code.
  • the method for generating a three-dimensional code may include: superimposing a plurality of carriers provided with the two-dimensional code in a preset order, and superimposing the regions where the two-dimensional codes on the different carriers are overlapped; wherein the carriers are superimposed The color of the upper two-dimensional code is different, and the information represented is at least partially different; respectively, the first region and the second region formed on each carrier after superposition are determined; wherein, for any carrier to be superimposed, the first region is The two-dimensional code on the carrier has a color superimposed area with the two-dimensional code on the other carrier, and the second area is a region in which the two-dimensional code on the carrier does not overlap with the two-dimensional code on any other carrier; a composite color of the color of the first region on the plurality of stacked carriers and presented, and processing a plurality of carriers stacked on each other to cause the color of the second region on each of the carriers to be presented The three-dimensional code of the three-dimensional structure.
  • a computer readable storage medium storing computer executable instructions that, when executed by a processor, implement the three-dimensional code generation method and the three-dimensional code analysis method.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Processing Or Creating Images (AREA)

Abstract

一种三维码的生成和解析方法,该生成方法包括:将多个设置有二维码的载体进行叠加,叠加后不同载体上的二维码所在区域重合;每个载体上的二维码的颜色不同且所表示的信息至少部分不同(S101);分别确定叠加后在每个载体上形成的第一区域和第二区域;对于任一载体,第一区域是本载体上的二维码与其它载体上的二维码存在颜色叠加的区域,第二区域是不存在颜色叠加的区域(S102);获取相互叠加的多个载体上第一区域的颜色的合成颜色并呈现出来,并对相互叠加的多个载体进行处理以使每层载体上第二区域的颜色呈现出来,获取该三维码(S103)。

Description

三维码生成和解析方法 技术领域
本文涉及但不限于编解码技术,尤指三维码生成和解析方法。
背景技术
传统二维码于上世纪九十年代在日本问世,如今已在世界范围内广泛使用。二维码具有信息容量大、编码范围广、译码可靠性高等多种优点,然而二维码属于平面图形,容易被复制,因此在防伪方面还有很大的缺陷。
发明概述
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
三维码生成和解析方法,可以克服二维码容易被复制的缺陷,提高防伪功能,并扩大信息容量。
三维码生成方法,该方法可以包括:
将多个设置有二维码的载体按照预设顺序进行叠加,叠加后不同载体上的二维码所在区域相重合;其中,进行叠加的每个载体上的二维码的颜色不同,且所表示的信息至少部分不同;
分别确定叠加后在每个载体上形成的第一区域和第二区域;其中,对于进行叠加的任一载体,第一区域是本载体上的二维码与其它载体上的二维码存在颜色叠加的区域,第二区域是本载体上的二维码未和任何其它载体上的二维码存在颜色叠加的区域;
获取相互叠加的多个载体上的所述第一区域的颜色叠加而成的合成颜色并呈现出来,并对相互叠加的多个载体进行处理,以使每层载体上所述第二区域的颜色呈现出来,获取具有立体结构的三维码。
在示例性实施例中,所述对相互叠加的多个载体进行处理,以使每层载体上所述第二区域的颜色呈现出来包括:
对于叠加后位于最顶层的载体以外的每一层载体,分别进行如下操作:
对于该层载体上的每个第二区域,分别在叠加后位于该层载体以上的每层载体中,将相应于该第二区域的区域进行镂空,使该第二区域的颜色从叠加后的载体的顶层呈现出来。
在示例性实施例中,该方法还可以包括:在将多个设置有二维码的载体按照预设顺序进行叠加之前,根据待编码对象确定每个载体上的二维码;
根据待编码对象确定每个载体上的二维码可以包括:
直接根据待编码对象生成多个具有不同设定颜色、相同面积和相同版本的第一二维码,其中第一二维码的版本根据待编码对象的字符长度来确定,将每个第一二维码按照一一对应的关系分别确定为不同载体上的二维码;或者,
根据待编码对象的字符长度将待编码对象等分为多个子对象,将多个子对象分别生成多个具有不同设定颜色、相同面积和相同版本的第二二维码,其中,第二二维码的版本根据子对象的字符长度来确定,将每个第一二维码按照一一对应的关系分别确定为不同载体上的二维码。
在示例性实施例中,所述的三维码生成方法还可以包括:在根据待编码对象确定每个载体上的二维码后,将每个载体对应的二维码以不同的设定颜色设置在每个载体上。
在示例性实施例中,所述将每个载体对应的二维码以不同的设定颜色设置在每个载体上可以包括:
将每个二维码上的定位区域和信息区域设置为同一设定颜色,并将每个二维码上除所述定位区域和所述信息区域以外的区域设置为空白区域或设置为白色;将该二维码设置在相应的载体上。
在示例性实施例中,获取相互叠加的多个载体上的第一区域的颜色的合成颜色可以包括:
根据预设的遍历顺序对每层载体上第一区域包含的第一像素点的位置进行遍历;
获取每层载体上每一个第一像素点的红绿蓝RGB值;
对多层载体上对应于同一个位置的第一像素点的RGB值进行合成,将合成后的RGB值对应的颜色设置为第一像素点的位置上的颜色。
在示例性实施例中,该方法还可以包括:
获取与二维码的尺寸相同的覆盖层;其中,覆盖层上与每个载体的第一区域相对应的区域的颜色为该合成颜色,第二区域为镂空的;
将覆盖层对应覆盖在经过物理叠加的多个载体的最上层,与多个载体共同构成三维码。
在示例性实施例中,二维码为快速反应QR码。
在示例性实施例中,每个载体上的二维码的颜色为设定颜色;该设定颜色包括:红色、绿色或蓝色。
在示例性实施例中,多个具有相同面积和相同版本的二维码中每个设定颜色对应的像素的RGB值小于或等于180。
三维码解析方法,用于对前述的三维码生成方法所生成的三维码进行解析,该三维码解析方法可以包括:
确定组成当前三维码的多个设定颜色;
分别以每一个设定颜色为基础从三维码中提取出多个设定颜色二维码;
按照预设的解码规则对每一个设定颜色二维码进行解析获取每一个设定颜色二维码对应的字符信息;
根据多个设定颜色二维码对应的字符信息获取三维码的解码信息。
在示例性实施例中,确定组成当前三维码的多个设定颜色可以包括:
通过图像识别技术获取所述三维码的定位区域;
确定定位区域中像素的RGB值;
根据定位区域中像素的RGB值确定出组成当前三维码的多个设定颜色。
在示例性实施例中,分别以每一个设定颜色为基础从三维码中提取出多个设定颜色二维码可以包括:在提取每一个设定颜色二维码时,执行以下步骤:
根据所述三维码中每一个像素点的RGB值确定出包含想要获取的第一 设定颜色的全部像素点;
在与所述三维码具有相同面积和相同版本的二维码上,将包含所述第一设定颜色的全部像素点对应的位置确定为所述第一设定颜色,并将不包含所述第一设定颜色的全部像素点对应的位置确定为白色或空白区域,组成与所述第一设定颜色对应的设定颜色二维码。
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现所述的三维码生成方法和三维码解析方法。
本发明实施例的三维码生成方法可以包括:将多个设置有二维码的载体按照预设顺序进行叠加,叠加后不同载体上的二维码所在区域相重合;其中,进行叠加的各载体上的二维码的颜色不同,且所表示的信息至少部分不同;分别确定叠加后在各载体上形成的第一区域和第二区域;其中,对于进行叠加的任一载体,第一区域是本载体上的二维码与其它载体上的二维码存在颜色叠加的区域,第二区域是本载体上的二维码未和任何其它载体上的二维码存在颜色叠加的区域;获取相互叠加的多个载体上的所述第一区域的颜色的合成颜色并呈现出来,并对相互叠加的多个载体进行处理,以使每层载体上所述第二区域的颜色呈现出来,获取具有立体结构的三维码。通过该实施例方案,克服了二维码容易被复制的缺陷,提高了防伪功能,并扩大了信息容量。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1为本发明实施例的三维码生成方法流程图;
图2为本发明实施例的纯红、纯绿、纯蓝三个设定颜色分别对应的设定颜色二维码示意图;
图3为本发明实施例的多个设定颜色二维码物理叠加示意图;
图4(a)为本发明实施例的纯红色二维码和纯绿色二维码的物理叠加方法示意图;
图4(b)为本发明实施例的纯红色二维码和纯绿色二维码进行物理叠加 后的获得的三维码的色彩分布示意图;
图5(a)为本发明实施例的纯红色二维码、纯绿色二维码和纯蓝色二维码的物理叠加方法示意图;
图5(b)为本发明实施例的纯红色二维码、纯绿色二维码和纯蓝色二维码进行物理叠加后的获得的三维码的色彩分布示意图;
图6为本发明实施例的覆盖层示意图;
图7为本发明实施例的将最上层的载体上第一区域的颜色设置为相互叠加的多个设定颜色的合成颜色的方法流程图;
图8为本发明实施例的三维码解析方法流程图。
详述
下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
实施例一
本发明实施例提供了三维码生成方法,如图1所示,该方法可以包括S101-S104:
S101、将多个设置有二维码的载体按照预设顺序进行叠加,叠加后不同载体上的二维码所在区域相重合;其中,进行叠加的各载体上的二维码的颜色不同,且所表示的信息至少部分不同。
在示例性实施例中,为了体现三维码的结构特征,需要通过载体来承载生成的多个设定颜色二维码,然后对该多个设定颜色二维码的载体进行叠加,使得多个设定颜色二维码形成立体结构,从而获得具有立体结构的三维码,其叠加示意图如图3所示。
在示例性实施例中,该载体可以包括但不限于:纸张、一种或多种材料 的薄片(如木片、金属片、塑料片、合成材料薄片等)以及固体涂层等。
在示例性实施例中,该方法还可以包括:在将多个设置有二维码的载体按照预设顺序进行叠加之前,根据待编码对象获取每个载体上的二维码。
在示例性实施例中,该待编码对象可以是包括网页链接以及身份信息在内的任何信息,根据该待编码对象和已有的任意一种二维码生成规则可以生成一个或多个二维码,并将该一个或多个二维码设置在上述的二维码的载体上,以通过该多个载体的叠加来获取三维码。
在示例性实施例中,在每个载体上的二维码是指在载体上设置色块区域,这些色块区域与空白区域/白色区域按照一定规则组织和交错,形成每个载体上的二维码,如图2中二维码所示。
在示例性实施例中,该二维码可以为快速反应QR码。
在示例性实施例中,上述的二维码可以是当前存在的任何类型的二维码,对于其类型不做限制。该二维码可以包括:条形二维码和矩阵式二维码,其中包括但不限于QR码。
在示例性实施例中,将以QR码为例来说明本发明实施例方案。
在示例性实施例中,为了便于识别三维码生成过程中的合成颜色,以及易于在三维码解析过程中对颜色进行解析及识别,该预设颜色可以是未经过任何颜色合成的原色,例如,可以为RGB三原色,即红(R)、绿(G)、蓝(B)。
在示例性实施例中,计算机的三原色是红(R)、绿(G)、蓝(B),也就是说每一个像素点都具有RGB值,之所以能表现五彩斑斓的世界,只是因为每个像素点的RGB值不同。比如:RGB值为(0,0,0)意思是红绿蓝的比重都到了最低,RGB值(0,0,0)代表的就是黑色;反之,RGB值为(255,255,255)时,也就是红绿蓝的含量达到最高值,RGB值(255,255,255)表示的颜色就是白色。同样,如果RGB值为(255,0,0)表示纯红,(0,255,0)表示纯绿,(0,0,255)表示纯蓝。因此,就因为RGB值的变化为我们呈现了多种多样的色彩。
在示例性实施例中,根据待编码对象获取每个载体上的二维码可以包括:
直接根据待编码对象生成多个具有不同设定颜色、相同面积和相同版本的第一二维码,其中第一二维码的版本根据待编码对象的字符长度来确定,将每个第一二维码按照一一对应的关系分别确定为不同载体上的二维码;或者,
根据待编码对象的字符长度将待编码对象等分为多个子对象,将多个子对象分别生成多个具有不同设定颜色、相同面积和相同版本的第二二维码,其中,第二二维码的版本根据子对象的字符长度来确定,将每个第一二维码按照一一对应的关系分别确定为不同载体上的二维码。
在示例性实施例中,相同面积的二维码图案的密度与二维码的版本息息相关,承载内容越长需要的版本号越高。版本号不同会导致相同面积上的图形符号位置发生偏差,以至于无法准确融合,进而无法解码,因此本发明实施例中生成的多个设定颜色二维码需要具有相同面积和相同版本。
在示例性实施例中,基于上述原理,当待编码对象的字符长度较小,采用较低版本的二维码即可承载该待编码对象的信息时,可以直接根据整个待编码对象的全部字符分别生成多个具有相同面积和相同版本的设定颜色二维码,即上述的第一二维码。
在示例性实施例中,还可以根据需要对待编码对象进行等分,即根据待编码对象的字符长度,将当前待编码对象等分为多个具有相同字符长度的子对象,其中,该多个子对象的字符长度的综合等于进行等分之前的原始编码对象的字符长度。
在示例性实施例中,根据待编码对象的字符长度对待编码对象进行等分可以确保多个子对象可以采用相同版本的二维码进行编码,以生成多个具有不同设定颜色、相同面积和相同版本的二维码,即上述的第二二维码。
在示例性实施例中,每个载体上的二维码的颜色为设定颜色;该设定颜色可以包括:红色、绿色或蓝色(RGB三原色)。
在示例性实施例中,为了避免生成的颜色在进行解码时难以识别,生成设定颜色二维码的该设定颜色可以是红色、绿色和蓝色这三原色中的任意两种或三种。即生成的多个设定颜色二维码可以是两个,也可以是三个,以便 后续方案中对任意两种设定颜色的二维码进行叠加,或者对三种设定颜色的二维码进行叠加。
在示例性实施例中,所述的三维码生成方法还可以包括:在根据待编码对象确定每个载体上的二维码后,将每个载体对应的二维码以不同的设定颜色设置在每个载体上。
在示例性实施例中,所述将每个载体对应的二维码以不同的设定颜色设置在每个载体上可以包括:
将每个二维码上的定位区域和信息区域设置为同一设定颜色,并将每个二维码上除所述定位区域和所述信息区域以外的区域设置为空白区域或设置为白色;将该二维码设置在相应的载体上。
在示例性实施例中,二维码是由多个色块按照特定规律排列构成的,色块的分布可以用于表示特定信息。
在示例性实施例中,将二维码设置在载体上可以是指:将二维码【相当于二维码是有颜色的部分】的色块分布在载体上,色块和白色/空白区域相间,从而能够显现出二维码。
在示例性实施例中,如图2所示,为三种设定颜色二维码图案示意图。
在示例性实施例中,通过上述方案实现了通过多个二维码图案承载三维码的内容。
在示例性实施例中,多个载体的叠加顺序可以根据应用场景、实际需求或个人喜好进行自定义,对于叠加顺序不做限定。例如,对于纯红色二维码和纯绿色二维码的叠加,可以将纯红色二维码叠放在上层,将纯绿色二维码叠放在下层,也可以将纯红色二维码叠放在下层,将纯绿色二维码叠放在上层。在实施时,可以随机确定叠加顺序,也可以预先人为规定叠加顺序。
S102、分别确定叠加后在每载体上形成的第一区域和第二区域;其中,对于进行叠加的任一载体,第一区域是本载体上的二维码与其它载体上的二维码存在颜色叠加的区域,第二区域是本载体上的二维码未和任何其它载体上的二维码存在颜色叠加的区域。其他载体是指参与叠加的全部载体中除本载体以外的任何一个或多个载体。
在示例性实施例中,仍以纯红色二维码和纯绿色二维码为例来说明两个设定颜色二维码的物理叠加过程,如图4(a)所示,为纯红色二维码和纯绿色二维码的物理叠加方法示意图,图4(b)为进行物理叠加后的获得的三维码的色彩分布示意图。
在示例性实施例中,从图4(b)可以看出,结构三维码图案中的黄色是由红色和绿色叠加而成的,即上述的第一区域,同时结构三维码图案中还有纯红和纯绿部分,这意味着此区域尚未叠加,即上述的第二区域。
在示例性实施例中,以纯红色二维码、纯绿色二维码和纯蓝色二维码为例来说明三个设定颜色二维码的物理叠加过程,如图5(a)所示,为纯红色二维码、纯绿色二维码和纯蓝色二维码的物理叠加方法示意图,图5(b)为进行物理叠加后的获得的三维码的色彩分布示意图。
在示例性实施例中,从图5(b)可以看出,结构三维码图案中的灰色(浅灰色)是三种设定颜色(纯红、纯绿、纯蓝)的叠加,而黄色、紫色和青色分别是纯红和纯绿、纯红和纯蓝,以及纯蓝和纯绿的叠加。
在示例性实施例中,多个具有相同面积和相同版本的二维码中每个设定颜色对应的像素的RGB值小于或等于180。
在示例性实施例中,由于三个含量为100%的RGB三原色叠加之后,将形成白色,但通常为了更能有力地体现三维码的色彩效果,三维码的背景色彩通常采用白色,因此如果三维码中出现三个设定颜色的叠加部分时(通常会出现在定位区域),会导致结构三维码无法进行定位和解析,因此,为了保证三设定颜色融合后能和白色区别开来,设定颜色含量不能高于70%,也就是180左右(本申请中以180为例),在实施中可以根据实际需求对设定颜色含量进行适当的调整。
在示例性实施例中,基于该设定颜色含量的限制,上述实施例中三种设定颜色(纯红、纯绿、纯蓝)的叠加区域呈现灰色(浅灰色)。
在示例性实施例中,在上述的物理叠加过程中,由于多个设定颜色二维码的面积和版本均相同,这就决定了位于同一像素点的位置在合并前后都是一致的。
在示例性实施例中,由于三维码中不同的颜色代表着不同的信息,因此结构三维码的存储能力至少可以达到传统二维码容量的2至3倍,扩充了传统二维码的信息容量。
S103、获取相互叠加的多个载体上的所述第一区域的颜色的合成颜色并呈现出来,并对相互叠加的多个载体进行处理,以使每层载体上所述第二区域的颜色呈现出来,获取具有立体结构的三维码。
在示例性实施例中,通过上述叠加,便可以获得三维码上不同区域的颜色,由于本发明实施例的三维码是通过多个设定颜色二维码的载体的物理叠加获得的,因此在进行叠加时在三维码的表面上相应的第一区域不会直接呈现出叠加后的颜色,同理,处于非最上层的载体上的第二区域的设定颜色由于在该载体上方的载体的遮挡也不会直接呈现出来,因此,为了实现通过多种色彩来反映三维码所承载的信息,需要对三维码的载体进行处理,以使得第一区域的合成颜色和第二区域的设定颜色均能直观地呈献给用户。
在示例性实施例中,获取相互叠加的多个载体上的所述第一区域的颜色的合成颜色并呈现出来可以包括:对于每个第一区域执行以下操作:
对于任意的第m个第一区域,确定出全部载体上该第m个第一区域的设定颜色,并将确定出的全部设定颜色进行颜色合成,将合成后的颜色设置在在最上层载体的第m个第一区域处;其中,m为正整数。
在示例性实施例中,首先对于第一区域的合成颜色,可以直接通过最上层的载体进行呈现,例如,可以通过重新着色(例如印刷、喷涂、烫印等)将合成后的颜色设置在最上层载体表面上的第一区域;在其它实施例中还可以在最上层载体表面上增加一层覆盖层,以通过该覆盖层来呈现合成后的颜色,实施方案可以如下所述:
在示例性实施例中,该方法还可以包括:
获取与二维码的尺寸相同的覆盖层;其中,覆盖层上与每个载体的第一区域相对应的区域的颜色为所叠加的设定颜色的合成颜色,第二区域为镂空的。
将覆盖层对应覆盖在经过物理叠加的多个载体的最上层,与多个载体共 同构成三维码。
在示例性实施例中,该第二区域镂空是为了后续呈现每个载体上的第二区域的设定颜色而做准备。
在示例性实施例中,覆盖层的示意图如图6所示,本申请中对于该覆盖层的材质和实现方法均不作限制。
在示例性实施例中,该覆盖层可以是张贴的一层具有颜色的薄膜,也可以是与上述载体的材质和面积均相同,且在第一区域部分设置有合成颜色的新载体。
在示例性实施例中,所述对相互叠加的多个载体进行处理,以使每层载体上所述第二区域的颜色呈现出来可以包括:
对于叠加后位于最顶层的载体以外的每一层载体,分别进行如下操作:
对于该层载体上的每个第二区域,分别在叠加后位于该层载体以上的每层载体中,将相应于该第二区域的区域进行镂空,使该第二区域的颜色从叠加后的载体的顶层呈现出来。
在示例性实施例中,对于任意的第n个第二区域,确定出全部载体上该第n个第二区域具有的设定颜色的载体所在的层数a,将该载体以上每一层载体中的该第n个第二区域设置为镂空的,以呈现出第a层在体中的第n个第二区域具有的设定颜色;其中,a、n均为正整数。对于任意的第n个第二区域,确定出全部载体上该第n个第二区域具有的设定颜色的载体所在的层数,将该载体以上每一层载体中的该第n个第二区域设置为镂空的;其中,m、n均为正整数。
在示例性实施例中,例如,如果三层载体叠加,从最上层到最下层载体的编号分别为1、2、3,如果上面包含第一区域X,以及第二区域Y1、Y2、Y3,则可以将载体1、2、3中第一区域X处所具有的设定颜色进行叠加后设置于载体1上的第一区域X处;并且对于第二区域Y1,如果载体2中的第二区域Y1处具有颜色,则可以将载体1中的第二区域Y1处设置为镂空的;对于第二区域Y2,如果载体3中的第二区域Y2处具有颜色,则可以将载体1、载体2中的第二区域Y2处均设置为镂空的;对于第二区域Y3,如果载 体1中的第二区域Y1处具有颜色,由于载体1为最上层载体,则可以不对任何一层载体进行镂空处理。
在示例性实施例中,在实施上述方案之前,需要先获取第一区域的合成颜色,可以通过以下方案实现:
在示例性实施例中,如图7所示,获取相互叠加的多个载体上的第一区域的颜色的合成颜色可以包括S201-S204:
S201、根据预设的遍历顺序对每层载体上第一区域包含的第一像素点的位置进行遍历;
S202、获取每层载体上每一个第一像素点的红绿蓝RGB值;
S203、对多层载体上对应于同一个位置的第一像素点的RGB值进行合成;
S204、将合成后的RGB值对应的颜色设置为第一像素点的位置的颜色。
在示例性实施例中,该实施例方案是以像素点的位置为主线进行遍历,遍历的过程就是分别从设定颜色二维码的相同位置获取相应的设定颜色像素特征,再合成新的结构三维码像素值。比如:三个相互叠加的设定颜色二维码的同一像素点上像素的RGB值分别是(180,0,0)、(0,180,0)以及(255,255,255),由于(255,255,255)表示当前位置是空白的,也就是说当前像素点位置是纯红和纯绿的叠加,因此结构三维码上该像素点位置处的RGB值为(180,180,0),表示黄色。同理,三个相互叠加的设定颜色二维码的同一像素点上像素的RGB值分别是(180,0,0)、(0,180,0)和(0,0,180)时,分别代表的是纯红、纯绿和纯蓝三种设定颜色,那么合成的结构三维码像素点的RGB值为(180,180,180)这是一种接近于白色的灰色,即前述的浅灰色。这样遍历完成之后,结构三维码图案上所有像素点的像素特征(即RGB值及其代表的颜色)都明确了,结构三维码的第一区域的图案也就形成了。
在示例性实施例中,下面对于第二区域的颜色呈现方法进行说明。由于本发明实施例中想要获得的是具有立体结构的三维码,因此,在色彩呈现的处理上需要采用立体结构来呈现,如果该第二区域的颜色的实现方法也如同 上述的呈现第一区域颜色的方法,则实质上获得的仍然是一个二维码,并不是三维码。
在示例性实施例中,在第二区域的颜色呈现上可以采用雕琢(例如包括但不限于激光雕刻、手工雕刻)的方式对相互叠加的多层载体进行处理,以使得每一层载体上的第一区域的设定颜色均能呈现出来。具体地,可以获得每一层载体的第二区域(最底层载体除外,因为最底层载体不会对其他载体上的第二区域的颜色造成遮挡,因此不用对最底层载体进行雕刻处理),对于第二区域中呈现白色的区域进行雕刻,使其为镂空的,以通过该镂空呈现出下一层载体上的设定颜色。
在示例性实施例中,需要说明的是,上述方案中对于第二区域中呈现白色的区域进行雕刻是因为,呈现白色的区域与其它层载体上的相同位置出的颜色进行叠加时呈现的仍然是其他层载体上的设定颜色,因此,相当于该部分颜色未叠加,而且在生成相应的设定颜色二维码时白色并未反映或承载任何编码信息,因此,白色可以看作是透明的或者是对下层载体上设定颜色的遮挡部分,应该对载体上第二区域的白色部分进行雕刻。
在示例性实施例中,前述的第一区域和第二区域在每一层载体上的位置均是相同的,或者说每一层载体上的第一区域和第二区域时完全相对应的。
在示例性实施例中,结构三维码的局部编码规则完全兼容传统二维码,并且结构三维码的横截面是由多色层材料构成的,并通过雕琢深浅不同而呈现不同的颜色,充分利用了结构三维码的多色层特性,实现了一个结构三维码在信息承载能力方面是多个二维码的综合体,故而使得结构三维码的信息承载能力得到成倍增长,而且结构三维码不能被复制,同时具备了强大的防伪能力。
实施例二
本发明实施例还提供了三维码解析方法,如图8所示,用于对前述的三维码生成方法所生成的三维码进行解析,该三维码解析方法可以包括S301-S304:
S301、确定组成当前三维码的多个设定颜色。
在示例性实施例中,确定组成当前三维码的多个设定颜色可以包括:
通过图像识别技术获取所述三维码的定位区域;
确定定位区域中像素的RGB值;
根据定位区域中像素的RGB值确定出组成当前三维码的多个设定颜色。
在示例性实施例中,该环节的目的就是准确的判定结构三维码由哪几种设定颜色二维码叠加而成,可以通过确定三维码中所包含的多个设定颜色以后,再对每一个设定颜色在具有相同面积和相同版本的二维码上进行定位便可以获取每一个设定颜色二维码。
在示例性实施例中,由于本发明实施例中的三维码时依托于二维码的叠加实现的,因此二维码的特性均存在。例如,对于由多个设定颜色的QR码叠加获得的三维码来说,其上也存在定位区域,而且定位区域是每一个设定颜色二维码均存在的特征,且每个设定颜色二维码的定位区域处必然会呈现相应的设定颜色,在对多个设定颜色二维码叠加后,获得的三维码的定位区域处也必然是多个设定颜色的叠加区域,因此通过定位区域处的颜色便可以解析出该三维码所包含的全部设定颜色。例如,可以使用图像识别的方法检索到结构三维码的定位区域,分析定位区域中像素的RGB值就能知道结构三维码由哪几种设定颜色组成。例如:如果RGB值为(180,180,0)意味着结构三维码由纯红和纯绿两种设定颜色组成;RGB值为(0,180,180)意味着结构三维码由纯绿和纯蓝两种设定颜色组成;同样,如果RGB值为(180,180,180)则意味着结构三维码图案由纯红、纯绿、纯蓝三种设定颜色组成。
在示例性实施例中,在实际应用中由于设备等原因,颜色通常会出现一定的偏差,所以在通过RGB值确定三维码的设定颜色之前,首先需要判断颜色的偏差情况。例如,可以找出RGB值都高于200的像素点,而这些像素点的值都应该是255,应该是呈白色,这样这个差值就能找到,根据这些差值就可以进行批量色彩纠偏。纠偏的过程将像素点的RGB值调整成为:0、255或是180中的一个,这样就可以保证其他环节的正常进行。
S302、分别以每一个设定颜色为基础从三维码中提取出多个设定颜色二 维码。
在示例性实施例中,分别以每一个设定颜色为基础从三维码中提取出多个设定颜色二维码可以包括:在提取每一个设定颜色二维码时,执行以下步骤:
根据所述三维码中每一个像素点的RGB值确定出包含想要获取的第一设定颜色的全部像素点;
在与所述三维码具有相同面积和相同版本的二维码上,将包含所述第一设定颜色的全部像素点对应的位置确定为所述第一设定颜色,并将不包含所述第一设定颜色的全部像素点对应的位置确定为白色或空白区域,组成与所述第一设定颜色对应的设定颜色二维码。
在示例性实施例中,通过前述方案获取了结构三维码中包含的设定颜色以后,从当前的结构三维码中确定出每一个含有该设定颜色的像素点,在一个与该三维码的面积和版本均相同的二维码中,如果将三维码中含有该设定颜色的像素点所在的位置分别对应到该二维码上,并将这些像素点设置为该设定颜色,并且该二维码上除去设置为该设定颜色的其他像素点位置处均设置为白色,则获得的二维码便是与该设定颜色对应的设定颜色二维码。
在示例性实施例中,“在与所述三维码具有相同面积和相同版本的二维码上”其中“相同版本”是指与原来叠加组成该结构三维码的多个设定颜色二维码的版本完全相同,并非三维码本身的版本。
S303、按照预设的解码规则对每一个设定颜色二维码进行解析获取每一个设定颜色二维码对应的字符信息;
在示例性实施例中,由于设定颜色二维码完全遵循二维码(如QR码)解码规则,这里只需使用传统的二维码解码规则进行解码即可,此处不再赘述。
S304、根据多个设定颜色二维码对应的字符信息获取三维码的解码信息。
在示例性实施例中,根据前述的对待编码对象进行等分的原则,对获得的多组字符信息进行逆处理,便可以合成相应的解码信息。
在示例性实施例中,如果最初对于待编码对象并未等分,则当前获得的 每一组字符信息便是三维码的解码信息。
本发明实施例的三维码生成方法可以包括:将多个设置有二维码的载体按照预设顺序进行叠加,叠加后不同载体上的二维码所在区域相重合;其中,进行叠加的各载体上的二维码的颜色不同,且所表示的信息至少部分不同;分别确定叠加后在各载体上形成的第一区域和第二区域;其中,对于进行叠加的任一载体,第一区域是本载体上的二维码与其它载体上的二维码存在颜色叠加的区域,第二区域是本载体上的二维码未和任何其它载体上的二维码存在颜色叠加的区域;获取相互叠加的多个载体上的所述第一区域的颜色的合成颜色并呈现出来,并对相互叠加的多个载体进行处理,以使每层载体上所述第二区域的颜色呈现出来,获取具有立体结构的三维码。通过该实施例方案,克服了二维码容易被复制的缺陷,提高了防伪功能,并扩大了信息容量。
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现所述的三维码生成方法和三维码解析方法。
虽然本发明实施例所揭露的实施方式如上,但所述的内容仅为便于理解本发明而采用的实施方式,并非用以限定本发明实施例。任何本发明实施例所属领域内的技术人员,在不脱离本发明实施例所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本发明实施例的专利保护范围,仍须以所附的权利要求书所界定的范围为准。

Claims (14)

  1. 一种三维码生成方法,所述方法包括:
    将多个设置有二维码的载体按照预设顺序进行叠加,叠加后不同载体上的二维码所在区域相重合;其中,进行叠加的每个载体上的二维码的颜色不同,且所表示的信息至少部分不同;
    分别确定叠加后在每个载体上形成的第一区域和第二区域;其中,对于进行叠加的任一载体,第一区域是本载体上的二维码与其它载体上的二维码存在颜色叠加的区域,第二区域是本载体上的二维码未和任何其它载体上的二维码存在颜色叠加的区域;
    获取相互叠加的多个载体上的所述第一区域的颜色叠加而成的合成颜色并呈现出来,并对相互叠加的多个载体进行处理,以使每层载体上所述第二区域的颜色呈现出来,获取具有立体结构的三维码。
  2. 根据权利要求1所述的三维码生成方法,其中,所述对相互叠加的多个载体进行处理,以使每层载体上所述第二区域的颜色呈现出来包括:
    对于叠加后位于最顶层的载体以外的每一层载体,分别进行如下操作:
    对于该层载体上的每个第二区域,分别在叠加后位于该层载体以上的每层载体中,将相应于该第二区域的区域进行镂空,使该第二区域的颜色从叠加后的载体的顶层呈现出来。
  3. 根据权利要求1所述的三维码生成方法,还包括:在将多个设置有二维码的载体按照预设顺序进行叠加之前,根据待编码对象确定每个载体上的二维码;
    所述根据待编码对象确定每个载体上的二维码包括:
    直接根据所述待编码对象获取多个具有不同设定颜色、相同面积和相同版本的第一二维码,其中所述第一二维码的版本根据所述待编码对象的字符长度来确定,将每个第一二维码按照一一对应的关系分别确定为不同载体上的二维码;或者,
    根据所述待编码对象的字符长度将所述待编码对象等分为多个子对象,将所述多个子对象分别生成多个具有不同设定颜色、相同面积和相同版本的 第二二维码,其中,所述第二二维码的版本根据所述子对象的字符长度来确定;将每个第二二维码按照一一对应的关系分别确定为不同载体上的二维码。
  4. 根据权利要求1所述的三维码生成方法,还包括:在根据待编码对象确定每个载体上的二维码后,将每个载体对应的二维码以不同的设定颜色设置在每个载体上。
  5. 根据权利要求4所述的三维码生成方法,其中,所述将每个载体对应的二维码以不同的设定颜色设置在每个载体上包括:
    将每个二维码上的定位区域和信息区域设置为同一设定颜色,并将每个二维码上除所述定位区域和所述信息区域以外的区域设置为空白区域或设置为白色;将该二维码设置在相应的载体上。
  6. 根据权利要求1所述的三维码生成方法,其中,所述获取相互叠加的多个载体上的所述第一区域的颜色的合成颜色包括:
    根据预设的遍历顺序对每层载体上所述第一区域包含的第一像素点的位置进行遍历;
    获取每层载体上每一个第一像素点的红绿蓝RGB值;
    对多层载体上对应于同一个位置的第一像素点的RGB值进行合成;
    将合成后的RGB值对应的颜色设置为第一像素点的位置上的颜色。
  7. 根据权利要求1-6任意一项所述的三维码生成方法,其特征在于,还包括:
    获取与所述二维码的尺寸相同的覆盖层;其中,所述覆盖层上与每个载体的第一区域相对应的区域的颜色为所述合成颜色,所述第二区域为镂空的;
    将所述覆盖层对应覆盖在经过物理叠加的多个载体的最上层,与所述多个载体共同构成所述三维码。
  8. 根据权利要求1-6任意一项所述的三维码生成方法,其中,所述二维码为快速反应QR码。
  9. 根据权利要求1-6任意一项所述的三维码生成方法,其特征在于,每个载体上的二维码的颜色为设定颜色;所述设定颜色包括:红色、绿色或蓝色。
  10. 根据权利要求1-6任意一项所述的三维码生成方法,其中,所述多个具有相同面积和相同版本的二维码中每个设定颜色对应的像素的RGB值小于或等于180。
  11. 一种三维码解析方法,用于对基于权利要求1-10任意一项所述的三维码生成方法所生成的三维码进行解析,所述三维码解析方法包括:
    确定组成当前三维码的多个设定颜色;
    分别以每一个设定颜色为基础从所述三维码中提取出多个设定颜色二维码;
    按照预设的解码规则对每一个设定颜色二维码进行解析获取所述每一个设定颜色二维码对应的字符信息;
    根据多个设定颜色二维码对应的字符信息获取三维码的解码信息。
  12. 根据权利要求11所述的三维码解析方法,其中,所述确定组成当前三维码的多个设定颜色包括:
    通过图像识别技术获取所述三维码的定位区域;
    确定所述定位区域中像素的RGB值;
    根据所述定位区域中像素的RGB值确定出组成当前三维码的多个设定颜色。
  13. 根据权利要求11所述的三维码解析方法,其中,所述分别以每一个设定颜色为基础从所述三维码中提取出多个设定颜色二维码包括:在提取每一个设定颜色二维码时,执行以下步骤:
    根据所述三维码中每一个像素点的RGB值确定出包含想要获取的第一设定颜色的全部像素点;
    在与所述三维码具有相同面积和相同版本的二维码上,将包含所述第一设定颜色的全部像素点对应的位置确定为所述第一设定颜色,并将不包含所 述第一设定颜色的全部像素点对应的位置确定为白色或空白区域,组成与所述第一设定颜色对应的设定颜色二维码。
  14. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现如权利要求1-10任意一项所述的三维码生成方法,以及如权利要求11-13任意一项所述的三维码解析方法。
PCT/CN2019/072372 2018-05-11 2019-01-18 三维码生成和解析方法 WO2019214291A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810451122.0 2018-05-11
CN201810451122.0A CN108694430B (zh) 2018-05-11 2018-05-11 三维码生成和解析方法

Publications (1)

Publication Number Publication Date
WO2019214291A1 true WO2019214291A1 (zh) 2019-11-14

Family

ID=63847336

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/072372 WO2019214291A1 (zh) 2018-05-11 2019-01-18 三维码生成和解析方法

Country Status (2)

Country Link
CN (1) CN108694430B (zh)
WO (1) WO2019214291A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022233458A1 (de) * 2021-05-04 2022-11-10 Armin Khadjavi 3d-code

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108694430B (zh) * 2018-05-11 2021-08-03 海南天鉴防伪科技有限公司 三维码生成和解析方法
CN110210596B (zh) * 2019-04-17 2020-05-19 清华大学 一种形成双层快速响应矩阵码符号的装置及方法
CN110348553B (zh) * 2019-06-30 2021-01-26 东莞市恒德光电设备制造有限公司 一种随机三维码的激光标刻方法
CN111222611B (zh) * 2020-01-18 2023-07-07 江苏提米智能科技有限公司 一种基于颜色的堆叠式三维码编码方法、编码装置、解码方法、解码装置以及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202075754U (zh) * 2011-05-18 2011-12-14 深圳市鑫全图科技有限公司 隐形三维码输出输入装置
CN105760914A (zh) * 2016-02-01 2016-07-13 中国计量学院 拉曼三维码的生成方法及识别方法
US20160350568A1 (en) * 2015-05-27 2016-12-01 Victor Zazzu Two-dimensional (2-d) code generating method, detecting method, detecting apparatus, and anti-counterfeit label
CN108694430A (zh) * 2018-05-11 2018-10-23 李峰 三维码生成和解析方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104680218B (zh) * 2015-02-12 2018-07-31 航天信息股份有限公司 一种多空间二维码及其生成、解码方法
CN104615791A (zh) * 2015-03-09 2015-05-13 浪潮集团有限公司 一种三维码的生成和解析方法及装置
CN106485306A (zh) * 2016-09-14 2017-03-08 华南理工大学 一种基于颜色编码的二维码及其制作方法及识别方法
CN107627701B (zh) * 2017-08-07 2019-05-31 江阴升辉包装材料有限公司 一种真空贴体包装膜及其交联处理方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202075754U (zh) * 2011-05-18 2011-12-14 深圳市鑫全图科技有限公司 隐形三维码输出输入装置
US20160350568A1 (en) * 2015-05-27 2016-12-01 Victor Zazzu Two-dimensional (2-d) code generating method, detecting method, detecting apparatus, and anti-counterfeit label
CN105760914A (zh) * 2016-02-01 2016-07-13 中国计量学院 拉曼三维码的生成方法及识别方法
CN108694430A (zh) * 2018-05-11 2018-10-23 李峰 三维码生成和解析方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022233458A1 (de) * 2021-05-04 2022-11-10 Armin Khadjavi 3d-code

Also Published As

Publication number Publication date
CN108694430B (zh) 2021-08-03
CN108694430A (zh) 2018-10-23

Similar Documents

Publication Publication Date Title
WO2019214291A1 (zh) 三维码生成和解析方法
CN104680218B (zh) 一种多空间二维码及其生成、解码方法
CN102761766B (zh) 色彩特征撷取方法
WO2018210076A1 (zh) 结构三维码及防伪方法
CN108437449B (zh) 3d打印颜色呈现方法、装置及系统
CN108381905B (zh) 基于八叉树误差扩散的3d打印色彩呈现方法和装置
WO2020087962A1 (zh) 彩色3d打印方法、打印装置及终端设备
CN103617596A (zh) 一种基于流型转换的图像色彩风格变换方法
CN1962287A (zh) 一种多层光学水印的制作方法
CN110263893A (zh) 一种嵌入水印的防伪二维码生成方法及装置
CN110120006B (zh) 一种基于放大的半色调隐藏图像立体显隐方法
RU2337403C2 (ru) Способ формирования латентного изображения
CN1307484C (zh) 一种分色页面描述灰度光栅化的方法
TW201431714A (zh) 影像分層組合結構
CN110120005B (zh) 一种半色调隐藏图像三维效果的显隐方法
JP6853259B2 (ja) 3d物体用のフルカラーデータの処理方法及び装置
CN109624537A (zh) 一种彩色荧光效果防伪图案的印刷方法和系统
JP7451159B2 (ja) 画像処理装置、画像処理方法、及びプログラム
JP2009017097A (ja) 色変換装置、色変換プログラム、画像形成装置及び画像形成プログラム
US11241874B2 (en) Screen printing method
CN110086956B (zh) 一种半色调隐藏图像浮图效果的显隐方法
JP6120080B2 (ja) 偽造防止形成体及び偽造防止形成体の画線データ作成方法
JP2000123132A (ja) カラーニ次元データコード、読取り装置及び作成装置
CN105654162A (zh) 彩色二维码的生成方法和装置
JP2013212629A (ja) 偽造防止用印刷物

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19800143

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19800143

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19800143

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.05.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19800143

Country of ref document: EP

Kind code of ref document: A1