Method, system and device for beautifying a two-dimensional code and storage medium

By constructing a QR code beautification material library and replacing black unit blocks with image materials, the problem of needing neural network training in existing technologies is solved, thus simplifying the beautification of QR codes and improving their visual effects.

CN119514574BActive Publication Date: 2026-03-20SHENZHEN MAIFENG TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing QR code enhancement methods require neural network training, which increases the difficulty of implementation and results in a poor visual experience.

Method used

A library of QR code enhancement materials is built. Black blocks in the QR code are replaced with image materials. The target image package is obtained according to the enhancement style selected by the user, and then matched and replaced to generate the enhancement QR code.

Benefits of technology

It reduces the difficulty of implementing QR code beautification, improves the beautification effect, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119514574B_ABST
    Figure CN119514574B_ABST
Patent Text Reader

Abstract

The application discloses a kind of beautification method, system, equipment and storage medium of two-dimensional code. Method includes constructing two-dimensional code beautification material library;Obtain the initial two-dimensional code to be beautified, the initial two-dimensional code is composed of several black unit blocks and several white unit blocks;Based on the target beautification style selected by user, obtain the target picture package corresponding to the target beautification style from the two-dimensional code beautification material library;Each picture material in the target picture package is replaced by matching the constituting area of the black unit block in the initial two-dimensional code;After the constituting area of the black unit block in the initial two-dimensional code is replaced by each picture material matched, obtain the beautified two-dimensional code.The two-dimensional code beautification method of the application does not need to use neural network model, and uses the way of replacing black unit block in two-dimensional code by picture material replacement, reduces the difficulty of two-dimensional code beautification implementation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of QR code enhancement technology, and in particular to a method, system, device and storage medium for enhancing QR codes. Background Technology

[0002] With the widespread adoption of devices equipped with cameras, the use of QR codes has become increasingly common. QR codes typically consist of a matrix composed of a series of black and white square units arranged according to certain rules. Because traditional QR codes are primarily composed of black and white square units, from a user's perspective, the content is monotonous and the visual experience is poor.

[0003] There are some existing methods for beautifying QR codes, but most of these methods rely on neural network models to learn and enhance the QR code. This requires developers to train the neural network, thus necessitating a certain level of neural network knowledge and increasing the difficulty of implementation.

[0004] Therefore, existing technologies still need to be improved and developed. Summary of the Invention

[0005] The main objective of this invention is to solve the technical problems mentioned in the background section of the existing QR code beautification methods.

[0006] The first aspect of this invention discloses a method for beautifying QR codes, comprising:

[0007] A QR code beautification material library is constructed, which includes at least one image package with beautification style, and each image package includes a set of image materials for matching different styles of QR code unit block combinations;

[0008] Obtain the initial QR code to be beautified, which consists of several black unit blocks and several white unit blocks;

[0009] Based on the user's selected target beautification style, the target image package corresponding to the target beautification style is obtained from the QR code beautification material library;

[0010] The black unit blocks constituting the initial QR code are matched and replaced in each of the image materials in the target image package;

[0011] When the black unit blocks constituting the initial QR code are replaced by the matched image materials, an enhanced QR code is obtained.

[0012] In an optional embodiment of the first aspect of the present invention, the step of matching and replacing the constitutive region of the black unit block in the initial QR code for each image material in the target image package includes:

[0013] Obtain the first and second image materials from the target image package to replace the positioning graphic in the initial QR code;

[0014] The first sub-region of the positioning graphic is determined from the constitutive region of the black unit block of the initial QR code by shape matching.

[0015] Replace the black unit blocks in the first sub-region with the first image material and the second image material;

[0016] The black unit blocks of the initial QR code are continuously adjacent to each other in the second sub-region outside the first sub-region, and several third sub-regions with different styles are obtained from the second sub-region.

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

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

[0019] The third sub-regions of several different styles are sorted from largest to smallest based on the number of black unit blocks contained in the third sub-region;

[0020] For several different styles of the third sub-region, the third image materials are matched sequentially in descending order of size.

[0021] In an optional embodiment of the first aspect of the present invention, the matching of the third image materials in descending order of the third sub-regions of different styles includes:

[0022] 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.

[0023] If the number of black unit blocks contained in the third sub-region is less than or equal to a preset threshold, then the third sub-region is matched with a single third image material;

[0024] If the number of black unit blocks contained in the third sub-region is greater than a preset threshold, then the third sub-region is subjected to combination matching of multiple third image materials.

[0025] In an optional embodiment of the first aspect of the present invention, the step of matching a single third image material in 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 includes:

[0026] 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;

[0027] Based on the number of the first unit block and the number of the second unit block, a third set of images that is initially matched is obtained in the target image package;

[0028] Obtain the first arrangement pattern of the black unit blocks in the length direction in the third sub-region, and perform a screening of the third image material set based on the first arrangement pattern to obtain the initial screening of the third image material set;

[0029] Obtain the second arrangement pattern of the black unit blocks in the width direction of the third sub-region, and perform a second screening on the initial third image material set based on the second arrangement pattern to obtain the target third image material.

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

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

[0032] The combination with the fewest occurrences is selected to replace the third sub-region.

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

[0034] The third image material is replaced in the third sub-region, and the color transition at the junction of the third image material is smoothed.

[0035] A second aspect of the present invention provides a QR code enhancement system, the enhancement system comprising:

[0036] The material library construction module is used to build a QR code beautification material library. The QR code beautification material library includes at least one image package with beautification style. Each image package includes a set of image materials for matching different styles of QR code unit block combinations.

[0037] The initial QR code acquisition module is used to acquire the initial QR code to be beautified, which consists of a number of black unit blocks and a number of white unit blocks;

[0038] The beautification style selection module is used to obtain the target image 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] The black unit block replacement module is used to match and replace the constituent areas of the black unit blocks in the initial QR code for each image material in the target image package.

[0040] The beautified QR code acquisition module is used to obtain a beautified QR code after the constitutive area of ​​the black unit block in the initial QR code is replaced by each of the matched image materials.

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

[0042] The at least one processor invokes the instructions in the memory to cause the QR code enhancement device to perform the QR code enhancement 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 storing a computer program that, when executed by a processor, implements the QR code beautification method as described in any one of the first aspects above.

[0044] Beneficial Effects: This invention discloses a method, system, device, and storage medium for beautifying QR codes. The method includes constructing a QR code beautification material library; obtaining an initial QR code to be beautified, the initial QR code consisting of several black unit blocks and several white unit blocks; based on a user-selected target beautification style, obtaining a target image package corresponding to the target beautification style from the QR code beautification material library; matching and replacing the constituent areas of the black unit blocks in the initial QR code with each image material in the target image package; and obtaining a beautified QR code after the constituent areas of the black unit blocks in the initial QR code have been replaced by the matched image materials. The QR code beautification method of this invention does not require the use of a neural network model, but uses image materials to replace the black unit blocks in the QR code, reducing the implementation difficulty of QR code beautification. Attached Figure Description

[0045] Figure 1 This is a flowchart illustrating an exemplary QR code enhancement method of the present invention.

[0046] Figure 2 The image shows a comparison of the enhancement effects of a QR code enhancement method exemplified by this invention.

[0047] Figure 3 This is a simplified diagram illustrating the core concept of a QR code enhancement method exemplified by the present invention.

[0048] Figure 4 This is a schematic diagram illustrating the module composition of a QR code beautification system exemplified by the present invention.

[0049] Figure 5 This is a schematic diagram of the device composition of a QR code beautification device exemplified by the present invention. Detailed Implementation

[0050] The embodiments of the present invention disclosed herein are described in more detail below with reference to the accompanying drawings. While some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the accompanying drawings and embodiments disclosed herein are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0051] In the description of the embodiments disclosed in this invention, where terms are used, the term "comprising" and similar expressions should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0052] The first aspect of this invention discloses a method for beautifying QR codes, comprising:

[0053] S100. Construct a QR code beautification material library, which includes at least one image package with beautification style. Each image package includes a set of image materials for matching different styles of QR code unit block combinations. Specifically, traditional QR codes are generally composed of several black unit blocks and several white unit blocks. The image materials in the image package of this invention are used for replacing one or more black unit blocks in combination. See Appendix. Figure 2 The QR code on the left side of the image uses a single black unit block, which is easily understood as having a size of 1. Two black unit blocks can form a 1x2 grid or a 2x1 grid. Three black unit blocks can be arranged in a 2x2 grid, with any three blocks randomly selected to fill the grid. Therefore, there are multiple ways to combine three black unit blocks, and similarly, there are other combinations of various numbers of black unit blocks. The image materials in this invention are designed based on these combinations of black unit blocks. The image package includes at least two image materials corresponding to different combinations of black unit blocks. To ensure that the beautified QR code is more harmonious, the design style of each image material in an image package is consistent.

[0054] S200. Obtain the initial QR code to be beautified. The initial QR code consists of a number of black unit blocks and a number of white unit blocks. In this step of the present invention, the traditional style QR code to be beautified is obtained. The traditional style QR code has a positioning graphic area (i.e., a combination area of ​​brown unit blocks in the shape of a square) and a non-positioning graphic area (i.e., the area other than the combination of black unit blocks in the shape of a square).

[0055] S300. Based on the target beautification style selected by the user, obtain the target image package corresponding to the target beautification style from the QR code beautification material library; In this invention, the QR code beautification material library can provide image packages with multiple beautification styles for the user to choose from. For a QR code to be beautified, the user can select a target image package of a target beautification style to beautify the QR code.

[0056] S400. Match and replace the constitutive area of ​​the black unit block in the initial QR code for each image material in the target image package; in this step, the constitutive area of ​​the black unit block in the initial QR code is replaced with various image materials in the target image package. The various image materials include image materials that match 1 black unit block, image materials that match a combination of 2 black unit blocks, image materials that match a combination of 3 black unit blocks, and so on.

[0057] In an optional embodiment of step S400 of the first aspect of the present invention, the step of matching and replacing the constitutive region of the black unit block in the initial QR code for each image material in the target image package includes:

[0058] The first image material and the second image material are obtained from the target image package to replace the positioning graphic in the initial QR code. In this step, the positioning graphic in the initial QR code generally includes a central positioning area composed of several black unit blocks in the middle and a square-shaped outer peripheral area composed of several black unit blocks around the central positioning area. The first image material can be the image material used to replace the central positioning area, and the second image material can be the image material used to replace the square-shaped outer peripheral area.

[0059] The first sub-region of the positioning graphic is determined from the constitutive region of the black unit block of the initial QR code by shape matching; in this step, the first sub-region of the positioning graphic is found from the initial QR code by using a back-shaped matching method.

[0060] The black unit blocks in the first sub-region are replaced using the first image material and the second image material; in this step, the black unit blocks in the square-shaped region are replaced using the first image material and the second image material.

[0061] In the second sub-region outside the first sub-region of the constitutive region of the initial QR code's black unit blocks, continuous adjacent black unit block identification is performed to obtain several third sub-regions with different styles from the second sub-region. In this step, for the second sub-region outside the first sub-region, a target black unit block is selected as the starting point, and then the surrounding black unit block is traversed to see if there are other black unit blocks. If there are, the surrounding black unit blocks are combined with the target black unit block. Then, for each surrounding black unit block in the combination, the surrounding black unit blocks are traversed to see if there are other black unit blocks. The adjacent black unit blocks of each surrounding black unit block are then found. The above operation is performed on each outermost black unit block until each outermost black unit block has no outermost adjacent black unit blocks. This is considered to have obtained a third sub-region composed of black unit blocks. Then, another black unit block is selected outside this third sub-region, and the search and combination of black unit blocks to obtain the third sub-region is repeated. This will result in several third sub-regions with different styles.

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

[0063] In an optional embodiment of the first aspect of the present invention, in order to make the matching process more orderly, the present invention uses each image material in the image package as a basis for matching. That is, firstly, one image material is taken out from the image package, and it is determined whether there is a target third sub-region that matches the image material in several third sub-regions. Furthermore, in order to make the matching process more orderly, the order in which the image materials in the image package are taken out is also limited. That is, the image material with the largest size (corresponding to the one with the most black unit blocks) is taken out first for matching. In this way, after the matching and replacement, the number of image materials used will be better, and the style of the beautified QR code will be more coordinated.

[0064] Specifically, in terms of concrete steps, for each of the third sub-regions, obtaining the corresponding third image material from the target image package based on the shape of the third sub-region, and replacing the third sub-region with the third image material includes: sorting several third sub-regions of different styles from largest to smallest based on the number of black unit blocks contained in the third sub-region; and matching the third image material sequentially for several third sub-regions of different styles according to the sorting from largest to smallest.

[0065] In an optional embodiment of the first aspect of the present invention, since each of the third sub-regions contains varying numbers of black unit blocks, matching is relatively simple for third sub-regions with fewer black unit blocks. However, for third sub-regions with more black unit blocks, the more combination patterns there are, and the lower the probability of successfully matching image materials. Therefore, it is necessary to appropriately segment the third sub-regions with more black unit blocks, that is, to piece together the third sub-regions with multiple image materials. In terms of specific process steps, the matching of third image materials for several third sub-regions with different patterns in descending order includes: for each third sub-region, determining 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, then matching a single third image material is performed on the third sub-region; if the number of black unit blocks contained in the third sub-region is greater than the preset threshold, then combining and matching multiple third image materials is performed on the third sub-region.

[0066] In an optional embodiment of the first aspect of the present invention, the combination of three black unit blocks can be arranged in patterns including one on top and two on the bottom (including one on top and one on the right) and two on top and one on the bottom (similarly including one on the bottom and one on the right), or the three black unit blocks can be arranged in a straight line. When matching a single third image material, to improve matching efficiency, suitable image materials can be initially screened based on the number of black unit blocks in the length direction and the width direction of the third sub-region. Then, a second screening is performed by comparing the distribution of each black unit block in the length direction, and a third screening is performed by comparing the distribution of each black unit block in the width direction, ultimately obtaining the required image materials. This leads to specific process steps. The above describes the process of matching a single third image material in 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. This process 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; obtaining a preliminary matching set of third image materials in the target image package based on the number of first unit blocks and the number of second unit blocks; obtaining a first arrangement pattern of the black unit blocks in the length direction of the third sub-region, and performing a first screening of the third image material set based on the first arrangement pattern to obtain a preliminary screening set of third image materials; obtaining a second arrangement pattern of the black unit blocks in the width direction of the third sub-region, and performing a second screening of the preliminary screening set of third image materials based on the second arrangement pattern to obtain the target third image material.

[0067] In an optional embodiment of the first aspect of the present invention, when performing combination matching of multiple image materials for 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 harmonious, it is necessary to reduce the types of image materials in the replacement process, that is, to select the third sub-region using the fewest image materials. Therefore, it is necessary to filter the combination matching of the obtained multiple image materials. In terms of specific process steps, if the number of black unit blocks contained in the third sub-region is greater than a preset threshold, then performing combination matching of multiple third image materials for the third sub-region includes: if there are multiple results of the combination matching, then obtaining the number of third image materials in each combination matching; selecting the combination matching with the fewest number to replace the third sub-region.

[0068] In an optional embodiment of the first aspect of the present invention, in order to better reflect the difference between the image materials of the third sub-region and other regions, the third sub-region should have better overall integrity and the transition between the various image materials should be more reasonable. In terms of specific process steps, if the number of black unit blocks contained in the third sub-region is greater than a preset threshold, then after performing combination matching of multiple third image materials in the third sub-region, the process includes: replacing the third sub-region with multiple third image materials and performing color smoothing transition processing at the junction of the multiple third image materials.

[0069] S500: After the constitutive areas of the black unit blocks in the initial QR code are replaced by the matched image materials, an enhanced QR code is obtained. In this invention, after the constitutive areas of the black unit blocks in the initial QR code are all replaced by suitable image materials, an enhanced QR code can be obtained.

[0070] In short, the main process of the QR code beautification method of this invention can be... Figure 3 As shown, the core idea 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 standard 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 image of the unit 1x1. Other types such as 1x3, 2x2, etc. are optional.

[0072] Step 2: Calculate the position of the image material; The image position is calculated by matching the QR code array (i.e., the combination of black unit blocks) from the largest to the smallest image. If the match is successful, the position in the original array is marked as a match, and the next round of traversal will not participate. Finally, the position array of the image 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. Finally, an aesthetically pleasing QR code based on the image material can be generated.

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

[0075] The material library construction module 10 is used to construct a QR code beautification material library. The QR code beautification material library includes at least one image package with beautification style. Each image package includes a set of image materials for matching different styles of QR code unit block combinations.

[0076] The initial QR code acquisition module 20 is used to acquire the initial QR code to be beautified, which is composed of a number of black unit blocks and a number of white unit blocks;

[0077] The beautification style selection module 30 is used to obtain the target image 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] The black unit block replacement module 40 is used to match and replace the constitutive area of ​​the black unit block in the initial QR code for each image material in the target image package.

[0079] The beautified QR code acquisition module 50 is used to obtain a beautified QR code after the constitutive area of ​​the black unit block in the initial QR code is replaced by each of the matched image materials.

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

[0081] The positioning graphic material acquisition unit is used to acquire, from the target image package, a first image material and a second image material to replace the positioning graphic in the initial QR code;

[0082] The positioning graphic area acquisition unit is used to determine the first sub-region of the positioning graphic from the constitutive region of the black unit block of the initial QR code by shape matching.

[0083] The positioning graphic material replacement unit is used to replace the black unit block in the first sub-region with the first image material and the second image material;

[0084] The non-positioning graphic area splitting unit is used to identify the second sub-region outside the first sub-region in the constitutive region of the black unit block of the initial QR code, and obtain several third sub-regions with different styles from the second sub-region.

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

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

[0087] The sub-region sorting sub-unit is used to sort several different styles of the third sub-regions from largest to smallest based on the number of black unit blocks contained in the third sub-region;

[0088] Sub-regions are sequentially matched with sub-units, which are used to match the third image material in descending order for several different styles of the third sub-regions.

[0089] In an optional embodiment of the second aspect of the present invention, the sequential matching of sub-regions to sub-units includes:

[0090] The threshold judgment upper-level unit is used to determine, 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] Single material matching upper-level unit, used to match a single third image material in 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-level unit is used to perform a combination matching of multiple third image materials on the third sub-region if the number of black unit blocks contained in the third sub-region is greater than a preset threshold.

[0093] In an optional embodiment of the second aspect of the present invention, the single-material matching master unit includes:

[0094] The scale is used to obtain the lower-level 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;

[0095] The material is initially matched to the lower-level unit, which is used to obtain a preliminary matching third image material set in the target image package based on the number of the first unit block and the number of the second unit block;

[0096] The material is screened into lower-level units to obtain the first arrangement pattern of the black unit blocks in the length direction of the third sub-region. Based on the first arrangement pattern, the third image material set is screened once to obtain the initial screened third image material set.

[0097] The material second 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-region, and to perform a second screening on the initial screening third image material set based on the second arrangement pattern to obtain the target third image material.

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

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

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

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

[0102] The lower-level unit is smoothed by replacing multiple third image materials in the third sub-region, and color smoothing is applied to the junctions of the multiple third image materials.

[0103] Figure 5 This is a schematic diagram of the structure of a QR code beautification device provided in an embodiment of the present invention. The QR code beautification device can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 60 (e.g., one or more processors) and a memory 70, and one or more storage media 90 (e.g., one or more mass storage devices) for storing applications 80 or data. The memory and storage media can be short-term or persistent storage. The program stored in the storage media may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the QR code beautification device. Furthermore, the processor may be configured to communicate with the storage media and execute the series of instruction operations in the storage media on the QR code beautification device.

[0104] The QR code enhancement device of this invention may further include one or more power supplies 100, one or more wired or wireless network interfaces 110, one or more input / output interfaces 120, and / or one or more operating systems 130, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 5 The illustrated structure of the QR code enhancement device does not constitute a limitation on QR code-based enhancement devices, and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0105] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the QR code beautification method.

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

[0107] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.

[0108] Although the subject matter has been described using language specific to structural features and / or methodological logic, 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. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A method for beautifying QR codes, characterized in that, include: A QR code beautification material library is constructed, which includes at least one image package with beautification style, and each image package includes a set of image materials for matching different styles of QR code unit block combinations; Obtain the initial QR code to be beautified, which consists of several black unit blocks and several white unit blocks; Based on the user's selected target beautification style, the target image package corresponding to the target beautification style is obtained from the QR code beautification material library; The black unit blocks constituting the initial QR code are matched and replaced in each of the image materials in the target image package; When the black unit blocks constituting the initial QR code are replaced by the matched image materials, an enhanced QR code is obtained; The step of matching and replacing the constituent regions of the black unit blocks in the initial QR code for each image material in the target image package includes: Obtain the first and second image materials from the target image package to replace the positioning graphic in the initial QR code; The first sub-region of the positioning graphic is determined from the constitutive region of the black unit block of the initial QR code by shape matching. Replace the black unit blocks in the first sub-region with the first image material and the second image material; The black unit blocks of the initial QR code are continuously adjacent to each other in the second sub-region outside the first sub-region, and several third sub-regions with different styles are obtained from the second sub-region. For each of the third sub-regions, a third image material corresponding to the third sub-region is obtained from the target image package based on the shape of the third sub-region, and the third image material replaces the third sub-region.

2. The QR code enhancement method according to claim 1, characterized in that, For each of the third sub-regions, obtaining the third image material corresponding to the third sub-region from the target image package based on the shape of the third sub-region, and replacing the third sub-region with the third image material includes: The third sub-regions of several different styles are sorted from largest to smallest based on the number of black unit blocks contained in the third sub-region; For several different styles of the third sub-region, the third image materials are matched sequentially in descending order of size.

3. The QR code enhancement method according to claim 2, characterized in that, The matching of the third image materials for several different styles of the third sub-regions, arranged in descending order, includes: 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 a preset threshold, then the third sub-region is matched with a single third image material; If the number of black unit blocks contained in the third sub-region is greater than a preset threshold, then the third sub-region is subjected to combination matching of multiple third image materials.

4. The QR code enhancement method according to claim 3, characterized in that, If the number of black unit blocks contained in the third sub-region is less than or equal to a preset threshold, then matching a single third image material in the third sub-region includes: 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; Based on the number of the first unit block and the number of the second unit block, a third set of images that is initially matched is obtained in the target image package; Obtain the first arrangement pattern of the black unit blocks in the length direction in the third sub-region, and perform a screening of the third image material set based on the first arrangement pattern to obtain the initial screening of the third image material set; Obtain the second arrangement pattern of the black unit blocks in the width direction of the third sub-region, and perform a second screening on the initial third image material set based on the second arrangement pattern to obtain the target third image material.

5. The QR code enhancement method according to claim 4, characterized in that, If the number of black unit blocks contained in the third sub-region is greater than a preset threshold, then performing a combination matching of multiple third image materials in the third sub-region includes: If there are multiple results for the combined matching, then obtain the number of third image materials in each combined matching; The combination with the fewest occurrences is selected to replace the third sub-region.

6. The QR code enhancement method according to claim 3, characterized in that, If the number of black unit blocks contained in the third sub-region is greater than a preset threshold, then performing a combination matching of multiple third image materials on the third sub-region includes: The third image material is replaced in the third sub-region, and the color transition at the junction of the third image material is smoothed.

7. A QR code beautification system, characterized in that, The beautification system includes: The material library construction module is used to build a QR code beautification material library. The QR code beautification material library includes at least one image package with beautification style. Each image package includes a set of image materials for matching different styles of QR code unit block combinations. The initial QR code acquisition module is used to acquire the initial QR code to be beautified, which consists of a number of black unit blocks and a number of white unit blocks; The beautification style selection module is used to obtain the target image package corresponding to the target beautification style from the QR code beautification material library based on the target beautification style selected by the user. The black unit block replacement module is used to match and replace the constituent areas of the black unit blocks in the initial QR code for each image material in the target image package. The beautified QR code acquisition module is used to obtain a beautified QR code after the constitutive area of ​​the black unit block in the initial QR code is replaced by each of the matched image materials; The black unit block replacement module includes: The positioning graphic material acquisition unit is used to acquire, from the target image package, a first image material and a second image material to replace the positioning graphic in the initial QR code; The positioning graphic area acquisition unit is used to determine the first sub-region of the positioning graphic from the constitutive region of the black unit block of the initial QR code by shape matching. The positioning graphic material replacement unit is used to replace the black unit block in the first sub-region with the first image material and the second image material; The non-positioning graphic area splitting unit is used to identify the second sub-region outside the first sub-region in the constitutive region of the black unit block of the initial QR code, and obtain several third sub-regions with different styles from the second sub-region. The non-positioning graphic area material replacement unit is used to, for each of the third sub-regions, obtain the third image material corresponding to the third sub-region from the target image package based on the shape of the third sub-region, and replace the third sub-region with the third image material.

8. A QR code beautification device, characterized in that, The QR code enhancement device includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; The at least one processor invokes the instructions in the memory to cause the QR code enhancement device to perform the QR code enhancement method as described in any one of claims 1-6.

9. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the QR code beautification method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Method for generating two-dimensional code

    CN106570550A