Two-dimensional code beautifying method, system and device and storage medium

By constructing a QR code beautification material library and replacing image materials, the problem of beautification in the existing technology is solved, and a simple and efficient QR code beautification effect is achieved.

CN119514574AActive Publication Date: 2025-02-25SHENZHEN MAIFENG TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411584385.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-25
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

The existing QR code beautification method requires developers to have knowledge related to neural networks, which increases the difficulty of implementation.

Method used

By constructing a QR code beautification material library, obtain the initial QR code to be beautified, and obtain the target image package from the material library based on the target beautification style selected by the user, and match the image material to replace the black unit block in the initial QR code to obtain the beautification QR code.

Benefits of technology

It reduces the difficulty of implementing QR code beautification, and does not require the use of neural network models, and directly achieves the beautification effect through image material replacement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119514574A_ABST
    Figure CN119514574A_ABST
Patent Text Reader

Abstract

The invention discloses a two-dimensional code beautifying method, system and device and a storage medium. The method comprises the following steps: constructing a two-dimensional code beautification material library; obtaining an initial two-dimensional code to be beautified, wherein the initial two-dimensional code is composed of a plurality of black unit blocks and a plurality of white unit blocks; based on a target beautification style selected by a user, obtaining a target picture package corresponding to the target beautification style from the two-dimensional code beautification material library; performing matching and replacement of a composition area of the black unit block in the initial two-dimensional code on each picture material in the target picture packet; and after the composition area of the black unit block in the initial two-dimensional code is replaced by each matched picture material, obtaining a beautified two-dimensional code. According to the two-dimensional code beautifying method, a neural network model does not need to be used, and the picture materials are used for replacing the black unit blocks in the two-dimensional code, so that the implementation difficulty of two-dimensional code beautifying is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of two-dimensional code beautification, and in particular to a two-dimensional code beautification method, system, device and storage medium. Background Art

[0002] With the popularity of terminals with cameras, the application of QR codes has become more and more popular. QR codes are usually composed of a series of black and white square units arranged in a certain pattern to form a matrix. Since traditional QR codes are basically composed of black and white square units, from the user's perspective, the content of such QR codes is monotonous and the visual experience is not good.

[0003] There are some methods for beautifying QR codes in the prior art, but most of the prior methods for beautifying QR codes are to beautify the QR codes through neural network model learning. The prior art methods for beautifying QR codes through neural networks require developers to train the neural networks, so developers need to have certain neural network-related knowledge, which increases the difficulty of implementing the solution.

[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0005] The main purpose of the present invention is to solve the technical problems mentioned in the above background technology existing in the existing two-dimensional code beautification method.

[0006] The first aspect of the present invention discloses a method for beautifying a two-dimensional code, comprising:

[0007] Constructing a QR code beautification material library, wherein the QR code beautification material library includes at least one picture package of beautification style, and each picture package includes a set of picture materials for matching different styles of QR code unit block combinations;

[0008] Obtaining an initial two-dimensional code to be beautified, wherein the initial two-dimensional code is composed of a plurality of black unit blocks and a plurality of white unit blocks;

[0009] Based on the target beautification style selected by the user, a target picture package corresponding to the target beautification style is obtained from the QR code beautification material library;

[0010] Match and replace the area constituting the black unit blocks in the initial two-dimensional code with each of the picture materials in the target picture package;

[0011] When the area formed by the black unit blocks in the initial two-dimensional code is replaced by the picture materials obtained by matching, a beautified two-dimensional code is obtained.

[0012] In an optional implementation of the first aspect of the present invention, matching and replacing the area constituting the black unit blocks in the initial two-dimensional code with each of the picture materials in the target picture package includes:

[0013] Acquire a first picture material and a second picture material from the target picture package to replace the positioning graphic in the initial two-dimensional code;

[0014] Determine the first sub-region of the positioning pattern from the region formed by the black unit blocks of the initial two-dimensional code by shape matching;

[0015] replacing the black unit block in the first sub-area with the first picture material and the second picture material;

[0016] Performing continuous identification of the black unit blocks on a second sub-region other than the first sub-region in the region constituting the black unit blocks of the initial two-dimensional code, and obtaining a plurality of third sub-regions of different styles from the second sub-region;

[0017] For each of the third sub-regions, a third picture material corresponding to the third sub-region is obtained from the target picture package based on the shape of the third sub-region, and the third sub-region is replaced by the third picture material.

[0018] In an optional implementation of the first aspect of the present invention, for each of the third sub-regions, obtaining a third picture material corresponding to the third sub-region from the target picture package based on the shape of the third sub-region, and replacing the third sub-region with the third picture material includes:

[0019] sorting the third sub-regions of different styles from large to small based on the number of black unit blocks contained in the third sub-regions;

[0020] For the third sub-regions of several different styles, the third picture materials are matched in order from large to small.

[0021] In an optional implementation of the first aspect of the present invention, the matching of the third image materials in order from large to small for the third sub-regions of a plurality of different styles includes:

[0022] For each of the third sub-regions, determining whether the number of black unit blocks included in the third sub-region is greater than a preset threshold;

[0023] If the number of black unit blocks included in the third sub-region is less than or equal to a preset threshold, matching a single third picture material is performed on the third sub-region;

[0024] If the number of black unit blocks included in the third sub-region is greater than a preset threshold, a combination match of a plurality of the third image materials is performed on the third sub-region.

[0025] In an optional implementation of the first aspect of the present invention, if the number of black unit blocks included in the third sub-region is less than or equal to a preset threshold, matching the third sub-region with a single third picture material includes:

[0026] Obtaining the number of first unit blocks in the length direction and the number of second unit blocks in the width direction of the third sub-region respectively;

[0027] Obtaining a preliminary matched third picture material set in the target picture package based on the first unit block quantity and the second unit block quantity;

[0028] Acquire a first arrangement pattern of the black unit blocks in the length direction of the third sub-region, and screen the third picture material set based on the first arrangement pattern to obtain a pre-screened third picture material set;

[0029] A second arrangement pattern of the black unit blocks in the width direction of the third sub-area is obtained, and a second screening is performed on the primary screening third picture material set based on the second arrangement pattern to obtain a target third picture material.

[0030] In an optional implementation of the first aspect of the present invention, if the number of black unit blocks included in the third sub-region is greater than a preset threshold, performing combination matching of a plurality of the third image materials on the third sub-region includes:

[0031] If there are multiple results of the combination matching, then obtaining the number of the third image materials in each combination matching;

[0032] The combination with the least number is selected to match and replace the third sub-region.

[0033] In an optional implementation of the first aspect of the present invention, if the number of black unit blocks included in the third sub-region is greater than a preset threshold, then performing combination matching of a plurality of the third image materials on the third sub-region includes:

[0034] The plurality of third picture materials are replaced in the third sub-area, and a color smooth transition process is performed on the joints of the plurality of third picture materials.

[0035] A second aspect of the present invention provides a two-dimensional code beautification system, the beautification system comprising:

[0036] A material library construction module, used to construct a two-dimensional code beautification material library, wherein the two-dimensional code beautification material library includes at least one picture package of beautification style, and each picture package includes a set of picture materials for matching different styles of two-dimensional code unit block combinations;

[0037] An initial two-dimensional code acquisition module is used to acquire an initial two-dimensional code to be beautified, wherein the initial two-dimensional code is composed of a plurality of black unit blocks and a plurality of white unit blocks;

[0038] A beautification style selection module, used for acquiring a target picture package corresponding to the target beautification style from the QR code beautification material library based on the target beautification style selected by the user;

[0039] A black unit block replacement module, used to match and replace the black unit block constituting area in the initial two-dimensional code for each of the picture materials in the target picture package;

[0040] The beautified two-dimensional code acquisition module is used to obtain a beautified two-dimensional code after the area constituting the black unit blocks in the initial two-dimensional code is replaced by the picture materials obtained by matching.

[0041] A third aspect of the present invention provides a two-dimensional code beautification device, the two-dimensional code beautification device comprising: a memory and at least one processor, the memory storing instructions, the memory and the at least one processor being interconnected via a line;

[0042] The at least one processor calls the instruction in the memory so that the two-dimensional code beautification device executes the two-dimensional code beautification method as described in any one of the first aspects above.

[0043] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the two-dimensional code beautification method as described in any one of the first aspects above is implemented.

[0044] Beneficial effects: The present invention discloses a two-dimensional code beautification method, system, device and storage medium. The method includes constructing a two-dimensional code beautification material library; obtaining an initial two-dimensional code to be beautified, the initial two-dimensional code consisting of a plurality of black unit blocks and a plurality of white unit blocks; based on the target beautification style selected by the user, obtaining a target picture package corresponding to the target beautification style from the two-dimensional code beautification material library; matching and replacing each picture material in the target picture package with the constituent area of ​​the black unit block in the initial two-dimensional code; when the constituent area of ​​the black unit block in the initial two-dimensional code is replaced by each matched picture material, a beautified two-dimensional code is obtained. The two-dimensional code beautification method of the present invention does not need to use a neural network model, but uses a method of replacing the black unit blocks in the two-dimensional code with picture materials, which reduces the difficulty of implementing the two-dimensional code beautification. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 The figure is a flowchart of an exemplary method for beautifying a two-dimensional code according to the present invention.

[0046] Figure 2 This is a comparison diagram of beautification effects of an exemplary method for beautifying a QR code according to the present invention.

[0047] Figure 3 This is a simplified diagram of the core idea of ​​a QR code beautification method exemplified by the present invention.

[0048] Figure 4 The figure is a schematic diagram of the module composition of an exemplary QR code beautification system of the present invention.

[0049] Figure 5 The figure is a schematic diagram of the component composition of an exemplary two-dimensional code beautification device of the present invention. DETAILED DESCRIPTION

[0050] The embodiments disclosed in the present invention are described in more detail below with reference to the accompanying drawings. Although certain embodiments disclosed in the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments disclosed in the present invention are only for exemplary purposes and are not intended to limit the scope of protection disclosed in the present invention.

[0051] In the description of the embodiments disclosed in the present invention, if there are terms, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. can refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0052] The first aspect of the present invention discloses a method for beautifying a two-dimensional code, comprising:

[0053] S100, constructing a two-dimensional code beautification material library, wherein the two-dimensional code beautification material library includes at least one beautification style picture package, each of which includes a set of picture materials for matching different styles of two-dimensional code unit block combinations; specifically, a traditional two-dimensional code is generally composed of a plurality of black unit blocks and a plurality of white unit blocks, and the picture materials in the picture package of the present invention are used for combining and replacing one or more black unit blocks, as shown in the attached figure. Figure 2 In the QR code on the left side, in the present invention, 1 black unit block is easy to understand, and the specification is 1; 2 black unit blocks can be combined into a combination of length and width of 1*2, or a length and width of 2*1; 3 black unit blocks can be combined into a 2*2 field-shaped square, and any three of them can be filled with 3 black unit blocks. Therefore, there are many combinations of 3 black unit blocks, and so on, there are other combinations of various numbers of black unit blocks. The picture material of the present invention is designed based on the combination of black unit blocks, and the picture package includes at least two picture materials corresponding to different combinations of black unit blocks. In order to ensure that the beautified QR code is more coordinated, the design style of each picture material in a picture package is consistent.

[0054] S200, obtaining an initial two-dimensional code to be beautified, wherein the initial two-dimensional code is composed of a plurality of black unit blocks and a plurality of white unit blocks; in this step of the present invention, a traditional style two-dimensional code to be beautified is obtained, wherein the traditional style two-dimensional code has a positioning graphic area (i.e., a combination area of ​​brown unit blocks in the shape of a Chinese character "U") and a non-positioning graphic area (i.e., an area other than the combination of black unit blocks in the shape of a Chinese character "U").

[0055] S300. Based on the target beautification style selected by the user, a target picture package corresponding to the target beautification style is obtained from the QR code beautification material library; in the present invention, the QR code beautification material library can provide picture packages with multiple beautification styles for users to choose from. For a QR code to be beautified, the user can select a target picture package with a target beautification style to beautify the QR code.

[0056] S400, match and replace the area constituting the black unit blocks in the initial two-dimensional code with each picture material in the target picture package; in this step, the area constituting the black unit blocks in the initial two-dimensional code is replaced with various picture materials in the target picture package, and the various picture materials include picture materials matching 1 black unit block, materials matching a combination of 2 black unit blocks, picture materials matching a combination of 3 black unit blocks, and so on.

[0057] In an optional implementation of step S400 of the first aspect of the present invention, matching and replacing the area constituting the black unit blocks in the initial two-dimensional code with each of the picture materials in the target picture package includes:

[0058] The first picture material and the second picture material for replacing the positioning pattern in the initial two-dimensional code are obtained from the target picture package; in this step, the positioning pattern in the initial two-dimensional code generally includes a central positioning area composed of a plurality of black unit blocks in the middle and a square-shaped peripheral area surrounding the central positioning area and composed of a plurality of black unit blocks, the first picture material can be a picture material for replacing the central positioning area, and the second picture material can be a picture material for replacing the square-shaped peripheral area;

[0059] The first sub-region of the positioning pattern is determined from the area constituted by the black unit blocks of the initial two-dimensional code by shape matching; in this step, the first sub-region of the positioning pattern is found from the initial two-dimensional code by U-shaped matching.

[0060] The black unit blocks in the first sub-area are replaced by the first picture material and the second picture material; in this step, the black unit blocks in the U-shaped area are replaced by the first picture material and the second picture material.

[0061] The second sub-region outside the first sub-region in the area constituting the black unit blocks of the initial two-dimensional code is continuously identified as adjacent to the black unit blocks, and a number of third sub-regions with different styles are obtained from the second sub-region; in this step, for the second sub-region outside the first sub-region, first select a target black unit block as the starting point, and then traverse whether there are other black unit blocks around the target black unit block, if so, combine the surrounding black unit blocks with the target black unit block, and then traverse whether there are other black unit blocks around each surrounding black unit block in the combination, and find the adjacent black unit blocks of each surrounding black unit block, and perform the above operation on each circle of black unit blocks on the periphery until each black unit block in the outermost circle has no adjacent black unit blocks in the outer circle, so that a third sub-region is obtained, and then another black unit block is selected outside the third sub-region, and the search and combination are repeated to obtain the black unit blocks of the third sub-region, so that a number of third sub-regions with different styles will be obtained.

[0062] For each of the third sub-regions, a third picture material corresponding to the third sub-region is obtained from the target picture package based on the shape of the third sub-region, and the third picture material replaces the third sub-region. In the present invention, each of the third sub-regions has a corresponding target shape (i.e., how many black unit blocks are composed of the third sub-region, and what is the arrangement pattern of the black unit blocks), and this step is to match the picture material based on the pattern of the black unit blocks in the third sub-region.

[0063] In an optional implementation of the first aspect of the present invention, in order to make the matching process more orderly, the present invention performs matching based on each picture material in the picture package, that is, first take out a picture material from the picture package, and determine whether there is a target third sub-region matching the picture material among the plurality of third sub-regions. Furthermore, in order to make the matching process more orderly, the order in which the picture materials in the picture package are taken out is also limited, that is, the picture with the largest size (corresponding to the most black unit blocks) is taken out first for matching. In this way, after the matching and replacement, the number of picture materials used will be better, and the style of the beautified QR code will be more coordinated.

[0064] Specifically, the specific steps are as follows: for each of the third sub-regions, the third picture material corresponding to the third sub-region is obtained from the target picture package based on the shape of the third sub-region, and the third picture material is used to replace the third sub-region, including: sorting the third sub-regions of several different styles from large to small based on the number of black unit blocks contained in the third sub-regions; and for the third sub-regions of several different styles, matching the third picture materials in order from large to small.

[0065] In an optional implementation of the first aspect of the present invention, since each of the third sub-regions contains black unit blocks of varying numbers, it is relatively simple to match the third sub-region with fewer black unit blocks, but for the third sub-region with more black unit blocks, the more black unit blocks there are, the more combination styles there are, and the probability of successfully matching the image material is smaller, so it is also necessary to appropriately divide the third sub-region with more black unit blocks, that is, to piece together the third sub-region with multiple image materials, which, converted to specific process steps, is to match the third sub-regions of several different styles in order from large to small, including: for each of the third sub-regions, determine whether the number of black unit blocks contained in the third sub-region is greater than a preset threshold; if the number of black unit blocks contained in the third sub-region is less than or equal to the preset threshold, match a single third image material for the third sub-region; if the number of black unit blocks contained in the third sub-region is greater than the preset threshold, match a combination of multiple third image materials for the third sub-region.

[0066] In an optional implementation of the first aspect of the present invention, taking the combination of three black unit blocks as an example, the styles that can be combined include one on top and two on the bottom (including the upper one on the left and the upper one on the right) and two on top and one on the bottom (similarly including the lower one on the right and the lower one on the right), and the three black unit blocks can also be arranged in a straight line; when matching a single third image material, in order to improve the matching efficiency, based on the number of black unit blocks in the length direction and the number of black unit blocks in the width direction of the third sub-area, a preliminary screening of suitable image materials can be performed, and then a further comparison is made on how the various black unit blocks are distributed in the length direction for a second screening, and after the second screening, a comparison is made on how the various black unit blocks are distributed in the width direction for a third screening, and finally the required image material is obtained, and converted to specific process steps. That is, if the number of the black unit blocks contained in the third sub-region is less than or equal to a preset threshold, then matching the third sub-region with a single third picture material includes: obtaining the first number of unit blocks in the length direction and the second number of unit blocks in the width direction of the third sub-region respectively; obtaining a preliminary matching third picture material set in the target picture package based on the first number of unit blocks and the second number of unit blocks; obtaining a first arrangement pattern of the black unit blocks in the length direction of the third sub-region, and screening the third picture material set once based on the first arrangement pattern to obtain a preliminary screening third picture material set; obtaining a second arrangement pattern of the black unit blocks in the width direction of the third sub-region, and screening the preliminary screening third picture material set twice based on the second arrangement pattern to obtain the target third picture material.

[0067] In an optional implementation of the first aspect of the present invention, when performing combination matching on the third sub-region, there are many ways to combine the multiple image materials corresponding to the third sub-region. In order to make the beautified QR code more coordinated, it is necessary to reduce the types of image materials in the replacement process, that is, to select the least image materials to piece together the third sub-region. Therefore, it is necessary to screen the combination matching of the obtained multiple image materials and convert them to specific process steps, that is, if the number of black unit blocks contained in the third sub-region is greater than a preset threshold, then performing combination matching on the third sub-region includes: if there are multiple results of the combination matching, obtaining the number of the third image materials in each combination matching; selecting the combination matching with the least number to replace the third sub-region.

[0068] In an optional implementation of the first aspect of the present invention, in order to better reflect that the third sub-region is different from the picture materials in other regions, the third sub-region has better integrity, and the transition between the various picture materials is also required to be more reasonable. Translated to the specific process steps, that is, if the number of black unit blocks contained in the third sub-region is greater than the preset threshold, then the combination matching of multiple third picture materials in the third sub-region includes: replacing the multiple third picture materials in the third sub-region, and performing color smoothing transition processing on the connection between the multiple third picture materials.

[0069] S500: When the regions of the black unit blocks in the initial two-dimensional code are replaced by the matched picture materials, a beautified two-dimensional code is obtained. In the present invention, when the regions of the black unit blocks in the initial two-dimensional code are replaced by the appropriate picture materials, a beautified two-dimensional code can be obtained.

[0070] In short, the main process of the beautification method of the two-dimensional code of the present invention can be Figure 3 As shown, the core ideas can be summarized as follows:

[0071] Step 1: Material preparation, QR code data: Generate a two-dimensional array of QR codes according to the general standards of QR codes; Image material: The essence of a QR code is a two-dimensional array containing 0 and 1. You need to prepare at least one material with a unit of 1x1. Other types such as 1x3, 2x2, etc. are optional.

[0072] Step 2: Calculate the position of the image material; Calculate the image position, match the image material with the array of QR codes (i.e., the combination of black unit blocks) from large to small. If the match is successful, the original array position is marked as a hit, and the next round of traversal will not be involved, and finally the position array where the image needs to be drawn is obtained;

[0073] Step 3: Draw the QR code; determine the replacement position of the image material, and replace the black unit blocks of the QR code with the image material, and finally generate a beautified QR code based on the image material.

[0074] See also Figure 4 The second aspect of the present invention provides a two-dimensional code beautification system, the beautification system comprising:

[0075] The material library construction module 10 is used to construct a two-dimensional code beautification material library, wherein the two-dimensional code beautification material library includes at least one picture package of beautification style, and each picture package includes a set of picture materials for matching different styles of two-dimensional code unit block combinations;

[0076] An initial two-dimensional code acquisition module 20 is used to acquire an initial two-dimensional code to be beautified, wherein the initial two-dimensional code is composed of a plurality of black unit blocks and a plurality of white unit blocks;

[0077] A beautification style selection module 30 is used to obtain a target picture package corresponding to the target beautification style from the QR code beautification material library based on the target beautification style selected by the user;

[0078] A black unit block replacement module 40 is used to match and replace the black unit block constituting area in the initial two-dimensional code for each of the picture materials in the target picture package;

[0079] The beautified two-dimensional code acquisition module 50 is used to obtain a beautified two-dimensional code after the area constituting the black unit blocks in the initial two-dimensional code is replaced by the picture materials obtained by matching.

[0080] In an optional implementation of the second aspect of the present invention, the black unit block replacement module includes:

[0081] A positioning graphic material acquisition unit, used to acquire, from the target picture package, a first picture material and a second picture material for replacing the positioning graphic in the initial two-dimensional code;

[0082] A positioning pattern area acquisition unit, used for determining a first sub-area of ​​the positioning pattern from an area formed by the black unit blocks of the initial two-dimensional code by shape matching;

[0083] A positioning graphic material replacement unit, configured to replace the black unit block in the first sub-area with the first picture material and the second picture material;

[0084] A non-positioning graphic area splitting unit, used for identifying a second sub-area other than the first sub-area in the area constituting the black unit block of the initial two-dimensional code as being continuously adjacent to the black unit block, and obtaining a plurality of third sub-areas of different styles from the second sub-area;

[0085] The non-positioning graphic area material replacement unit is used to obtain the third picture material corresponding to each of the third sub-areas from the target picture package based on the shape of the third sub-area, and replace the third sub-area with the third picture material.

[0086] In an optional implementation manner of the second aspect of the present invention, the non-positioning graphic area material replacement unit includes:

[0087] A sub-region sorting sub-unit, used for sorting the third sub-regions of different styles from large to small based on the number of black unit blocks contained in the third sub-regions;

[0088] The sub-region sequential matching sub-unit is used to match the third image materials in order from large to small for the third sub-regions of several different styles.

[0089] In an optional implementation of the second aspect of the present invention, the sub-region sequentially matching sub-units includes:

[0090] A threshold judgment upper layer unit, used for judging, for each of the third sub-regions, whether the number of black unit blocks contained in the third sub-region is greater than a preset threshold;

[0091] A single material matching upper layer unit, configured to match a single third picture material to the third sub-region if the number of black unit blocks contained in the third sub-region is less than or equal to a preset threshold;

[0092] The multi-material matching upper layer unit is used to perform combined matching of a plurality of the third picture materials on the third sub-region if the number of the black unit blocks contained in the third sub-region is greater than a preset threshold.

[0093] In an optional implementation manner of the second aspect of the present invention, the single material matching main unit includes:

[0094] The scale obtains the lower layer unit, which is used to obtain the number of first unit blocks in the length direction and the number of second unit blocks in the width direction of the third sub-region respectively;

[0095] A material initial matching lower layer unit, used for obtaining a preliminary matching third picture material set in the target picture package based on the first unit block quantity and the second unit block quantity;

[0096] A material first screening lower layer unit is used to obtain a first arrangement pattern of the black unit blocks in the length direction of the third sub-area, and screen the third picture material set based on the first arrangement pattern to obtain a primary screening third picture material set;

[0097] The second material screening lower layer unit is used to obtain the second arrangement pattern of the black unit blocks in the width direction of the third sub-area, and perform a second screening on the primary screening third picture material set based on the second arrangement pattern to obtain the target third picture material.

[0098] In an optional implementation manner of the second aspect of the present invention, the multi-material matching main unit includes:

[0099] A matching result judgment lower layer unit is used to obtain the number of the third image materials in each combination match if there are multiple results of the combination match;

[0100] Select the least number of matching lower-level units, and select the combination with the least number to match and replace the third sub-region.

[0101] In an optional implementation manner of the second aspect of the present invention, the multi-material matching main unit further includes:

[0102] The lower layer unit is smoothly processed, a plurality of the third picture materials are replaced in the third sub-area, and a color smooth transition process is performed on the connection between the plurality of the third picture materials.

[0103] Figure 5 It is a structural schematic diagram of a two-dimensional code beautification device provided by an embodiment of the present invention. The two-dimensional code beautification device may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 60 (for example, one or more processors) and a memory 70, and one or more storage media 90 (for example, one or more mass storage devices) storing application programs 80 or data. Among them, the memory and the storage medium can be short-term storage or permanent storage. The program stored in the storage medium may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the two-dimensional code beautification device. Furthermore, the processor can be configured to communicate with the storage medium and execute a series of instruction operations in the storage medium on the two-dimensional code beautification device.

[0104] The two-dimensional code beautification device of the present invention may also include one or more power supplies 100, one or more wired or wireless network interfaces 110, one or more input and output interfaces 120, and / or one or more operating systems 130, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. It will be understood by those skilled in the art that Figure 5 The illustrated structure of the two-dimensional code beautification device does not constitute a limitation on the two-dimensional code-based beautification device, and may include more or less components than illustrated, or a combination of certain components, or a different arrangement of components.

[0105] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the two-dimensional code beautification method.

[0106] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0107] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.

[0108] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for beautifying a two-dimensional code, characterized in that: include: Constructing a QR code beautification material library, wherein the QR code beautification material library includes at least one picture package of beautification style, and each picture package includes a set of picture materials for matching different styles of QR code unit block combinations; Obtaining an initial two-dimensional code to be beautified, wherein the initial two-dimensional code is composed of a plurality of black unit blocks and a plurality of white unit blocks; Based on the target beautification style selected by the user, a target picture package corresponding to the target beautification style is obtained from the QR code beautification material library; Match and replace the area constituting the black unit blocks in the initial two-dimensional code with each of the picture materials in the target picture package; When the area formed by the black unit blocks in the initial two-dimensional code is replaced by the picture materials obtained by matching, a beautified two-dimensional code is obtained.

2. The method for beautifying a two-dimensional code according to claim 1, characterized in that: The matching and replacement of the black unit block constituting area in the initial two-dimensional code with each of the picture materials in the target picture package includes: Acquire a first picture material and a second picture material from the target picture package to replace the positioning graphic in the initial two-dimensional code; Determine the first sub-region of the positioning pattern from the region formed by the black unit blocks of the initial two-dimensional code by shape matching; replacing the black unit block in the first sub-area with the first picture material and the second picture material; Performing continuous identification of the black unit blocks on a second sub-region other than the first sub-region in the region constituting the black unit blocks of the initial two-dimensional code, and obtaining a plurality of third sub-regions of different styles from the second sub-region; For each of the third sub-regions, a third picture material corresponding to the third sub-region is obtained from the target picture package based on the shape of the third sub-region, and the third sub-region is replaced by the third picture material.

3. The beautification method of a two-dimensional code according to claim 2, characterized in that: For each of the third sub-regions, obtaining a third picture material corresponding to the third sub-region from the target picture package based on the shape of the third sub-region, and replacing the third sub-region with the third picture material comprises: sorting the third sub-regions of different styles from large to small based on the number of black unit blocks contained in the third sub-regions; For the third sub-regions of several different styles, the third picture materials are matched in order from large to small.

4. The method for beautifying a two-dimensional code according to claim 3, characterized in that: The matching of the third image materials in order of order from large to small for the third sub-regions of several different styles includes: For each of the third sub-regions, determining whether the number of black unit blocks included in the third sub-region is greater than a preset threshold; If the number of black unit blocks included in the third sub-region is less than or equal to a preset threshold, matching a single third picture material is performed on the third sub-region; If the number of black unit blocks included in the third sub-region is greater than a preset threshold, a combination match of a plurality of the third image materials is performed on the third sub-region.

5. The method for beautifying a two-dimensional code according to claim 4, characterized in that: If the number of black unit blocks included in the third sub-region is less than or equal to a preset threshold, matching a single third picture material to the third sub-region includes: Obtaining the number of first unit blocks in the length direction and the number of second unit blocks in the width direction of the third sub-region respectively; Obtaining a preliminary matched third picture material set in the target picture package based on the first unit block quantity and the second unit block quantity; Acquire a first arrangement pattern of the black unit blocks in the length direction of the third sub-region, and screen the third picture material set based on the first arrangement pattern to obtain a pre-screened third picture material set; A second arrangement pattern of the black unit blocks in the width direction of the third sub-area is obtained, and a second screening is performed on the primary screening third picture material set based on the second arrangement pattern to obtain a target third picture material.

6. The method for beautifying a two-dimensional code according to claim 5, characterized in that: If the number of black unit blocks included in the third sub-region is greater than a preset threshold, performing combination matching of a plurality of third image materials on the third sub-region includes: If there are multiple results of the combination matching, then obtaining the number of the third image materials in each combination matching; The combination with the least number is selected to match and replace the third sub-region.

7. The method for beautifying a two-dimensional code according to claim 4, characterized in that: If the number of black unit blocks included in the third sub-region is greater than a preset threshold, then performing combination matching of a plurality of third image materials on the third sub-region includes: The plurality of third picture materials are replaced in the third sub-area, and a color smooth transition process is performed on the joints of the plurality of third picture materials.

8. A QR code beautification system, characterized in that: The beautification system comprises: A material library construction module is used to construct a two-dimensional code beautification material library, wherein the two-dimensional code beautification material library includes at least one picture package of beautification style, and each picture package includes a set of picture materials for matching different styles of two-dimensional code unit block combinations; An initial two-dimensional code acquisition module is used to acquire an initial two-dimensional code to be beautified, wherein the initial two-dimensional code is composed of a plurality of black unit blocks and a plurality of white unit blocks; A beautification style selection module, used for acquiring a target picture package corresponding to the target beautification style from the QR code beautification material library based on the target beautification style selected by the user; A black unit block replacement module, used to match and replace the black unit block constituting area in the initial two-dimensional code for each of the picture materials in the target picture package; The beautified two-dimensional code acquisition module is used to obtain a beautified two-dimensional code after the area constituting the black unit blocks in the initial two-dimensional code is replaced by the picture materials obtained by matching.

9. A two-dimensional code beautification device, characterized in that: The two-dimensional code beautification device comprises: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instruction in the memory to enable the two-dimensional code beautification device to execute the two-dimensional code beautification method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the two-dimensional code beautification method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method for generating two-dimensional code

    CN106570550A

  • Two-dimensional code generation method and device

    CN108229626A

  • Two-dimensional code image generation method and apparatus, storage medium and electronic device

    US20200226440A1

  • Image processing method and apparatus, electronic device, and storage medium

    WO2022179025A1