A two-dimensional code image super-resolution method based on a complete reference map

By employing a QR code image super-resolution method based on a complete reference map, gradient domain feature matching and sparse feature extraction are combined with VGG network and residual attention blocks to generate high-resolution QR code images. This solves the problems of low QR code image recognition rate and high computational cost in existing technologies, and achieves efficient recognition in complex environments.

CN122115211APending Publication Date: 2026-05-29TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TIANJIN UNIV
Filing Date
2026-02-09
Publication Date
2026-05-29

Smart Images

  • Figure CN122115211A_ABST
    Figure CN122115211A_ABST
Patent Text Reader

Abstract

The application discloses a two-dimensional code image super-resolution method based on a complete reference map, and relates to the technical field of computer vision, which aims to reconstruct an accurate high-resolution image from a low-resolution two-dimensional code image to improve the recognition success rate of a code scanning device. By utilizing the high similarity between two-dimensional code images and the modular structure characteristics thereof, a complete reference map of a two-dimensional code basic pattern is constructed; in combination with a reference super-resolution technology based on deep learning in the field of natural images, high-frequency information in the reference map is matched and fused with low-frequency information of a low-resolution image, so that a high-resolution two-dimensional code image with clear texture and accurate structure is reconstructed, and the two-dimensional code image can be effectively recognized by a code scanning device. The application can be applied to various two-dimensional code recognition devices, and significantly improves the recognition rate of two-dimensional codes under a long-distance condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, specifically to a QR code image super-resolution method based on a complete reference image. Background Technology

[0002] In recent years, the rapid development of deep learning technology has driven innovation in the field of image super-resolution, giving rise to various technical approaches such as discriminative super-resolution, generative super-resolution, single-image super-resolution, and reference-image-based super-resolution. Solutions based on different network frameworks such as CNN, Transformer, and GAN have been developed, adaptable to various application scenarios, including simulating low-resolution images or real-world degraded images. In the area of ​​QR code super-resolution, there have been attempts to improve the recognition rate of super-resolution QR codes by constructing deep learning networks that include feature encoders, feature fusion, feature reconstruction, and feature decoders, providing initial technical support for solving the problem of low-resolution QR code recognition.

[0003] However, existing image super-resolution techniques suffer from significant limitations: research specifically targeting QR code images is scarce, with most schemes simply adopting the techniques used in super-resolution of natural images, failing to fully exploit the unique characteristics of QR codes. The core difference between QR codes and natural images lies in their strong regularity—they possess a clear modular structure, and different QR code images exhibit high similarity. Existing methods do not specifically utilize these characteristics, resulting in insufficient adaptability of super-resolution schemes to QR code images and limited improvement effects.

[0004] The aforementioned technical deficiencies directly lead to prominent problems in practical applications: In real-world environments such as industrial settings, due to the small size of goods and the limited size of QR codes, a significant distance easily forms between the scanning device and the QR code, resulting in insufficient resolution and severe degradation of the captured QR code image. Existing super-resolution methods struggle to accurately restore the texture and structure of such QR codes, leading to a low recognition success rate for scanning devices. Unrecognized goods require additional manpower and resources for re-inspection, severely impacting inspection efficiency and increasing operating costs. Especially when QR codes are rotated or otherwise complex, the performance of existing methods deteriorates significantly, resulting in image blurring and pattern errors, further limiting their reliable application in real-world scenarios.

[0005] Therefore, there is an urgent need to develop a super-resolution method that fully integrates the characteristics of QR codes and adapts to real-world application scenarios in order to break through existing technological bottlenecks. Summary of the Invention

[0006] 1. The technical problem to be solved by the present invention

[0007] The purpose of this invention is to propose a QR code image super-resolution method based on a complete reference image to solve the following problems existing in the prior art: (1) Existing QR code image super-resolution methods have not fully explored the core characteristics of QR codes (strong regularity and modular structure, high similarity between different QR codes). They simply follow the idea of ​​super-resolution of natural images. For QR code images with low resolution and complex degradation (such as noise and blur) caused by long-distance shooting in real scenes, it is difficult to effectively improve the resolution, which leads to low recognition success rate of scanning devices and affects the work efficiency in industrial and other scenarios.

[0008] (2) Traditional reference super-resolution methods rely on reference maps that are similar to the content of the target image. Such reference maps are difficult to obtain, and randomly selected QR code reference maps cannot cover all possible local patterns. At the same time, traditional reference maps have high computational overhead when matching features and lack universality for adapting to QR code images. They are difficult to efficiently provide comprehensive and accurate high-resolution reference information for low-resolution QR codes, which restricts the super-resolution effect and efficiency.

[0009] 2. Technical Solution To achieve the above objectives, this invention utilizes the modularity of QR codes and reference super-resolution methods in the field of image super-resolution to complete a super-resolution method for QR code images, significantly improving the recognition rate of low-resolution QR code images after super-resolution. The specific technical solution is as follows: A QR code image super-resolution method based on a complete reference image includes the following steps: S1, acquire a low-resolution target QR code image (LR), a high-resolution reference image (RefHR) corresponding to a complete reference image of the basic QR code pattern, and a low-resolution reference image (RefLR) obtained by degrading the RefHR through a degradation simulation model (PDM). S2, extract the gradient features of the low-resolution target QR code image (LR) and the low-resolution reference image (RefLR) respectively to obtain their gradient domain images; S3, the gradient domain images of the low-resolution target QR code image (LR) and the low-resolution reference image (RefLR) are expanded into image blocks respectively, the cosine similarity between each low-resolution target QR code image (LR) image block and the low-resolution reference image (RefLR) image block is calculated, and the similarity value (S) and position index (H) of the most similar low-resolution reference image (RefLR) image block corresponding to each low-resolution target QR code image (LR) image block are obtained through sparse feature matching, forming a corresponding position index map between the low-resolution target QR code image (LR) and the high-resolution reference image (RefHR); S4, extract the three-scale reference features of the high-resolution reference image (RefHR) using a VGG network. The three-scale reference features include F-values ​​of the same size as the low-resolution target QR code image (LR). 1 Ref LR twice the size of F 2 Ref and F4 times the size of low-resolution target QR code image (LR) 3 Ref Image features (F) of the low-resolution target QR code image (LR) are extracted using residual attention blocks (RABs). LR ); S5, based on the location index map, extract the reference features corresponding to the location from the three-scale reference features, and sequentially process the image features (F) through the soft attention module (SAB) and the residual attention module (RAB). LR The features are fused step by step with reference features at each scale, and finally the contribution of reference features and low-resolution target QR code image (LR) features is weighed by the selective feature fusion module (SFF). S6, based on the composite loss function, trains the network to reconstruct a high-resolution target QR code image (HR).

[0010] Preferably, the gradient features in S2 include horizontal gradient features and vertical gradient features, calculated using the gradient calculation function Grad( (Get)

[0011] Preferably, the step size of the image patch in S3 is set to 3, and the sparse feature matching is achieved by calculating the cosine similarity of the image patch vectors. The formula for calculating the cosine similarity is: In the formula, This represents the vector normalization operation. q i and k i express Q and K The first in i and j The block vector of position, <·,·> denotes the dot product; s i,j express q i and k i The cosine similarity.

[0012] Preferably, the degradation simulation model (PDM) described in S1 is trained using a high-resolution binary QR code image and a real low-resolution image, and the degradation process satisfies the formula:

[0013] In the formula: I HR This represents the input high-resolution image. I LR This represents a low-resolution image obtained after degradation. This represents the degradation process of the PDM model. ω Indicates the fuzzy kernel. ↓ indicates convolution, and ↓ indicates downsampling. n Indicates noise.

[0014] Preferably, the step-by-step fusion process described in S5 is as follows: first, the image features (F) are processed by SAB. LR ) and F 1 Ref After initial fusion, the sampled size is doubled after enhancement by the Residual Attention Module (RAB) and then compared with F. 2 Ref The process of repeating the soft attention module (SAB) + residual attention module (RAB) fusion is then upsampled to four times the size and F. 3 Ref The feature fusion process is then completed by inputting the Selective Feature Fusion (SFF) module into the input.

[0015] Preferably, the composite loss function described in S6 includes reconstruction loss (Lrec), perceptual loss (Lper), gradient loss (Lgrad), frequency domain loss (Lk), adversarial loss (Ladv), and feature-perceptual loss (Ltpl), and the total loss function formula is:

[0016]

[0017] In the formula, λ rec , λ per , λ tpl , λ adv , λ grad and λ k These represent the reconstruction loss weights, perceptual loss weights, feature-perceptual loss weights, adversarial loss weights, gradient loss weights, and frequency domain loss weights, respectively. L rec , L per , L tpl , L adv , L grad , L kThese represent the reconstruction loss function, the perceptual loss function, the feature-perceptual loss function, the adversarial loss function, the gradient loss function, and the frequency domain loss function.

[0018] Preferably, the gradient loss calculation formula is as follows:

[0019] In the formula: I SR and I HR This refers to the super-resolution image and the high-resolution image; grad(·) calculates the gradient of the image, ||·||1 refers to the L1 norm, and H and W are the height and width of the high-resolution image; the frequency domain loss calculation formula is: , In the formula: fft(·) refers to taking the Fast Fourier Transform of the image, abs(·) means taking the absolute value, that is, taking the spectral amplitude; ||·||2 refers to the L2 norm.

[0020] A method for generating a complete reference library of basic QR code patterns includes the following steps: S1, determine the size of the basic pattern unit in the QR code image as M×N pixels, where M and N are both positive integers; S2, enumerate all possible combinations of the M×N pixel basic pattern unit in all binary states; S3: Arrange all the enumerated basic patterns in a regular pattern on an image to generate a complete reference image.

[0021] Preferably, M=3, N=3, and the total number of binary state combinations of the M×N pixel basic pattern unit is 2. 9 =512 kinds.

[0022] Compared with existing technologies, the QR code image super-resolution method based on a complete reference image provided by this invention has the following beneficial effects: (1) In existing technologies, natural image reference super-resolution relies on reference images with similar scenes, which are difficult to obtain; randomly selected QR code reference images have the problem of incomplete local pattern coverage and high matching computation overhead. This solution, considering the modular nature of QR codes, designs a complete reference image of a 3×3 pixel basic pattern, and exhaustively enumerates 2... 9=512 binary combinations, ensuring that any partial pattern of a QR code can find a corresponding high-resolution unit in the reference image, achieving complete coverage. This reference image is applicable to all standard QR codes and has strong universality; at the same time, the image block stride can be set to 3 during matching, which significantly reduces the amount of computation compared to a stride of 1, balancing matching efficiency and super-resolution effect, and solving the pain points of traditional reference images such as "incomplete coverage, poor universality, and low computational efficiency".

[0023] (2) Existing QR code super-resolution methods mostly follow the idea of ​​natural image super-resolution, failing to fully utilize the rich gradient information and modular structure of QR codes. The reference super-resolution network designed in this scheme adopts gradient domain feature matching instead of traditional feature domain matching to accurately capture the gradient texture information of QR codes in the horizontal and vertical directions, adapting to their black and white modular characteristics; at the same time, it adopts a sparse matching method, combined with the characteristics of a complete reference image, to further reduce computational overhead. In the feature fusion stage, through the combination of soft attention module, residual attention module and selective feature fusion module, multi-scale features are fused step by step, adaptively balancing the contribution of low-resolution image and reference image features, which not only improves the accuracy of reconstructed details, but also reduces network parameters and computational load, making it more in line with the core requirements of QR code super-resolution compared to traditional networks.

[0024] (3) Existing methods are mostly geared towards simulating low-resolution images, which is insufficient for simulating complex degradations (such as noise and blur) in real-world scenes, and their performance drops significantly under complex conditions such as rotated QR codes. This solution generates a low-resolution reference image that is closer to the real scene by training a degradation simulation model (PDM) based on real high- and low-resolution images, thus improving the adaptability to real degradations. At the same time, gradient loss and frequency domain loss are added to the composite loss function to ensure the consistency between the super-resolution image and the high-resolution image in the gradient domain and frequency domain, respectively, so as to better restore high-frequency details. Experiments show that this solution can reconstruct clear and accurate QR code images under both non-rotation and rotation conditions, avoiding problems such as "blur and pattern errors" in traditional methods, and significantly improving the recognition success rate of QR codes under long distance and complex conditions. Attached Figure Description

[0025] Figure 1 This is a schematic diagram of the overall structural framework of the model of the present invention; Figure 2 This is a complete reference diagram of the present invention and a schematic diagram of its construction principle; Figure 3 This is a schematic diagram of the visual results of the present invention on a non-rotating QR code; Figure 4 This is a schematic diagram of the visual result of the present invention on a rotating QR code. Detailed Implementation

[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0027] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.

[0028] Example 1, please refer to Figures 1 to 4 As shown: To address the problems mentioned in the technical solutions, this application provides a QR code image super-resolution method based on a complete reference image, as detailed below: The super-resolution network of this invention employs a reference super-resolution network based on a CNN structure, such as... Figure 1 As shown, the network consists of two main parts: a) a gradient matching and feature extraction module; and b) a feature fusion and image reconstruction module. The network receives three input images: a low-resolution QR code image LR, a high-resolution reference image Ref HR, and a low-resolution reference image Ref LR obtained by degrading Ref HR.

[0029] In the first stage, the gradients of LR and Ref LR are calculated to obtain their gradient domain images. Then, the gradient images are unfolded into image patches, and the cosine similarity between the LR image patch and the Ref LR image patch is calculated, thereby obtaining the similarity value S and position index H of the most similar Ref LR patch for each LR patch. Based on this position index H, reference features at the corresponding positions are extracted from the three-scale features extracted from the Ref HR via the VGG network for subsequent fusion.

[0030] In the second stage, the LR image is input into the RABs module to extract LR image features. F LR Next, F LR With three-scale reference features ( F 1 Ref 、F 2 Ref 、F 3 Ref The images are fed into a series of modules consisting of SAB, RABs, and SFF for fusion and reconstruction, ultimately restoring the high-resolution QR code image HR.

[0031] Gradient matching and feature extraction; Reference super-resolution methods in the field of natural image super-resolution are relatively mature. This paper adopts one of the mainstream methods, firstly finding a high-resolution reference image Ref HR that is similar to the current low-resolution input image LR. The Ref HR is then downsampled to the same resolution as LR, resulting in Ref LR. Subsequently, LR and Ref LR are sliced ​​into image patches, and each image patch is treated as a vector. The cosine similarity between the LR patch and the Ref LR patch is calculated. Based on this, the most similar Ref LR patch is found for each LR patch, and its position index in the original Ref HR is recorded, ultimately forming a corresponding position index map H between LR and Ref HR. Based on this index map H, this paper can extract the corresponding high-resolution reference features from Ref HR. F Ref For subsequent network use.

[0032] Unlike previous methods, traditional reference super-resolution methods are typically geared towards simulated image super-resolution, with their RefLR often obtained through ideal degradation methods such as bicubic downsampling. However, the real-world low-resolution QR code images processed in this paper contain more complex degradation phenomena, which are difficult to simulate using only bicubic downsampling. Therefore, this paper employs a degradation simulation model (PDM) trained on binary QR code HR images and real-world LR images to simulate degradation of the Ref HR, thereby making the generated Ref LR closer to the characteristics of real LR images. The degradation simulation process can be expressed by the following formula: (1) In the formula: I HR This represents the input high-resolution image. I LR This represents a low-resolution image obtained after degradation. This represents the degradation process of the PDM model. ω Indicates the fuzzy kernel. ↓ indicates convolution, and ↓ indicates downsampling. n Indicates noise.

[0033] Furthermore, due to the modular nature of QR codes (black and white), QR code images possess rich gradient information in both horizontal and vertical directions. Therefore, this paper chooses to divide the LR and Ref LR into image blocks in the gradient domain and then calculate the cosine similarity. This process can be represented by the following two formulas:

[0034]

[0035] (2) In the formula: ILR This represents the input low-resolution image. I Ref Represents a high-resolution reference image. I Ref↓ This indicates the low resolution obtained by degrading the high-resolution reference image. The resolution reference image shows Grad(·) for calculating the gradient and Vgg(·) for extracting features using Vgg. Q and K represent... I LR and I Ref↓ gradient plot, V express I Ref The Vgg feature.

[0036] (3) In the formula: ψ(·) represents normalization of the vector. q i and k i express Q and K The first in i and j The block vector of position, <·,·> denotes the dot product, s i,j express q i and k i The cosine similarity.

[0037] Feature fusion and image reconstruction; Because of the four-fold size difference between the low-resolution image and its corresponding high-resolution reference image, their image features cannot be directly fused. Therefore, this paper, referencing mainstream methods, first performs multi-scale feature extraction on the high-resolution reference image, obtaining three features of different sizes: features of the same size as the LR image. F 1 Ref LR twice the size F 2 Ref And LR four times the size F 3 Ref After extracting multi-scale high-resolution features, they are combined with low-resolution image features F through a series of convolutional networks. LR Integration at each level.

[0038] The fusion modules used in this paper mainly include the soft attention module (SAB), the residual attention module (RAB), and the selective feature fusion module (SFF). First, the fusion modules are... F LR Same size F1 Ref The input soft attention module is used for initial fusion.

[0039] The computation process of the soft attention module can be represented as follows: (4) In the formula: F LR , F 3 Ref Representing LR features and Ref HR features at the same scale as LR. F fuse The '·' indicates the features after fusion, Concate(·) indicates concatenation along the channel dimension, Conv(·) indicates convolution, and ☉ indicates element-wise multiplication.

[0040] Subsequently, the fused features are further enhanced using a residual attention module, which incorporates both channel and spatial attention mechanisms. This module adaptively enhances important features and suppresses redundant information, thereby improving the network's ability to model key details. Next, the enhanced features are upsampled to twice their size and compared with reference features of the same scale. F 2 Ref The fusion is performed in the same way, that is, it is processed again by the soft attention module and the residual attention module. This process is recursively applied step by step to achieve multi-scale feature fusion.

[0041] Finally, the fused features from the two scales are input into a selective feature fusion module, which adaptively balances the contributions of reference and input features to the reconstruction result, thus selectively utilizing high-resolution reference information. Ultimately, the network outputs the super-resolution image.

[0042] 1.4 Loss Function Similar to previous methods, this paper also employs a composite loss function, including reconstruction loss, perceptual loss, gradient loss, frequency domain loss, adversarial loss, and feature-perceptual loss. The total loss function can be expressed as:

[0043] (5) In the formula: λ rec , λ per , λ tpl , λ adv , λ grad and λ k These represent the reconstruction loss weights, perceptual loss weights, feature-perceptual loss weights, adversarial loss weights, gradient loss weights, and frequency domain loss weights, respectively. L rec ,L per , L tpl , L adv , L grad , L k These represent the reconstruction loss function, the perceptual loss function, the feature-perceptual loss function, the adversarial loss function, the gradient loss function, and the frequency domain loss function.

[0044] TTSR employs four loss functions, and this paper adds gradient loss and frequency domain loss to these four functions. Gradient loss aims to utilize the rich gradient information of the QR code image to ensure that the SR and HR remain consistent in the gradient domain. Frequency domain loss aims to enable the model to maintain consistency between SR and HR in the frequency domain, thus better reconstructing high-frequency details. Its calculation process can be expressed by the following two formulas: (6) In the formula: I SR and I HR This refers to the super-resolution image and the high-resolution image. grad(·) calculates the gradient of the image, ||·||1 refers to the L1 norm, and H and W are the height and width of the high-resolution image.

[0045] (7) In the formula: fft(·) refers to taking the Fast Fourier Transform of the image, abs(·) represents taking the absolute value, i.e., taking the spectral amplitude. ||·||2 refers to the L2 norm.

[0046] Design concept and principles of this scheme In the field of natural image super-resolution, reference images typically need to be similar to the content or scene of the low-resolution image to be processed, differing only in viewpoint or scale. Obtaining such reference images is quite difficult. However, for QR code images, due to the high structural similarity between different QR codes, obtaining high-resolution reference images is relatively simple—theoretically, any high-resolution QR code image can be selected. But this method still has limitations: the randomly selected reference image may not completely cover the local patterns in the image to be super-resolution.

[0047] To fully utilize the inherent characteristics of QR code images, if we can identify the patterns in their composition, extract all basic pattern units, and combine them into a complete reference image, then this reference image can be applied to any QR code image. This is because any partial pattern in any QR code can find an identical corresponding unit in this reference image.

[0048] In-depth analysis of the QR code generation mechanism reveals that in the initial stage of information encoding, the QR code pattern appears as unevenly distributed black and white blocks. Only after processing with eight regularly repeating mask patterns does it form the final visually uniformly distributed QR code. Inspired by the regularity of the mask patterns, this paper hypothesizes that the QR code itself may also be composed of several regular basic patterns, and proposes a method for constructing a complete set of basic QR code patterns.

[0049] The key to constructing this complete set lies in identifying the patterns in the local patterns within the QR code. From a holistic perspective, the distribution of black and white modules in the QR code appears random, making it difficult to directly discover patterns. However, if the observation scale is reduced to a fixed-size local unit (such as a 3×3 module), the pattern becomes clearer. This allows for a clear identification of the combination rules. By exhaustively listing all possible pattern combinations for this size, a complete set of basic patterns can be constructed. Specifically, in a 3×3 module, each position has two states: black or white. Through permutations and combinations, a total of 2... 9 =512 basic patterns. Arranging these patterns systematically in an image creates the desired complete reference image, such as... Figure 2 As shown.

[0050] The design concept of using 3×3 modules as units originates from the feature matching principle between the reference image and the low-resolution image. This process divides the image into small square tiles such as 3×3 and 4×4, and then matches them by calculating the cosine similarity between the tiles. Therefore, this paper borrows a similar approach to deconstruct the QR code pattern.

[0051] The reason for choosing 3×3 instead of a larger size (such as 4×4) is that although different sizes can all construct complete reference images, as the size of the basic pattern increases, the number of possible pattern combinations increases exponentially (2 to the power of n), resulting in a significant increase in the size of the final reference image, which in turn greatly increases memory usage and computational overhead. To balance completeness and computational efficiency, this paper ultimately decided to use 3×3 as the basic pattern size.

[0052] 1. Completeness and effectiveness: Ensure that any basic pattern in the QR code image can be found in a corresponding high-resolution pattern in the reference image; 2. Universality: It can serve as a universal QR code image reference and is applicable to QR codes of any standard pattern; 3. High efficiency: Since the reference image pattern is arranged in a 3×3 module pattern, when performing feature matching with low-resolution images, the step size of the image patch can be set to 3, which significantly reduces the amount of computation compared to a step size of 1 and improves the matching efficiency.

[0053] Example 2: Based on Embodiment 1, but with some differences, the following description, in conjunction with specific examples and accompanying drawings, illustrates the proposed QR code image super-resolution method based on a complete reference image. To evaluate the efficiency and effectiveness of the proposed model, it is compared with SISR methods (including EDSR and RCAN) and RefSR methods (including TTSR, MASA, DATSR, and SSMTF). For a fair comparison, the above methods are retrained on the same training set using default settings (except for changing the first convolutional layer adapted to grayscale input). TTSR and MASA use the same reference image as proposed, while DATSR and SSMTF models restrict the Ref and HR resolutions to be the same. Since the complete reference image has a higher resolution than a standard QR code reference image, forcibly cropping or scaling would result in a resolution difference between the resulting reference image module and the standard QR code module, thus losing its completeness. Therefore, a standard QR code is used as the reference image.

[0054] Qualitative comparison. Visual comparison results are as follows: Figure 3 and Figure 4 As shown. The part in the box indicates a blurry image or a module error.

[0055] Figure 3 The super-resolution result represents the non-rotated QR code image, where Figure 3 The top image represents the overall visual effect. It can be seen that the results of EDSR and RCAN have large areas of blur and erroneous patterns, while the results of the RefSR method are more stable. The results of the RefSR method are better, with no obvious blur and pattern errors. Figure 3 The image below represents the visual effect after magnification of a portion of the image. Figure 3 (See the bottom left corner of the image). We can see that the SISR method produces a smooth image with lost texture details, while the RefSR method produces a clear image with more realistic texture details. Compared to other methods, the method presented in this paper reconstructs a clean and clear QR code image without obvious error patterns.

[0056] The super-resolution results for rotating QR codes show a significant performance degradation across various comparison methods. EDSR and RCAN both exhibit overall image blurring, while DATSR and SSMTF show varying degrees of blurring and erroneous patterns. Figure 3 Even TTSR and MASA, which performed well in the tests, showed significant pattern errors to varying degrees. However, the method presented in this paper maintained good performance on rotated QR codes, reconstructing clear and accurate QR code patterns.

[0057] It should be noted that the term "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0058] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A QR code image super-resolution method based on a complete reference image, characterized in that, Includes the following steps: S1, acquire a low-resolution target QR code image (LR), a high-resolution reference image (RefHR) corresponding to a complete reference image of the basic QR code pattern, and a low-resolution reference image (RefLR) obtained by degrading the RefHR through a degradation simulation model (PDM). S2, extract the gradient features of the low-resolution target QR code image (LR) and the low-resolution reference image (RefLR) respectively to obtain their gradient domain images; S3, the gradient domain images of the low-resolution target QR code image (LR) and the low-resolution reference image (RefLR) are expanded into image blocks respectively, the cosine similarity between each low-resolution target QR code image (LR) image block and the low-resolution reference image (RefLR) image block is calculated, and the similarity value (S) and position index (H) of the most similar low-resolution reference image (RefLR) image block corresponding to each low-resolution target QR code image (LR) image block are obtained through sparse feature matching, forming a corresponding position index map between the low-resolution target QR code image (LR) and the high-resolution reference image (RefHR); S4, extract the three-scale reference features of the high-resolution reference image (RefHR) using a VGG network. The three-scale reference features include F-values ​​of the same size as the low-resolution target QR code image (LR). 1 Ref LR twice the size of F 2 Ref and F4 times the size of low-resolution target QR code image (LR) 3 Ref Image features (F) of the low-resolution target QR code image (LR) are extracted using residual attention blocks (RABs). LR ); S5, based on the location index map, extract the reference features corresponding to the location from the three-scale reference features, and sequentially process the image features (F) through the soft attention module (SAB) and the residual attention module (RAB). LR The features are fused step by step with reference features at each scale, and finally the contribution of reference features and low-resolution target QR code image (LR) features is weighed by the selective feature fusion module (SFF). S6, based on the composite loss function, trains the network to reconstruct a high-resolution target QR code image (HR).

2. The QR code image super-resolution method based on a complete reference image according to claim 1, characterized in that, The gradient features described in S2 include horizontal gradient features and vertical gradient features, which are calculated using the gradient calculation function Grad( (Get) 3. The QR code image super-resolution method based on a complete reference image according to claim 1, characterized in that, The step size of the image patch in S3 is set to 3. The sparse feature matching is achieved by calculating the cosine similarity of the image patch vectors. The formula for calculating the cosine similarity is: In the formula, This represents the vector normalization operation. q i and k i express Q and K The first in i and j The block vector of position, <·,·> denotes the dot product; s i,j express q i and k i The cosine similarity.

4. The QR code image super-resolution method based on a complete reference image according to claim 1, characterized in that, The degradation simulation model (PDM) described in S1 is trained using high-resolution binary QR code images and real low-resolution images. The degradation process satisfies the formula: In the formula: I HR This represents the input high-resolution image. I LR This represents a low-resolution image obtained after degradation. This represents the degradation process of the PDM model. ω Indicates the fuzzy kernel. ↓ indicates convolution, and ↓ indicates downsampling. n Indicates noise.

5. The QR code image super-resolution method based on a complete reference image according to claim 1, characterized in that, The step-by-step fusion process described in S5 is as follows: First, the image features (F) are processed by SAB. LR ) and F 1 Ref After initial fusion, the sampled size is doubled after enhancement by the Residual Attention Module (RAB) and then compared with F. 2 Ref The process of repeating the soft attention module (SAB) + residual attention module (RAB) fusion is then upsampled to four times the size and F. 3 Ref The feature fusion process is then completed by inputting the Selective Feature Fusion (SFF) module into the input.

6. The QR code image super-resolution method based on a complete reference image according to claim 1, characterized in that, The composite loss function described in S6 includes reconstruction loss (Lrec), perceptual loss (Lper), gradient loss (Lgrad), frequency domain loss (Lk), adversarial loss (Ladv), and feature-perceptual loss (Ltpl). The formula for the total loss function is: In the formula, λ rec , λ per , λ tpl , λ adv , λ grad and λ k These represent the reconstruction loss weights, perceptual loss weights, feature-perceptual loss weights, adversarial loss weights, gradient loss weights, and frequency domain loss weights, respectively. L rec , L per , L tpl , L adv , L grad , L k These represent the reconstruction loss function, the perceptual loss function, the feature-perceptual loss function, the adversarial loss function, the gradient loss function, and the frequency domain loss function.

7. The QR code image super-resolution method based on a complete reference image according to claim 6, characterized in that, The gradient loss calculation formula is as follows: In the formula: I SR and I HR This refers to the super-resolution image and the high-resolution image; grad(·) calculates the gradient of the image, ||·||1 refers to the L1 norm, and H and W are the height and width of the high-resolution image; the frequency domain loss calculation formula is: , In the formula: fft(·) refers to taking the Fast Fourier Transform of the image, abs(·) means taking the absolute value, that is, taking the spectral amplitude; ||·||2 refers to the L2 norm.

8. A method for generating a complete reference image library of basic QR code patterns, applicable to the QR code image super-resolution method based on a complete reference image as described in any one of claims 1-8, characterized in that... Includes the following steps: S1, determine the size of the basic pattern unit in the QR code image as M×N pixels, where M and N are both positive integers; S2, enumerate all possible combinations of the M×N pixel basic pattern unit in all binary states; S3: Arrange all the enumerated basic patterns in a regular pattern on an image to generate a complete reference image.

9. A method for generating a complete reference library of basic QR code patterns according to claim 8, characterized in that, With M=3 and N=3, the total number of binary state combinations for the M×N pixel basic pattern unit is 2. 9 =512 kinds.