CN117151984B - Two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance - Google Patents

Two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance Download PDF

Info

Publication number
CN117151984B
CN117151984B CN202311248275.2A CN202311248275A CN117151984B CN 117151984 B CN117151984 B CN 117151984B CN 202311248275 A CN202311248275 A CN 202311248275A CN 117151984 B CN117151984 B CN 117151984B
Authority
CN
China
Prior art keywords
resolution
bar code
super
image
dimensional bar
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311248275.2A
Other languages
Chinese (zh)
Other versions
CN117151984A (en
Inventor
岳焕景
王晨
郭锋
李坤
杨敬钰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin University
Original Assignee
Tianjin University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin University filed Critical Tianjin University
Priority to CN202311248275.2A priority Critical patent/CN117151984B/en
Publication of CN117151984A publication Critical patent/CN117151984A/en
Application granted granted Critical
Publication of CN117151984B publication Critical patent/CN117151984B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4053Scaling of whole images or parts thereof, e.g. expanding or contracting based on super-resolution, i.e. the output image resolution being higher than the sensor resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4046Scaling of whole images or parts thereof, e.g. expanding or contracting using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • G06V10/806Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Medical Informatics (AREA)
  • Multimedia (AREA)
  • Databases & Information Systems (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a two-dimensional bar code super-resolution method based on frequency domain constraint and reference diagram guidance, which comprises the following steps: s1, establishing a two-dimensional bar code image super-data set under a real degradation condition; s2, constructing a network frame: designing a feature matching module based on a gradient domain, reconstructing a main network by using a multi-scale feature, extracting features in a high-resolution reference picture by using the feature matching module, and fusing the features with low-resolution features in the reconstruction network to synthesize high-resolution features; s3, designing a two-dimensional barcode super-resolution scheme, and constructing a reference image guided two-dimensional barcode super-resolution model according to the design scheme; s4, training a model; s5, inputting a super-resolution data set of the two-dimensional bar code under the real degradation condition into the stable model to obtain a super-resolution reconstruction result of the two-dimensional bar code. The invention greatly improves the recognition precision of the reconstructed low-resolution two-dimensional bar code by using the methods of data domain alignment, gradient domain matching and frequency domain constraint.

Description

Two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance
Technical Field
The invention relates to the technical field of image signal processing, in particular to a two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance.
Background
With the continuous development of information technology, two-dimensional bar codes have become data storage and information transmission modes commonly used in the fields of logistics transportation, information identification, intelligent detection and the like, and have important significance for industrial production automation and logistics intellectualization. However, in the practical application scenario, the success rate of decoding and recognition is seriously affected by degradation blurring caused by environment and the like due to the difference of codeword sizes. The existing two-dimensional bar code recognition technology mainly focuses on the detection, positioning and decoding technology of the two-dimensional bar code. The restoration research on the low-resolution bar code is lacking, so that the enhancement and reconstruction of the low-resolution bar code image are of great significance in improving the recognition success rate of the two-dimensional bar code in automatic production.
In recent years, the application of the deep learning technology in the field of image super-resolution has greatly progressed, and various super-resolution data sets are continuously complete. However, many super-resolution methods based on deep learning technology are developed for natural images, and compared with natural images, two-dimensional bar codes have different structural characteristics, such as abundant texture information, fixed image paradigms, and the like, and currently still lack super-resolution methods for reconstructing two-dimensional bar code images. In addition, most of the super-resolution methods are based on simulation images at present, and although the super-resolution methods based on simulation images have remarkable results in improving the visual quality of images, the methods have the problem of performance degradation when processing actual degraded images. This is because the actual degraded image is often accompanied by complex degradation types, noise, distortion, etc., and higher demands are placed on the super-resolution method. Therefore, related research is necessary for a two-dimensional bar code super-resolution algorithm under a real degradation condition.
Disclosure of Invention
In order to realize accurate super-resolution reconstruction of a low-resolution two-dimensional bar code in an actual degradation environment, the invention aims to realize a super-resolution method applicable to the field of the two-dimensional bar code through guidance of a high-resolution reference bar code.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
the two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance specifically comprises the following steps:
s1, establishing a two-dimensional bar code image super-data set under a real degradation condition;
S2, constructing a network frame: designing a feature matching module based on a gradient domain, reconstructing a main network by using a multi-scale feature, extracting features in a high-resolution reference picture by using the feature matching module, and fusing the features with low-resolution features in the reconstruction network to synthesize high-resolution features. In order to reduce the resolution interval between the reference image bar code and the low resolution bar code, a degradation network based on GAN constraint is adopted to degrade the reference image bar code into the low resolution bar code. Finally, training the whole network in a mode of constraint optimization of a composite function;
S3, designing a two-dimensional barcode super-resolution scheme, and constructing a reference image guided two-dimensional barcode super-resolution model according to the designed scheme: based on the specific structural characteristics and priori information of the two-dimensional bar code, designing a low-resolution two-dimensional bar code superdistribution scheme by combining the real degenerate two-dimensional bar code superdistribution data set and the network frame in S1-S2, and constructing a two-dimensional bar code superdistribution network guided by a reference picture according to the designed two-dimensional bar code superdistribution scheme;
S4, training a model: traversing the two-dimensional bar code super-resolution dataset constructed in the step S1 by utilizing a deep learning Pytorch framework training model until a network loss function converges, then reducing the learning rate to 0.00001, and then continuing traversing the super-resolution dataset for a plurality of times to obtain a final stable model;
S5, outputting a result: inputting the data set in the super-data set of the two-dimensional bar code under the real degradation condition obtained in the step S1 into the stable model to obtain a super-resolution reconstruction result of the two-dimensional bar code.
Preferably, in step S1, the creating a super-resolution dataset of the two-dimensional barcode image under the real degradation condition specifically includes:
A11, printing the two-dimensional bar codes on A4 paper according to fixed arrangement, keeping the position of a camera fixed, and shooting to generate a high-resolution bar code image I HR and a low-resolution bar code image I LR by adjusting the size of a printing code word;
And A12, preprocessing the generated image data, detecting the outline of the code word through an edge detection algorithm, cutting out the image data containing a single two-dimensional bar code, and further obtaining a two-dimensional bar code super-resolution data set under a real degradation condition.
Preferably, in step S2, in order to reduce the resolution interval between the reference image bar code and the low resolution bar code, a degradation network based on GAN constraint is used to degrade the reference image bar code into the low resolution bar code, and finally, the whole network is trained in a mode of constraint optimization of a composite function.
Preferably, in step S3, a low-resolution two-dimensional barcode superdivision scheme is designed based on the specific structural features and priori information of the two-dimensional barcode in combination with the real degenerate two-dimensional barcode superdivision dataset and the network frame in S1-S2, and a two-dimensional barcode superdivision network guided by a reference map is built according to the designed two-dimensional barcode superdivision scheme, which specifically comprises the following steps:
A31, selecting a reference diagram: according to the type of the two-dimensional bar code data obtained in the step S1, a reference graph set (REFERENCE POOL) covering all two-dimensional bar code size versions and rotation angles is established; when a low-resolution image is input, detecting the edge contour size and the rotation angle of the bar code by adopting a Canny edge detection algorithm, and selecting a corresponding reference image from a reference image set based on the edge contour size and the rotation angle;
A32, degradation will be referred to: a degradation model is pre-trained by adopting a GAN-based network aiming at the degradation process of the low-resolution image and the high-resolution image, and then the degradation model is applied to the high-resolution reference image bar code to degrade the high-resolution reference image bar code to a uniform scale with the input low-resolution bar code;
A33, performing gradient domain-based feature matching: respectively extracting gradient domain images from the degraded reference image and the low-resolution bar code, estimating the similarity between the gradient domain images and the low-resolution bar code, and taking the feature image with three high similarity to generate three feature similarity coefficient (SIMILARITY MAPS) matrixes S 1、S2、S3 and index map (index map) H of feature positions;
A34, synthesizing and outputting a multi-scale similarity matrix and characteristics: three similarity coefficient matrixes are generated in a weighted output mode, characteristics of a high-resolution reference bar code are extracted by utilizing a pre-trained VGG model, and synthesized texture characteristics are generated through index mapping of characteristic positions;
A35, feature reconstruction network: adopting an inter-scale cascade fusion reconstruction architecture, carrying out feature modulation fusion by utilizing a similarity matrix of a third scale and low-resolution features, sending the feature to a residual attention module for first reconstruction, then carrying out 2 times of upsampling on the features, fusing the feature with a similarity matrix of a second scale, sending the feature to the residual attention module for second reconstruction, and the like to finish super-resolution reconstruction of fixed multiplying power;
A36, feature fusion: cross-fusing the features after double up-sampling reconstruction and the features after quadruple up-sampling reconstruction to generate a final reconstructed bar code image;
A37, designing a loss function module: the whole super-resolution network adopts an end-to-end optimization mode, the loss function is designed into a composite loss function based on frequency domain loss constraint, namely, the network is subjected to joint optimization by adopting a scheme of weighting a perception domain loss function, a gradient domain loss function and a frequency domain loss function.
Preferably, in step a32, the degradation process of the reference map is modeled, and the degraded image I Ref↓ is shown in the following formula:
Wherein ω and n represent blur kernel and random noise, respectively, and learning a degradation function phi of the image through a learning network; the network optimizes the degraded image I Ref↓ by generating a contrast loss function that is more similar to the real low resolution image.
Preferably, the step a33 specifically includes the following steps:
a331, respectively convoluting convolution check images with only horizontal direction change and vertical direction change, and extracting gradient domain images, wherein the specific process is as follows:
Q=Grad(ILR)
K=Grad(IRef↓)
Wherein Q and K represent gradient domain images extracted from I LR and I Ref↓, respectively;
A332, unrolling Q and K into A3 x3 sized tile sequence; wherein for each tile Q i in Q and each tile K j in K, the similarity between the two tiles is calculated by normalizing the inner product, namely:
Si,j=<ψ(qi),ψ(kj)>
Wherein, ψ (·) represents the normalization operation, < · > represents the inner product operation;
A333, according to the result of the inner product calculation, obtaining the maximum similarity for each block q i record After matching all the tiles in Q, constructing an index map H of a feature position, recording the corresponding tile index between I LR and I Ref↓, and otherwise recording the similarity coefficient between the images to generate a similarity matrix S 1、S2、S3 of the first three of the correlation arrangements.
Preferably, in step a32, the degradation process of the reference map may be modeled, and the degraded image I Ref↓ is shown in the following formula:
Wherein ω and n represent blur kernel and random noise, respectively, and learning a degradation function phi of the image through a learning network; the network optimizes the degraded image I Ref↓ by generating a contrast loss function that is more similar to the real low resolution image.
Preferably, the step a34 specifically includes the following steps:
A341, outputting a final similarity matrix in a weighted form by using the similarity matrix S 1、S2、S3, wherein the final similarity matrix is specifically as follows:
S=α1S12S23S3
wherein, alpha 1、α2、α3 is determined by experiments to be 0.8, 0.7 and 0.4 respectively;
a342, extracting a characteristic diagram of a high-resolution reference bar code image by using a pretrained VGG model, setting the characteristic diagram as V, and specifically representing the characteristic diagram as follows:
V=Vgg(IRef)
wherein I Ref represents a high resolution reference barcode image;
a343, expanding the extracted high-resolution feature V into a block, performing migration synthesis on the high-resolution feature according to index map (index map) H of the feature position, generating three-scale synthesized features according to 2 times and 4 times of resolution, and marking as
Preferably, the step a35 specifically includes the following steps:
A351, firstly extracting shallow layer characteristics F LR from low-resolution input bar codes, and then utilizing low-scale characteristics Reconstruction with soft weighting strategy of F LR:
wherein concat and Conv represent convolution operation and channel splicing operation, respectively, and as such, as well represents pixel-level dot multiplication;
A352, after finishing the low-scale feature fusion, will Sending the obtained characteristics into a residual error attention module for reconstruction, performing double up-sampling on the reconstructed characteristics, and then inputting the reconstructed characteristics and the second-level scale characteristics into a soft weighting module for fusion; and the like, generating a corresponding 2-time or 4-time superscore result.
Preferably, in the step a37, the method specifically includes the following steps:
In addition to the usual pixel domain loss function L 1, a perceptual domain loss function is employed To enhance the texture accuracy of the reconstructed two-dimensional bar code, the perceptual domain loss function/>The specific steps of (a) are as follows:
Wherein, A feature map representing an i-th layer extracted by the VGG network; and (C i,Hi,Wi) represents the shape of the intermediate feature map;
the gradient domain loss function The expression is as follows:
Wherein, Gradient change diagrams in the horizontal direction and the vertical direction of the SR bar code and the HR bar code are respectively represented;
The frequency domain based loss function The method comprises the following steps:
Where F (-) represents the frequency domain transform of the image.
Compared with the prior art, the invention provides a two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance, which has the following beneficial effects:
(1) The invention provides a two-dimensional bar code super-resolution method based on block matching and multi-scale feature fusion; firstly, a proposed reference picture selection mechanism is utilized to select a matched reference picture bar code, and then a degradation network based on GAN is adopted to carry out resolution degradation on a high-resolution reference bar code so as to improve the matching precision of the high-resolution reference bar code and a low-resolution bar code; generating a multi-scale similarity coefficient (SIMILARITY MAPS) matrix S and index map (index map) H of the characteristic position by adopting a block matching-based method; and finally, inputting the input image, the multi-scale similarity matrix and the extracted high-resolution guide features into a reconstruction network to finish fusion reconstruction of the features.
(2) The invention provides a loss function based on frequency domain constraint, which can effectively avoid the problem due to the fact that the real super-resolution data pair has misalignment, and improves the accuracy of the bar code image after reconstruction.
(3) Compared with natural images, the two-dimensional bar code has the characteristics of fixed structural paradigm, complex and rich texture information, single color information and the like. Meanwhile, compared with a super-resolution algorithm oriented to a simulation image, the method is oriented to practical application, and degradation types are more complex. Therefore, by designing the deep learning network and adopting a high-resolution reference bar code guiding mode, super-resolution reconstruction is carried out on the deep learning network, so that information transmission of industrial production and logistics transportation is accurately realized.
(4) Experiments based on the invention show that the proposed method is superior to the currently mainstream image super-resolution method; through research and exploration of the invention, the utilization of different kinds of image structure information and the exploration of different network constraint functions can be inspired.
Drawings
FIG. 1 is a diagram of an image feature matching structure of a two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance;
FIG. 2 is a feature fusion reconstruction structure proposed in embodiment 1 of the present invention;
FIG. 3 is a block diagram of a feature cross fusion module according to embodiment 1 of the present invention;
FIG. 4 is a block diagram of a soft weighting module according to embodiment 1 of the present invention;
FIG. 5 is a diagram of a residual attention module according to embodiment 1 of the present invention;
FIG. 6 is a flow chart of the two-dimensional bar code super-resolution method guided by the frequency domain constraint and the reference diagram.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments.
Example 1
Referring to fig. 1-6, a two-dimensional barcode super-resolution method based on frequency domain constraint and reference map guidance includes the following steps:
s1, establishing a two-dimensional bar code image super-data set under a real degradation condition;
Specifically, the method comprises the following steps:
A11, printing the two-dimensional bar codes on A4 paper according to fixed arrangement, keeping the position of a camera fixed, and shooting to generate a high-resolution bar code image I HR and a low-resolution bar code image I LR by adjusting the size of a printing code word;
A12, preprocessing the generated image data, detecting the outline of the code word through an edge detection algorithm, cutting out the image data containing a single two-dimensional bar code, and further obtaining a two-dimensional bar code super-resolution data set under a real degradation condition;
S2, constructing a network frame: designing a feature matching module based on a gradient domain and a multi-scale feature reconstruction backbone network, extracting features in a high-resolution reference picture by using the feature matching module, and fusing the features with low-resolution features in the reconstruction backbone network to synthesize high-resolution features;
s3, designing a two-dimensional barcode super-resolution scheme, and constructing a reference image guided two-dimensional barcode super-resolution model according to the designed scheme:
Based on the specific structural characteristics and priori information of the two-dimensional bar code, a low-resolution two-dimensional bar code superdistribution scheme is designed by combining the real degenerate two-dimensional bar code superdistribution data set and the network frame in S1-S2, and a two-dimensional bar code superdistribution network guided by a reference picture is built according to the designed two-dimensional bar code superdistribution scheme, and the method specifically comprises the following steps:
A31, selecting a reference diagram: according to the type of the two-dimensional bar code data obtained in the step S1, a reference graph set (REFERENCE POOL) covering all two-dimensional bar code size versions and rotation angles is established; when a low-resolution image is input, detecting the edge contour size and the rotation angle of the bar code by adopting a Canny edge detection algorithm, and selecting a corresponding reference image from a reference image set based on the edge contour size and the rotation angle;
A32, degradation will be referred to: a degradation model is pre-trained by adopting a GAN-based network aiming at the degradation process of the low-resolution image and the high-resolution image, and then the degradation model is applied to the high-resolution reference image bar code to degrade the high-resolution reference image bar code to a uniform scale with the input low-resolution bar code;
Specifically, in the step a32, the degradation process of the reference map may be modeled, and the degraded image I Ref↓ is shown as follows:
Wherein ω and n represent blur kernel and random noise, respectively, and learning a degradation function phi of the image through a learning network; the network optimizes the degraded image I Ref↓ by generating a contrast loss function that is more similar to the real low resolution image.
A33, performing gradient domain-based feature matching: respectively extracting gradient domain images from the degraded reference image and the low-resolution bar code, estimating the similarity between the gradient domain images and the low-resolution bar code, and taking the feature image with three high similarity to generate three feature similarity coefficient (SIMILARITY MAPS) matrixes S 1、S2、S3 and index map (index map) H of feature positions;
Specifically, the method comprises the following steps:
a331, respectively convoluting convolution check images with only horizontal direction change and vertical direction change, and extracting gradient domain images, wherein the specific process is as follows:
Q=Grad(ILR)
K=Grad(IRef↓)
Wherein Q and K represent gradient domain images extracted from I LR and I Ref↓, respectively;
A332, unrolling Q and K into A3 x3 sized tile sequence; wherein for each tile Q i in Q and each tile K j in K, the similarity between the two tiles is calculated by normalizing the inner product, namely:
Si,j=<ψ(qi),ψ(kj)>
Wherein, ψ (·) represents the normalization operation, < · > represents the inner product operation;
A333, according to the result of the inner product calculation, obtaining the maximum similarity for each block q i record After matching all the tiles in Q, constructing an index map H of a feature position, recording the corresponding tile index between I LR and I Ref↓, and otherwise recording the similarity coefficient between the images to generate a similarity matrix S 1、S2、S3 of the first three of the correlation arrangements.
A34, synthesizing and outputting a multi-scale similarity matrix and characteristics: three similarity coefficient matrixes are generated in a weighted output mode, characteristics of a high-resolution reference bar code are extracted by utilizing a pre-trained VGG model, and synthesized texture characteristics are generated through index mapping of characteristic positions;
Specifically, the method comprises the following steps:
A341, outputting a final similarity matrix in a weighted form by using the similarity matrix S 1、S2、S3, wherein the final similarity matrix is specifically as follows:
S=α1S12S23S3
wherein, alpha 1、α2、α3 is determined by experiments to be 0.8, 0.7 and 0.4 respectively;
a342, extracting a characteristic diagram of a high-resolution reference bar code image by using a pretrained VGG model, setting the characteristic diagram as V, and specifically representing the characteristic diagram as follows:
V=Vgg(IRef)
wherein I Ref represents a high resolution reference barcode image;
a343, expanding the extracted high-resolution feature V into a block, performing migration synthesis on the high-resolution feature according to index map (index map) H of the feature position, generating three-scale synthesized features according to 2 times and 4 times of resolution, and marking as
A35, feature reconstruction network: adopting an inter-scale cascade fusion reconstruction architecture, carrying out feature modulation fusion by utilizing a similarity matrix of a third scale and low-resolution features, sending the feature to a residual attention module for first reconstruction, then carrying out 2 times of upsampling on the features, fusing the feature with a similarity matrix of a second scale, sending the feature to the residual attention module for second reconstruction, and the like to finish super-resolution reconstruction of fixed multiplying power;
Specifically, the method comprises the following steps:
A351, firstly extracting shallow layer characteristics F LR from low-resolution input bar codes, and then utilizing low-scale characteristics Reconstruction with soft weighting strategy of F LR:
wherein concat and Conv represent convolution operation and channel splicing operation, respectively, and as such, as well represents pixel-level dot multiplication;
A352, after finishing the low-scale feature fusion, will Sending the obtained characteristics into a residual error attention module for reconstruction, performing double up-sampling on the reconstructed characteristics, and then inputting the reconstructed characteristics and the second-level scale characteristics into a soft weighting module for fusion; and the like, generating a corresponding 2-time or 4-time superscore result.
A36, feature fusion: cross-fusing the features after double up-sampling reconstruction and the features after quadruple up-sampling reconstruction to generate a final reconstructed bar code image;
a37, designing a loss function module: the whole super-resolution network adopts an end-to-end optimization mode, a loss function is designed into a composite loss function based on frequency domain loss constraint, namely, a scheme of weighting a perception domain loss function, a gradient domain loss function and a frequency domain loss function is adopted to perform joint optimization on the network;
In step a37, the method specifically includes the following steps:
In addition to the usual pixel domain loss function L 1, a perceptual domain loss function is employed To enhance the texture accuracy of the reconstructed two-dimensional bar code, the perceptual domain loss function/>The specific steps of (a) are as follows:
Wherein, A feature map representing an i-th layer extracted by the VGG network; and (C i,Hi,Wi) represents the shape of the intermediate feature map;
the gradient domain loss function The expression is as follows:
Wherein, Gradient change diagrams in the horizontal direction and the vertical direction of the SR bar code and the HR bar code are respectively represented;
The frequency domain based loss function The method comprises the following steps:
Where F (-) represents the frequency domain transform of the image.
S4, training a model by using a deep learning Pytorch framework: traversing the super-resolution data set of the two-dimensional bar code constructed in the step S1 until the network loss function converges, then reducing the learning rate to 0.00001, and then continuing traversing the super-resolution data set for a plurality of times to obtain a final stable model;
S5, outputting a result: inputting the data set in the super-data set of the two-dimensional bar code under the real degradation condition obtained in the step S1 into the stable model to obtain a super-resolution reconstruction result of the two-dimensional bar code;
The invention uses the image feature matching network for the method; the image feature matching network aims at extracting high-resolution texture features matched with the input bar code from the high-resolution reference image bar code, so that the high-resolution texture features play a role in assisting superdivision in a subsequent reconstruction network. Specific structural information is shown in fig. 1, in order to select a bar code matched with the rotation angle and version number of the input low-resolution bar code, the size and rotation angle of the bar code are calculated by adopting a Canny edge detection algorithm, and the bar code is selected from a reference image set. Because the resolution of the reference picture bar code is higher, a larger information domain gap exists between the reference picture bar code and the input bar code, a degradation network based on GAN training is adopted to degrade the reference picture bar code to the condition of the same resolution of the input bar code, and therefore the feature matching precision is improved.
Different from natural images, the texture details of the two-dimensional bar code are more abundant, but the texture details are mostly vertical or horizontal, and the traditional method is mainly based on the feature domain to extract the image information, but the method is not applicable to the two-dimensional bar code, so that a gradient domain-based matching method is adopted, the matching precision is improved, and meanwhile, the calculated amount is greatly reduced. In the similarity calculation stage, a block matching (PATCH MATCHING) based method is adopted, the size of an image block is set to be 4×4, and finally a multi-scale similarity coefficient matrix and index map (index map) H of the characteristic position are generated. And finally, extracting a feature map V of the high-resolution reference map by adopting a VGG network, expanding the extracted high-resolution feature V into a block, and performing migration synthesis on the high-resolution feature according to index map (index map) H of the feature position. The synthesized features of three scales are generated according to 2 times and 4 times of resolution, and are recorded as
The invention uses the characteristic fusion reconstruction network aiming at the method;
The feature fusion reconstruction network is responsible for completing the super-division reconstruction task of the low-resolution two-dimensional bar code, and the input of the feature fusion reconstruction network is a low-resolution input bar code I LR, a corresponding similarity matrix and multi-scale synthesis features The output is the reconstructed high resolution two-dimensional barcode I SR. The structure of the feature fusion reconstruction network is shown in fig. 2, and is a three-layer cascade progressive reconstruction network. Shallow features F LR are extracted from the input low-resolution bar code, and then the shallow features F LR and the low-scale synthesized features are synthesizedAnd (3) sending the characteristic images into a soft weighting module, wherein the structure of the characteristic images is shown in fig. 4, modulating the synthesized characteristic images according to a similarity coefficient matrix, and finally returning shallow characteristics F LR by adopting a residual structure to complete low-scale characteristic fusion, wherein the specific process is as follows:
Wherein concat and Conv represent a convolution operation and a channel splicing operation, respectively, and as such, it represents pixel-level dot multiplication. After feature fusion is completed Input into the residual attention module for first deep feature extraction, then up-sample it by 2 times and match/>A soft weighting module of the second layer scale is input. And the like, completing super-resolution reconstruction.
The residual attention module structure is shown in fig. 5, and the channel attention and the space attention are adopted to modulate the intermediate features in the channel dimension and the space dimension respectively so as to enhance the characterization capability of the features, and finally the features of the previous module are transmitted into the features of the previous module by short connection.
Aiming at the method, the invention uses image constraint based on a gradient domain and a frequency domain;
Compared with natural images, the two-dimensional bar code texture information is more abundant, the gradient information is mostly changed in the horizontal direction and the vertical direction, the gradient information change intensity is fixed, and the gradient information change intensity is black and white alternating, so that a better reconstruction effect can be realized by adopting a constraint mode based on a gradient domain. The specific method is that convolution check images in the horizontal and vertical directions of 3 multiplied by 3 are adopted to carry out convolution, gradient images are extracted, and a loss function of a norm is applied to the gradient images:
Wherein, Representing the gradient change patterns of the SR bar code and the HR bar code in the horizontal direction and the vertical direction respectively.
According to the method, a super-resolution data set shot under a real degradation condition is adopted, due to the influence of precision of shooting equipment and environment, complete alignment of data pairs cannot be achieved, and for displacement deviation of pixel domain levels, the problem of edge blurring can be caused by simply using a reconstruction loss function for constraint, and based on the problem, the loss function based on frequency domain constraint is adopted, so that constraint on high-frequency part information of a bar code image is achieved, and definition of texture details after reconstruction is improved. The loss function is as follows:
Where F (-) represents the frequency domain transform of the image.
Based on the two types of constraint conditions, the loss function commonly used by the super-resolution method is combined, and the final composite constraint function is 5 types, namelyLoss function, loss function/>, based on perceptual domainGAN-based loss function lambda adv, and the gradient domain and frequency domain-based loss functions described above. In general, the loss function of a superdivision network is:
where lambda 1advpergradfrequency is the weight of each loss function.
Example 2:
based on example 1 but with the difference that:
The invention selects 7 super-resolution models based on natural image training, and trains on the manufactured two-dimensional bar code super-resolution data set, and the method specifically comprises a classical single-frame image super-resolution algorithm: EDSR, RDN, RCAN, SRGAN. And a reference map-guided super-resolution algorithm: crossNet, TTSR, MASA, C 2 -mapping, DATSR. In the methods, three types of single-frame image super-division algorithms represent a classical super-division network architecture, crossNet represents an alignment-based reference image super-division algorithm, TTSR algorithm, and a block-based dense matching method is adopted in a characteristic domain of an image, so that the calculation amount is large. MASA, C 2 -matching adopts a coarse-to-fine matching strategy to reduce the calculation amount in the matching process. DATSR, based on a transducer, in combination with a deformation convolution, proposes a deformation attention mechanism (deformable attention transformer) to reduce the deformation gap and resolution gap of the reference image and the low resolution image.
For fairness of experimental comparison, retraining the models in a two-dimensional barcode super-resolution dataset under a real degradation condition by using the same experimental setting, adopting the same reference diagram selection mechanism proposed by the method for algorithms based on reference diagram guidance, and training two versions of each algorithm, namely a scheme with only pixel domain loss function constraint and a composite loss function scheme based on frequency domain constraint. In the aspect of evaluation indexes, different from the field of natural images, the recognition rate after two-dimensional bar code reconstruction is used as an important index besides PSNR and SSIM general indexes so as to verify the final reconstruction effect. See table 1 for specific results.
Table 1 quantitative results versus table.
As shown in Table 1, quantitative comparison results on PSNR, SSIM and recognition rate indexes are shown, wherein the three indexes are all that the larger the index value is, the better the optimal result is marked by thickening, and the suboptimal result is marked by underline. As can be seen from the table, the method of the chapter achieves superiority in all indexes. The SRGAN algorithm has high recognition rate, but has lower PSNR value. The main reason is that the result of SRGAN has a significant positional shift compared to the truth bar code image I HR. Of all RefSR methods, our method also achieved the best results. C2-matching adopts a matching strategy of coarse-to-fine to reduce the calculation cost. However, this strategy results in worse results in terms of matching of two-dimensional barcodes. For super-resolution reconstruction in the natural image domain, the perceptual domain loss and GAN loss will give the result a better visual quality, but will reduce the PSNR and SSIM values. However, for the super-division of the two-dimensional bar code, such as TTSR, C2-matching and DATSR, the reconstruction loss is only used, so that the performance is poor, because the size and resolution of the two-dimensional bar code have larger gap compared with the natural image, the texture is clearer due to the smaller size, and the phenomenon of wrong texture can not appear like the natural image field when the GAN loss function is used. Thus, the perceived and GAN loss with less weight can improve the reconstruction accuracy of the reconstructed two-dimensional bar code. For MASA, because the matching strategy of coarse-to-fine is also adopted, the matching precision is reduced, the weight of GAN loss is larger, the weight of a pixel domain loss function is smaller, and the pixel domain loss function can be combined into an error texture. Thus, MASA-rec results in better performance.
The foregoing is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art, who is within the scope of the present invention, should make equivalent substitutions or modifications according to the technical scheme of the present invention and the inventive concept thereof, and should be covered by the scope of the present invention.

Claims (8)

1. The two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance is characterized by comprising the following steps of:
S1, establishing a two-dimensional bar code super-resolution data set under a real degradation condition;
S2, constructing a network frame: designing a feature matching module based on a gradient domain, reconstructing a main network by using a multi-scale feature, extracting features in a high-resolution reference picture by using the feature matching module, and fusing the features with low-resolution features in the main network to synthesize high-resolution features;
s3, designing a two-dimensional barcode super-resolution scheme, and constructing a reference image guided two-dimensional barcode super-resolution model according to the designed scheme: based on specific structural features and priori information of the two-dimensional bar code, a low-resolution two-dimensional bar code superresolution scheme is designed by combining a two-dimensional bar code superresolution data set under the real degradation condition in the S1 and a network frame in the S2, and a two-dimensional bar code superresolution network guided by a reference picture is built according to the designed two-dimensional bar code superresolution scheme;
The method specifically comprises the following steps:
A31, selecting a reference diagram: establishing a reference graph set covering all two-dimensional bar code size versions and rotation angles according to the types of the two-dimensional bar code data obtained in the step S1; when a low-resolution image is input, detecting the edge contour size and the rotation angle of the bar code by adopting a Canny edge detection algorithm, and selecting a corresponding reference image from a reference image set based on the edge contour size and the rotation angle;
A32, degradation will be referred to: a degradation model is pre-trained by adopting a degradation network based on GAN constraint aiming at the degradation process of the low-resolution image and the high-resolution image, and then the degradation model is applied to the high-resolution reference image bar code to degrade the high-resolution reference image bar code to a uniform scale with the input low-resolution bar code;
A33, performing gradient domain-based feature matching: respectively extracting gradient domain images from the degraded reference image and the low-resolution bar code, estimating the similarity between the gradient domain images and the low-resolution bar code, and taking a characteristic image with three high similarity to generate three characteristic similarity coefficient matrixes S 1、S2、S3 and index mapping H of characteristic positions;
A34, synthesizing and outputting a multi-scale similarity matrix and characteristics: three similarity coefficient matrixes are generated in a weighted output mode, characteristics of a high-resolution reference bar code are extracted by utilizing a pre-trained VGG model, and synthesized texture characteristics are generated through index mapping of characteristic positions;
a35, feature reconstruction network: adopting an inter-scale cascade fusion reconstruction architecture, carrying out feature modulation fusion by utilizing a similarity matrix of a third scale and low-resolution features, sending the feature to a residual attention module for first reconstruction, then carrying out double sampling on the features, fusing the feature with a similarity matrix of a second scale, sending the feature to the residual attention module for second reconstruction, and the like to finish super-resolution reconstruction of fixed multiplying power;
A36, feature fusion: cross-fusing the features after double up-sampling reconstruction and the features after quadruple up-sampling reconstruction to generate a final reconstructed bar code image;
a37, designing a loss function module: the whole super-resolution network adopts an end-to-end optimization mode, a loss function is designed into a composite loss function based on frequency domain loss constraint, namely, a scheme of weighting a perception domain loss function, a gradient domain loss function and a frequency domain loss function is adopted to perform joint optimization on the network;
S4, training a model: training a model by using a deep learning Pytorch framework, traversing the two-dimensional bar code super-resolution dataset constructed in the S1 until a network loss function converges, then reducing the learning rate to 0.00001, and then continuously traversing the two-dimensional bar code super-resolution dataset for a plurality of times to obtain a final stable model;
s5, outputting a result: and (3) inputting the two-dimensional bar code super-resolution data set under the real degradation condition obtained in the step (S1) into the stable model to obtain a super-resolution reconstruction result of the two-dimensional bar code.
2. The method for two-dimensional barcode super-resolution based on frequency domain constraint and reference map guidance according to claim 1, wherein in step S1, the method for establishing the two-dimensional barcode super-resolution data set under real degradation condition comprises the following specific steps:
A11, printing the two-dimensional bar codes on A4 paper according to fixed arrangement, keeping the position of a camera fixed, and shooting to generate a high-resolution bar code image I HR and a low-resolution bar code image I LR by adjusting the size of a printing code word;
And A12, preprocessing the generated image data, detecting the outline of the code word through an edge detection algorithm, cutting out the image data containing a single two-dimensional bar code, and further obtaining a two-dimensional bar code super-resolution data set under a real degradation condition.
3. The two-dimensional bar code super-resolution method based on frequency domain constraint and reference map guidance according to claim 1, wherein in step S2, in order to reduce the resolution interval between the reference map bar code and the low-resolution bar code, a degradation network based on GAN constraint is adopted to degrade the reference map bar code into the low-resolution bar code, and finally, a complex function constraint optimization mode is adopted for the whole network to train.
4. The two-dimensional barcode super-resolution method based on frequency domain constraint and reference map guidance according to claim 1, wherein in step a32, the degradation process of the reference map is modeled, and the degraded image I Ref↓ is represented by the following formula:
Wherein I Ref represents a high resolution reference barcode image; omega and n represent fuzzy kernel and random noise, respectively, and the degradation function phi of the image is learned through a learning network; the network optimizes the degraded image I Ref↓ by generating a contrast loss function that is more similar to the real low resolution image.
5. The two-dimensional barcode super-resolution method based on frequency domain constraint and reference map guidance according to claim 1, wherein the step a33 specifically comprises the following steps:
a331, respectively convoluting convolution check images with only horizontal direction change and vertical direction change, and extracting gradient domain images, wherein the specific process is as follows:
Q=Grad(ILR)
K=Grad(IRef↓)
Wherein Q and K represent gradient domain images extracted from I LR and I Ref↓, respectively;
A332, unrolling Q and K into A3 x3 sized tile sequence; wherein for each tile Q i in Q and each tile K j in K, the similarity between the two tiles is calculated by normalizing the inner product, namely:
si,j=<ψ(qi),ψ(kj)>
Wherein ψ (·) represents the normalization operation;
A333, according to the result of the inner product calculation, obtaining the maximum similarity for each block q i record After matching all the tiles in Q, constructing an index map H of a feature position, recording the corresponding tile index between I LR and I Ref↓, and otherwise recording the similarity coefficient between the images to generate a similarity matrix S 1、S2、S3 of the first three of the correlation arrangements.
6. The two-dimensional barcode super-resolution method based on frequency domain constraint and reference map guidance according to claim 1, wherein the step a34 specifically comprises the following steps:
A341, outputting a final similarity matrix in a weighted form by using the similarity matrix S 1、S2、S3, wherein the final similarity matrix is specifically as follows:
S=α1S12S23S3
wherein, alpha 1、α2、α3 is determined by experiments to be 0.8, 0.7 and 0.4 respectively;
a342, extracting a characteristic diagram of a high-resolution reference bar code image by using a pretrained VGG model, setting the characteristic diagram as V, and specifically representing the characteristic diagram as follows:
V=Vgg(IRef)
Wherein I Ref represents a high resolution reference barcode image;
A343, expanding the extracted high-resolution feature V into a block, performing migration synthesis on the high-resolution feature according to the index mapping H of the feature position, generating three-scale synthesized features according to the double and the quadruple of the resolution, and marking as
7. The two-dimensional barcode super-resolution method based on frequency domain constraint and reference map guidance according to claim 1, wherein the step a35 specifically comprises the following steps:
A351, firstly extracting shallow layer characteristics F LR from low-resolution input bar codes, and then utilizing low-scale characteristics Reconstruction with F LR via soft weighting strategy:
wherein concat and Conv represent convolution operation and channel splicing operation, respectively, and as such, as well represents pixel-level dot multiplication;
A352, after finishing the low-scale feature fusion, will Sending the obtained characteristics into a residual error attention module for reconstruction, performing double up-sampling on the reconstructed characteristics, and then inputting the reconstructed characteristics and the second-level scale characteristics into a soft weighting module for fusion; and so on, generating corresponding double or quadruple superdivision results.
8. The two-dimensional barcode super-resolution method based on frequency domain constraint and reference map guidance according to claim 1, wherein in the step a37, the method specifically comprises the following steps:
In addition to the usual pixel domain loss function L 1, a perceptual domain loss function is employed To enhance the texture accuracy of the reconstructed two-dimensional bar code, the perceptual domain loss function/>Is represented as follows:
Wherein, A feature map representing an i-th layer extracted by the VGG network; and (C i,Hi,Wi) represents the shape of the intermediate feature map; i SR represents a reconstructed high-resolution two-dimensional bar code;
the gradient domain loss function Is represented as follows:
Wherein, Gradient change diagrams in the horizontal direction and the vertical direction of the SR bar code and the HR bar code are respectively represented;
The frequency domain loss function Is represented as follows:
Where F (-) represents the frequency domain transform of the image.
CN202311248275.2A 2023-09-26 2023-09-26 Two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance Active CN117151984B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311248275.2A CN117151984B (en) 2023-09-26 2023-09-26 Two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311248275.2A CN117151984B (en) 2023-09-26 2023-09-26 Two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance

Publications (2)

Publication Number Publication Date
CN117151984A CN117151984A (en) 2023-12-01
CN117151984B true CN117151984B (en) 2024-06-04

Family

ID=88902637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311248275.2A Active CN117151984B (en) 2023-09-26 2023-09-26 Two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance

Country Status (1)

Country Link
CN (1) CN117151984B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111915484A (en) * 2020-07-06 2020-11-10 天津大学 Reference image guiding super-resolution method based on dense matching and self-adaptive fusion
CN112069853A (en) * 2020-09-16 2020-12-11 福州大学 Two-dimensional bar code image super-resolution method based on deep learning
CN114266702A (en) * 2022-03-01 2022-04-01 清华大学 High-speed super-resolution imaging method and device based on compressed sensing and depth optics
CN114972036A (en) * 2022-06-10 2022-08-30 上海交通大学 Blind image super-resolution reconstruction method and system based on fusion degradation prior
CN116049469A (en) * 2022-07-08 2023-05-02 闽江学院 Multi-matching search and super-resolution reconstruction method based on reference diagram
CN116563101A (en) * 2023-04-04 2023-08-08 武汉大学 Unmanned aerial vehicle image blind super-resolution reconstruction method based on frequency domain residual error

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9064476B2 (en) * 2008-10-04 2015-06-23 Microsoft Technology Licensing, Llc Image super-resolution using gradient profile prior

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111915484A (en) * 2020-07-06 2020-11-10 天津大学 Reference image guiding super-resolution method based on dense matching and self-adaptive fusion
CN112069853A (en) * 2020-09-16 2020-12-11 福州大学 Two-dimensional bar code image super-resolution method based on deep learning
CN114266702A (en) * 2022-03-01 2022-04-01 清华大学 High-speed super-resolution imaging method and device based on compressed sensing and depth optics
CN114972036A (en) * 2022-06-10 2022-08-30 上海交通大学 Blind image super-resolution reconstruction method and system based on fusion degradation prior
CN116049469A (en) * 2022-07-08 2023-05-02 闽江学院 Multi-matching search and super-resolution reconstruction method based on reference diagram
CN116563101A (en) * 2023-04-04 2023-08-08 武汉大学 Unmanned aerial vehicle image blind super-resolution reconstruction method based on frequency domain residual error

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Deep edge map guided depth super resolution;Jiang Zhongyu等;《Signal Processing-Image Communication》;20210105;全文 *
基于位置约束的参考图引导的遥感影像超分辨率网络;杨敬钰等;《天津大学学报(自然科学与工程技术版)》;20230430;第56卷(第4期);全文 *
边缘修正的多尺度卷积神经网络重建算法;程德强;蔡迎春;陈亮亮;宋玉龙;;激光与光电子学进展;20180328(第09期);全文 *

Also Published As

Publication number Publication date
CN117151984A (en) 2023-12-01

Similar Documents

Publication Publication Date Title
CN113591546B (en) Semantic enhancement type scene text recognition method and device
Wang et al. Learning super-resolution jointly from external and internal examples
CN110706302A (en) System and method for text synthesis image
CN111127374B (en) Pan-sharing method based on multi-scale dense network
WO2021022929A1 (en) Single-frame image super-resolution reconstruction method
CN109214989B (en) Single image super resolution ratio reconstruction method based on Orientation Features prediction priori
Chen et al. MICU: Image super-resolution via multi-level information compensation and U-net
JP2019067403A (en) Learning method and learning device for image segmentation, and image segmentation method and image segmentation device using the same
CN110136060B (en) Image super-resolution reconstruction method based on shallow dense connection network
CN113256494B (en) Text image super-resolution method
CN114170088A (en) Relational reinforcement learning system and method based on graph structure data
Li et al. RGB-induced feature modulation network for hyperspectral image super-resolution
Aakerberg et al. Semantic segmentation guided real-world super-resolution
CN114972746A (en) Medical image segmentation method based on multi-resolution overlapping attention mechanism
CN115565056A (en) Underwater image enhancement method and system based on condition generation countermeasure network
CN114663777B (en) Hyperspectral image change detection method based on space-time joint graph attention mechanism
CN117893545A (en) Skin lesion image segmentation method, system, equipment and storage medium
CN118037551A (en) Mine image super-resolution reconstruction method based on double-flow self-attention aggregation
CN115936983A (en) Method and device for super-resolution of nuclear magnetic image based on style migration and computer storage medium
CN116934592A (en) Image stitching method, system, equipment and medium based on deep learning
CN117291803B (en) PAMGAN lightweight facial super-resolution reconstruction method
CN117151984B (en) Two-dimensional bar code super-resolution method based on frequency domain constraint and reference image guidance
CN116740069B (en) Surface defect detection method based on multi-scale significant information and bidirectional feature fusion
CN116523985B (en) Structure and texture feature guided double-encoder image restoration method
Sun et al. Learning discrete representations from reference images for large scale factor image super-resolution

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant