CN111597846A - Fold two-dimensional code recovery method, device and equipment and readable storage medium - Google Patents

Fold two-dimensional code recovery method, device and equipment and readable storage medium Download PDF

Info

Publication number
CN111597846A
CN111597846A CN201910135066.4A CN201910135066A CN111597846A CN 111597846 A CN111597846 A CN 111597846A CN 201910135066 A CN201910135066 A CN 201910135066A CN 111597846 A CN111597846 A CN 111597846A
Authority
CN
China
Prior art keywords
dimensional code
code picture
wrinkle
target
picture
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.)
Pending
Application number
CN201910135066.4A
Other languages
Chinese (zh)
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.)
ZHONGKE WEIZHI INTELLIGENT MANUFACTURING TECHNOLOGY JIANGSU Co.,Ltd.
Original Assignee
Kunshan Branch Institute of Microelectronics of CAS
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 Kunshan Branch Institute of Microelectronics of CAS filed Critical Kunshan Branch Institute of Microelectronics of CAS
Priority to CN201910135066.4A priority Critical patent/CN111597846A/en
Publication of CN111597846A publication Critical patent/CN111597846A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • G06K7/1491Methods for optical code recognition the method including quality enhancement steps the method including a reconstruction step, e.g. stitching two pieces of bar code together to derive the full bar code
    • 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/045Combinations of networks
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/192Recognition using electronic means using simultaneous comparisons or correlations of the image signals with a plurality of references
    • G06V30/194References adjustable by an adaptive method, e.g. learning

Landscapes

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

Abstract

The invention discloses a wrinkle two-dimensional code recovery method, which can be used for effectively recovering wrinkles of two-dimensional code pictures with different wrinkle conditions by only wrinkling recognizable original two-dimensional code pictures without exhausting effective recovery algorithms respectively corresponding to each wrinkle condition, and training a deep learning network by using the wrinkle two-dimensional code pictures and the original two-dimensional code pictures, and finally realizing effective wrinkle recovery processing on the two-dimensional code pictures with different wrinkle conditions by using a target deep learning network obtained after training. The invention also discloses a fold two-dimensional code recovery device, equipment and a readable storage medium, and the fold two-dimensional code recovery device has corresponding technical effects.

Description

Fold two-dimensional code recovery method, device and equipment and readable storage medium
Technical Field
The invention relates to the technical field of computer vision, in particular to a fold two-dimensional code recovery method, a fold two-dimensional code recovery device, fold two-dimensional code recovery equipment and a readable storage medium.
Background
With the rapid development of information technology, people are increasingly pressing on the rapid input and rapid processing of information. The two-dimensional code technology plays an indispensable role in the fast input and fast processing of information. However, as the application of the two-dimensional code becomes wider, the two-dimensional code used in the two-dimensional code image is distorted in wrinkles to different degrees due to the photographing angle, the wrinkles, the bending of the two-dimensional code image itself, or the attached matter.
At present, aiming at the problem of distortion of two-dimensional codes, most of the two-dimensional codes are researched for distortion correction algorithms, including methods such as space transformation and gray interpolation, and wrinkle recovery processing including image vertex positioning, perspective transformation and gray interpolation. Most of these algorithms require human search for recovery algorithms in different wrinkle cases. For example, in a case where a pair of sides of a two-dimensional code pattern is not distorted and the other pair of sides is distorted, a first corrected image is obtained by eliminating the influence of linear distortion caused by a photographing angle or the like, and then a second corrected image is obtained by performing wrinkle distortion correction on the first corrected image by a shortest curve interpolation method, and then two-dimensional QR code decoding recognition is performed on the basis of the first corrected image. Therefore, the existing recovery processing of the fold two-dimensional code can only be performed under the condition of specifying a fold, and the two-dimensional code under different fold conditions in a real application scene cannot be effectively recovered.
In summary, how to effectively solve the problems of recovery processing of the two-dimensional code with wrinkles and the like is a technical problem that needs to be solved urgently by those skilled in the art at present.
Disclosure of Invention
The invention aims to provide a wrinkle two-dimensional code recovery method, a wrinkle two-dimensional code recovery device and a readable storage medium, so that two-dimensional code pictures with different wrinkle conditions can be effectively recovered.
In order to solve the technical problems, the invention provides the following technical scheme:
a folded two-dimensional code recovery method comprises the following steps:
acquiring an identifiable original two-dimensional code picture, and performing wrinkling processing on the original two-dimensional code picture by using a distortion mapping map to obtain a wrinkled two-dimensional code picture;
taking the fold two-dimensional code picture as input data, and performing fold recovery training on a deep learning network by combining the original two-dimensional code picture to obtain a target deep learning network;
and acquiring a target wrinkle two-dimensional code picture, and performing wrinkle recovery processing on the target wrinkle two-dimensional code picture by using the target deep learning network to acquire a recognizable target two-dimensional code picture.
Preferably, after obtaining the wrinkled two-dimensional code picture, before taking the wrinkled two-dimensional code picture as input data, the method further includes:
and performing data enhancement processing on the folded two-dimensional code picture.
Preferably, after obtaining the wrinkled two-dimensional code picture, before taking the wrinkled two-dimensional code picture as input data, the method further includes:
and carrying out picture realistic processing on the folded two-dimensional code picture, wherein the picture realistic processing comprises at least one of random rotation, noise addition, size reduction and background addition.
Preferably, the acquiring of the recognizable original two-dimensional code picture includes:
and generating the original two-dimensional code picture by using two-dimensional code generation software.
Preferably, after obtaining the recognizable target two-dimensional code picture, the method further includes:
and carrying out two-dimensional code identification on the target two-dimensional code picture.
Preferably, the performing the crumpling process on the original two-dimensional code picture by using the warp map to obtain a crumpled two-dimensional code picture includes:
dividing the original two-dimensional code picture by using a grating method to obtain a plurality of grids with the same size;
randomly selecting seed points and offset vectors in each grid, and offsetting pixel points in the grids according to the folding coefficients and the bending coefficients by using the diffusion principle on the basis of the seed points to obtain a target offset equation;
obtaining a disturbance grid by using the target offset equation;
and combining the perturbation grid, applying the distortion mapping graph to the original two-dimensional code picture, and obtaining the fold two-dimensional code picture.
Preferably, the fold recovery processing is performed on the target fold two-dimensional code picture by using the target deep learning network, so as to obtain a recognizable target two-dimensional code picture, and the fold recovery processing includes:
performing a group of convolutions on the target fold two-dimensional code by using the target deep learning network to obtain a convolution result;
inputting the convolution result into a posing layer for scale transformation to obtain a scale transformation result;
and inputting the scale transformation result into a DenseNet network for wrinkle recovery processing to obtain the target two-dimensional code picture.
A wrinkle two-dimensional code recovery device comprises:
the data acquisition module is used for acquiring an identifiable original two-dimensional code picture and performing wrinkling processing on the original two-dimensional code picture by using a distortion mapping map to obtain a wrinkled two-dimensional code picture;
the network training module is used for taking the fold two-dimensional code picture as input data and carrying out fold recovery training on the deep learning network by combining the original two-dimensional code picture to obtain a target deep learning network;
and the wrinkle recovery module is used for obtaining a target wrinkle two-dimensional code picture, and performing wrinkle recovery processing on the target wrinkle two-dimensional code picture by using the target deep learning network to obtain a recognizable target two-dimensional code picture.
A wrinkle two-dimensional code recovery device comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the wrinkle two-dimensional code recovery method when the computer program is executed.
A readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described wrinkle two-dimensional code recovery method.
By applying the method provided by the embodiment of the invention, the recognizable original two-dimensional code picture is obtained, and the distortion mapping map is utilized to carry out the wrinkling processing on the original two-dimensional code picture so as to obtain the wrinkled two-dimensional code picture; taking the fold two-dimensional code picture as input data, and performing fold recovery training on the deep learning network by combining the original two-dimensional code picture to obtain a target deep learning network; and acquiring a target wrinkle two-dimensional code picture, and performing wrinkle recovery processing on the target wrinkle two-dimensional code picture by using a target deep learning network to acquire a recognizable target two-dimensional code picture.
The wrinkle conditions appearing in the two-dimensional code picture are various, and the effective recovery algorithm corresponding to each wrinkle condition is difficult to exhaust. And due to the learning capability of the deep learning network, the data processing process can be continuously optimized in the training process, and finally, the expected processing result can be output after the input data are processed. Based on the method, firstly, an identifiable original two-dimensional code picture is obtained, the original two-dimensional code picture is subjected to wrinkling processing by using the distortion mapping map, a wrinkled two-dimensional code picture is obtained, and the two-dimensional code picture is subjected to wrinkling processing by using the distortion mapping map, so that the wrinkled two-dimensional code picture is obtained. And then inputting the two-dimensional code picture of the fold into a deep learning network, and performing fold recovery training by combining the original two-dimensional code picture to obtain a target deep learning network capable of performing fold recovery on the two-dimensional code picture of the fold under different fold conditions. After the target wrinkle two-dimensional code picture is obtained, the target wrinkle two-dimensional code picture can be subjected to wrinkle recovery processing by using a target depth network, and a recognizable target two-dimensional code picture is obtained. Therefore, the effective recovery algorithm corresponding to each wrinkle condition is not required to be exhausted, only the recognizable original two-dimensional code picture needs to be wrinkled, the wrinkle two-dimensional code picture and the original two-dimensional code picture are used for training the deep learning network, and finally the target deep learning network obtained after training can be used for effectively recovering the two-dimensional code pictures with different wrinkle conditions.
Correspondingly, the embodiment of the invention also provides a wrinkle two-dimensional code recovery device, equipment and a readable storage medium corresponding to the wrinkle two-dimensional code recovery method, which have the technical effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating an implementation of a two-dimensional code recovery method for wrinkles according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a two-dimensional code recovery device for wrinkles in an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a two-dimensional code recovery device for wrinkles in an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a folded two-dimensional code recovery device in an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The first embodiment is as follows:
referring to fig. 1, fig. 1 is a flowchart illustrating a method for recovering a two-dimensional code with wrinkles according to an embodiment of the present invention, where the method includes the following steps:
s101, obtaining an identifiable original two-dimensional code picture, and performing wrinkling processing on the original two-dimensional code picture by using the distortion mapping map to obtain a wrinkled two-dimensional code picture.
The two-dimension code can be shot through the image acquisition equipment to obtain the two-dimension code picture, and the two-dimension code picture is identified to obtain the original two-dimension code picture carried by the two-dimension code picture. Or acquiring the recognizable two-dimensional code picture from the network by using the web crawler. The method and the device consider that the unidentifiable two-dimensional code picture cannot be acquired due to the reasons of light, the pixel size of the image acquisition equipment, shake, angle and the like during shooting. And in the process of acquiring the original two-dimensional code picture by using the web crawler, the acquired picture needs to be screened.
Preferably, the recognizable original two-dimensional code picture can be generated by directly utilizing two-dimensional code generation software, so that a two-dimensional code shooting process and a two-dimensional code recognition process can be omitted. The two-dimensional code generation software can select common two-dimensional codes such as a forage two-dimensional code generator, a vector two-dimensional code, a joint diagram two-dimensional code and the like to generate, and only the two-dimensional code generation software can generate the recognizable original two-dimensional code picture, so that the encoding mode of the two-dimensional code generation software and the specification of the output two-dimensional code are not limited.
After the original two-dimensional code picture is obtained, the original two-dimensional code picture can be subjected to wrinkling processing by using the distortion mapping map, namely, wrinkles appearing on the two-dimensional code shot in the simulation reality application scene are simulated. Therefore, the two-dimensional code picture with folds can be obtained.
Wherein, the wrinkle processing process may include:
dividing an original two-dimensional code picture by using a grating method to obtain a plurality of grids with the same size;
randomly selecting seed points and offset vectors in each grid, and offsetting pixel points in the grid according to the folding coefficients and the bending coefficients by using the diffusion principle on the basis of the seed points to obtain a target offset equation;
thirdly, obtaining a disturbance grid by using a target offset equation;
and step four, combining the disturbance grid, applying the distortion mapping graph to the original two-dimensional code picture, and obtaining the fold two-dimensional code picture.
For convenience of description, the above four steps will be described in combination.
To make a foldThe obtained folded two-dimensional code picture can be more similar to the folded two-dimensional code picture under the real condition, a distortion mapping map can be applied to the original two-dimensional code picture by combining a disturbance network, and the folded two-dimensional code picture is finally obtained. The warp map may be specifically a warp map at a pixel level, which is established on the basis of the perturbation network by using linear interpolation. That is to say, the generation factor of the wrinkle in the two-dimensional code picture can be effectively simulated under the real scene based on the distortion mapping chart. In addition, the disturbance network may be a sampling format method, and the original two-dimensional code picture is divided to obtain a plurality of grids with the same size, where the grids may be regular patterns, such as n × n squares. Then, randomly selecting a seed point and an offset vector in each grid, and offsetting pixel points in the grid according to the folding coefficient and the bending coefficient by using the diffusion principle on the basis of the seed point to obtain a target offset equation. The diffusion principle is utilized to simulate wrinkles, and the wrinkles with different degrees are generated on pictures at different positions in the transmission process of force. Wherein the fold-back coefficient can be expressed as
Figure BDA0001973722330000061
The bending modulus can be expressed as 1-dαα is a parameter regulated, the parameter value can be randomly selected between 0.6-1 to promote data diversification, after a target offset equation of each network is obtained, a disturbance grid can be obtained, the disturbance grid is disturbed, and the disturbance can be transmitted to one grid of each target offset equation in the grid.
It should be noted that, in the embodiment of the present invention, the original two-dimensional code picture and the folded two-dimensional code picture obtained by performing folding processing on the original two-dimensional code picture do not refer to one picture, but refer to batch original two-dimensional code pictures and batch folded two-dimensional code pictures. In addition, an original two-dimensional code picture can be subjected to wrinkle processing to obtain different wrinkle two-dimensional code pictures. I.e. the corrugation process is a random process, not an oriented process.
S102, taking the fold two-dimensional code picture as input data, and performing fold recovery training on the deep learning network by combining the original two-dimensional code picture to obtain a target deep learning network.
After the two-dimensional code picture of the fold is obtained, the two-dimensional code of the fold can be used as input data, the two-dimensional code picture of the fold is subjected to fold recovery processing by using a deep learning network, the two-dimensional code picture which is recovered is obtained, at the moment, the two-dimensional code picture which is recovered is compared with the original two-dimensional code picture, whether the two-dimensional codes are consistent or not is judged by respectively identifying the two-dimensional codes in the original two-dimensional code picture and the two-dimensional codes in the two-dimensional code picture which are recovered in a specific comparison process, and a comparison result is fed back to. During the training process, the wrinkle recovery loss value of the network can be calculated by using the loss function after each round of training is finished. The loss function may be embodied as a mean square and error function representation of the calculated alignment results. In addition, the learning rate during training can be set to be 0.001, and when the change of the wrinkle recovery loss value is smaller than a specified value, the training is finished, and the target deep learning network is obtained.
Preferably, in order to enable the target deep learning network to recover the two-dimensional code pictures of various wrinkle situations, data enhancement processing may be performed on the wrinkle two-dimensional code pictures to enhance the diversity of input data. Specifically, after the wrinkled two-dimensional code picture is obtained, before the wrinkled two-dimensional code picture is used as input data, data enhancement processing is performed on the wrinkled two-dimensional code picture. The data enhancement processing includes, but is not limited to, performing data enhancement operations such as turning, clipping, contrast conversion and the like on the original two-dimensional code picture to improve network generalization.
Preferably, in order to make the wrinkled two-dimensional code picture more similar to the wrinkled two-dimensional code generated in the real application scene, after the wrinkled two-dimensional code picture is obtained, before the wrinkled two-dimensional code picture is used as input data, the wrinkled two-dimensional code picture may be subjected to picture realistic processing, where the picture realistic processing includes at least one of random rotation, noise addition, size reduction and background addition. The method comprises the steps of carrying out batch processing on a CPU through operations of random rotation, noise addition, size reduction, background addition and the like to obtain a group of complete data sets which are closer to real samples.
S103, obtaining a target wrinkle two-dimensional code picture, and performing wrinkle recovery processing on the target wrinkle two-dimensional code picture by using a target deep learning network to obtain a recognizable target two-dimensional code picture.
After the target deep learning network is obtained and the target wrinkle two-dimensional code picture is obtained, the target deep learning network can be used for performing wrinkle recovery processing on the target wrinkle two-dimensional code picture, and therefore the recognizable target two-dimensional code picture can be obtained.
The wrinkle recovery processing process may include:
performing a group of convolutions on a target wrinkle two-dimensional code by using a target deep learning network to obtain a convolution result;
inputting the convolution result into a posing layer for scale transformation to obtain a scale transformation result;
inputting the scale transformation result into a DenseNet to carry out fold recovery processing to obtain a target two-dimensional code picture; each basic block of the DenseNet network is subjected to down sampling once so as to fix the size of the target two-dimensional code picture.
For convenience of description, the above three steps will be described in combination.
The target deep learning Network may be a deep learning Network including a convolutional layer, a posing layer, and a densneet Network (dense convolutional Network). Firstly, performing a group of convolutions on a folded two-dimensional code picture to obtain a convolution result, and then accessing a posing layer to perform scale transformation on the convolution result, for example, reducing the scale by half to obtain a scale transformation result. And then, based on a DenseNet (each basic block (basic module) of the DenseNet is subjected to once down-sampling, the scale can be reduced by half by sampling each time, and three groups of basic block modules can be designed) to process the scale transformation result, and finally, a recognizable target two-dimensional code picture is obtained. In the whole recovery processing process, the picture or data size of each stage may be specifically, if the pixel size of the target folded two-dimensional code picture is 400 × 400; after the posing layer carries out scale transformation on the target fold two-dimensional code, the pixel size is 200 x 200; in addition, each of the basic modules in the DenseNet network may reduce the sampling scale to 100 × 100, 50 × 50, and 25 × 25 in sequence, that is, the final output two-dimensional code may be 25 × 25, that is, the final target two-dimensional code picture may be Level2 Level (25 × 25 pixels may represent all information). It should be noted that, the number of basic block modules may also be set to other values, such as 2 or 4, but the pixels of the target two-dimensional code that needs to be finally output can represent all information, that is, when the number of basic block modules is increased, the pixel size of the target two-dimensional code with folds may be fixed to a larger value, and when the number of basic block modules is decreased, the pixel size of the target two-dimensional code with folds may be fixed to a smaller value. The wrinkle recovery processing procedure performed by the deep learning network can be referred to, and is not described in detail herein.
After the recognizable target two-dimensional code picture is obtained, two-dimensional code recognition can be carried out on the target two-dimensional code picture. That is to say, by combining the two-dimensional code recognition technology, the two-dimensional code picture with wrinkles can be effectively recognized through the wrinkle two-dimensional code recovery method provided by the embodiment of the invention.
By applying the method provided by the embodiment of the invention, the recognizable original two-dimensional code picture is obtained, and the distortion mapping map is utilized to carry out the wrinkling processing on the original two-dimensional code picture so as to obtain the wrinkled two-dimensional code picture; taking the fold two-dimensional code picture as input data, and performing fold recovery training on the deep learning network by combining the original two-dimensional code picture to obtain a target deep learning network; and acquiring a target wrinkle two-dimensional code picture, and performing wrinkle recovery processing on the target wrinkle two-dimensional code picture by using a target deep learning network to acquire a recognizable target two-dimensional code picture.
The wrinkle conditions appearing in the two-dimensional code picture are various, and the effective recovery algorithm corresponding to each wrinkle condition is difficult to exhaust. And due to the learning capability of the deep learning network, the data processing process can be continuously optimized in the training process, and finally, the expected processing result can be output after the input data are processed. Based on the method, firstly, an identifiable original two-dimensional code picture is obtained, the original two-dimensional code picture is subjected to wrinkling processing by using the distortion mapping map, a wrinkled two-dimensional code picture is obtained, and the two-dimensional code picture is subjected to wrinkling processing by using the distortion mapping map, so that the wrinkled two-dimensional code picture is obtained. And then inputting the two-dimensional code picture of the fold into a deep learning network, and performing fold recovery training by combining the original two-dimensional code picture to obtain a target deep learning network capable of performing fold recovery on the two-dimensional code picture of the fold under different fold conditions. After the target wrinkle two-dimensional code picture is obtained, the target wrinkle two-dimensional code picture can be subjected to wrinkle recovery processing by using a target depth network, and a recognizable target two-dimensional code picture is obtained. Therefore, the effective recovery algorithm corresponding to each wrinkle condition is not required to be exhausted, only the recognizable original two-dimensional code picture needs to be wrinkled, the wrinkle two-dimensional code picture and the original two-dimensional code picture are used for training the deep learning network, and finally the target deep learning network obtained after training can be used for effectively recovering the two-dimensional code pictures with different wrinkle conditions.
Example two:
in order to facilitate better understanding of the method for recovering the two-dimensional code of the wrinkle provided by the embodiment of the present invention, a target convolutional network is taken as an example of a convolutional neural network, and the method for recovering the two-dimensional code of the wrinkle provided by the embodiment of the present invention is described in detail below.
The method may specifically comprise the steps of:
1. utilizing 10000 two-dimensional code pictures generated by computer graphics algorithm software to carry out folding and bending fitting on the folding condition of the real two-dimensional code;
2. carrying out data enhancement operations such as turning, cutting, contrast conversion and the like on the data obtained in the step 1 so as to improve the network generalization;
3. designing a deep convolutional neural network structure;
4. the designed convolutional neural network is trained with the processed data set. And the finally obtained convolution neural network result can be better applied to recovery of the folded two-dimensional code image in the real scene.
The method comprises the steps of constructing a data set, specifically, generating 10000 two-dimensional code pictures (the pixel size is 800 × 800) containing determination information by using two-dimensional code generation software; then, dividing the picture into 100 x 100 grids by using a grid method, randomly selecting seed points and offset vectors thereof, and then using a diffusion principle to fold other points in the grid according to a doubling factor
Figure BDA0001973722330000101
Bending modulus 1-dαAnd obtaining an offset equation, and finally obtaining a disturbance grid capable of simulating the wrinkle condition of the real two-dimensional code. Establishing a pixel level distortion mapping map by combining the generated disturbance grid and utilizing linear interpolation, and finally applying the pixel level distortion mapping map to a two-dimensional code picture to obtain a simulated fold two-dimensional code picture; through operations of random rotation, noise addition, size reduction, background addition and the like, a group of complete data sets which are closer to real samples are obtained after batch processing on a CPU.
The network design is that the network can carry out operations such as size transformation, random cutting, data enhancement of contrast distortion and the like on the pictures input into the network, and the size of the pictures input into the network is fixed at 400 x 400; then, under the PyTorch deep learning framework, a set of convolutions is performed on the input data, and then the firing layer is accessed, and the scale is reduced by half. Then based on a DenseNet (each basic block of which is subjected to down sampling once), three groups of basic block modules can be designed, and finally the whole network output is fixed at nB 1 × 25; wherein nB represents a parameter indicating the size of batch processing, i.e., the number of pictures input into the network at a time during training, as well as Batchsize herein.
The training process comprises the following steps: preprocessing a picture data set and then reading the picture data set into a network according to a format of Batchsize 16; writing the modified model structure into a model file based on a PyTorch framework; the loss function can be represented by directly utilizing the mean square and error functions, and the training learning rate can be set to be 0.001; the training is repeated for 50 rounds on the training data set.
After the training is finished, the target deep learning network can be obtained. And then, inputting the folded two-dimensional code graph, outputting the graph which is the recovered graph, and using the output graph for two-dimensional code identification.
Example three:
corresponding to the above method embodiment, an embodiment of the present invention further provides a two-dimensional code recovery device for wrinkles, where the two-dimensional code recovery device for wrinkles described below and the two-dimensional code recovery method for wrinkles described above may be referred to in a corresponding manner.
Referring to fig. 2, the apparatus includes the following modules:
the data acquisition module 101 is configured to acquire an identifiable original two-dimensional code picture, and perform wrinkling processing on the original two-dimensional code picture by using the distortion mapping map to obtain a wrinkled two-dimensional code picture;
the network training module 102 is used for taking the fold two-dimensional code picture as input data and performing fold recovery training on the deep learning network by combining the original two-dimensional code picture to obtain a target deep learning network;
and the wrinkle recovery module 103 is configured to obtain a target wrinkle two-dimensional code picture, and perform wrinkle recovery processing on the target wrinkle two-dimensional code picture by using a target deep learning network to obtain a recognizable target two-dimensional code picture.
By applying the device provided by the embodiment of the invention, the recognizable original two-dimensional code picture is obtained, and the distortion mapping map is utilized to carry out the wrinkling processing on the original two-dimensional code picture so as to obtain the wrinkled two-dimensional code picture; taking the fold two-dimensional code picture as input data, and performing fold recovery training on the deep learning network by combining the original two-dimensional code picture to obtain a target deep learning network; and acquiring a target wrinkle two-dimensional code picture, and performing wrinkle recovery processing on the target wrinkle two-dimensional code picture by using a target deep learning network to acquire a recognizable target two-dimensional code picture.
The wrinkle conditions appearing in the two-dimensional code picture are various, and the effective recovery algorithm corresponding to each wrinkle condition is difficult to exhaust. And due to the learning capability of the deep learning network, the data processing process can be continuously optimized in the training process, and finally, the expected processing result can be output after the input data are processed. Based on the method, the device firstly obtains the recognizable original two-dimensional code picture, carries out wrinkling processing on the original two-dimensional code picture by using the distortion mapping map to obtain the wrinkled two-dimensional code picture, and carries out wrinkling processing on the two-dimensional code picture by using the distortion mapping map to obtain the wrinkled two-dimensional code picture. And then inputting the two-dimensional code picture of the fold into a deep learning network, and performing fold recovery training by combining the original two-dimensional code picture to obtain a target deep learning network capable of performing fold recovery on the two-dimensional code picture of the fold under different fold conditions. After the target wrinkle two-dimensional code picture is obtained, the target wrinkle two-dimensional code picture can be subjected to wrinkle recovery processing by using a target depth network, and a recognizable target two-dimensional code picture is obtained. Therefore, the effective recovery algorithm corresponding to each wrinkle condition is not required to be exhausted, only the recognizable original two-dimensional code picture needs to be wrinkled, the wrinkle two-dimensional code picture and the original two-dimensional code picture are used for training the deep learning network, and finally the target deep learning network obtained after training can be used for effectively recovering the two-dimensional code pictures with different wrinkle conditions.
In one embodiment of the present invention, the method further comprises:
and the data enhancement processing module is used for performing data enhancement processing on the wrinkle two-dimensional code picture before the wrinkle two-dimensional code picture is taken as input data after the wrinkle two-dimensional code picture is obtained.
In one embodiment of the present invention, the method further comprises:
and the photorealisation processing module is used for carrying out photorealisation processing on the wrinkled two-dimensional code picture after the wrinkled two-dimensional code picture is obtained and before the wrinkled two-dimensional code picture is taken as input data, and the photorealisation processing comprises at least one of random rotation, noise addition, size reduction and background addition.
In an embodiment of the present invention, the data obtaining module 101 is specifically configured to generate an original two-dimensional code picture by using two-dimensional code generating software.
In one embodiment of the present invention, the method further comprises:
and the two-dimension code identification module is used for identifying the two-dimension code of the target two-dimension code picture after the recognizable target two-dimension code picture is obtained.
In a specific embodiment of the present invention, the data obtaining module 101 is specifically configured to divide an original two-dimensional code picture by using a grid method to obtain a plurality of grids with the same size; randomly selecting seed points and offset vectors in each grid, and offsetting pixel points in the grid according to the folding coefficient and the bending coefficient by using the diffusion principle on the basis of the seed points to obtain a target offset equation; obtaining a disturbance grid by using a target offset equation; and applying the distortion mapping graph to the original two-dimensional code picture by combining the disturbance grid to obtain a fold two-dimensional code picture.
In a specific embodiment of the present invention, the wrinkle recovery module 103 is specifically configured to perform a group of convolutions on the target wrinkle two-dimensional code by using a target deep learning network, so as to obtain a convolution result; inputting the convolution result into a posing layer for scale transformation to obtain a scale transformation result; inputting the scale transformation result into a DenseNet network for wrinkle recovery processing to obtain a target two-dimensional code picture; each basic block of the DenseNet network is subjected to down sampling once so as to fix the size of the target two-dimensional code picture.
Example four:
corresponding to the above method embodiment, an embodiment of the present invention further provides a two-dimensional code recovery device for wrinkles, where a two-dimensional code recovery device for wrinkles described below and a two-dimensional code recovery method for wrinkles described above may be referred to in a corresponding manner.
Referring to fig. 3, the wrinkle two-dimensional code recovery apparatus includes:
a memory D1 for storing computer programs;
and a processor D2, configured to implement the steps of the folded two-dimensional code recovery method according to the foregoing method embodiment when executing the computer program.
Specifically, referring to fig. 4, fig. 4 is a schematic diagram of a specific structure of a two-dimensional code recovery device for a wrinkle provided in this embodiment, where the two-dimensional code recovery device may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 322 (e.g., one or more processors) and a memory 332, and one or more storage media 330 (e.g., one or more mass storage devices) storing an application 342 or data 344. Memory 332 and storage media 330 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 330 may include one or more modules (not shown), each of which may include a series of instructions operating on a data processing device. Further, the central processor 322 may be configured to communicate with the storage medium 330, and execute a series of instruction operations in the storage medium 330 on the wrinkle two-dimensional code recovery device 301.
The corrugated two-dimensional code recovery device 301 may also include one or more power sources 326, one or more wired or wireless network interfaces 350, one or more input-output interfaces 358, and/or one or more operating systems 341. Such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
The steps in the folded two-dimensional code recovery method described above may be implemented by the structure of a folded two-dimensional code recovery apparatus.
Example five:
corresponding to the above method embodiment, an embodiment of the present invention further provides a readable storage medium, and a readable storage medium described below and a wrinkle two-dimensional code recovery method described above may be referred to in correspondence.
A readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the wrinkle two-dimensional code recovery method of the above-mentioned method embodiments.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various other readable storage media capable of storing program codes.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.

Claims (10)

1. A method for recovering a two-dimensional code with wrinkles is characterized by comprising the following steps:
acquiring an identifiable original two-dimensional code picture, and performing wrinkling processing on the original two-dimensional code picture by using a distortion mapping map to obtain a wrinkled two-dimensional code picture;
taking the fold two-dimensional code picture as input data, and performing fold recovery training on a deep learning network by combining the original two-dimensional code picture to obtain a target deep learning network;
and acquiring a target wrinkle two-dimensional code picture, and performing wrinkle recovery processing on the target wrinkle two-dimensional code picture by using the target deep learning network to acquire a recognizable target two-dimensional code picture.
2. The wrinkle two-dimensional code recovery method according to claim 1, further comprising, after the obtaining the wrinkle two-dimensional code picture and before the obtaining the wrinkle two-dimensional code picture as input data:
and performing data enhancement processing on the folded two-dimensional code picture.
3. The wrinkle two-dimensional code recovery method according to claim 1, further comprising, after the obtaining of the wrinkle two-dimensional code picture and before the obtaining of the wrinkle two-dimensional code picture as input data:
and carrying out picture realistic processing on the folded two-dimensional code picture, wherein the picture realistic processing comprises at least one of random rotation, noise addition, size reduction and background addition.
4. The recovery method for two-dimensional code with wrinkles according to claim 1, wherein the obtaining of recognizable original two-dimensional code picture comprises:
and generating the original two-dimensional code picture by using two-dimensional code generation software.
5. The recovery method of the two-dimensional code with wrinkles as claimed in claim 1, further comprising, after the obtaining the recognizable target two-dimensional code picture:
and carrying out two-dimensional code identification on the target two-dimensional code picture.
6. The wrinkle two-dimensional code recovery method according to claim 1, wherein the obtaining the wrinkle two-dimensional code picture by performing wrinkle processing on the original two-dimensional code picture by using the warp map comprises:
dividing the original two-dimensional code picture by using a grating method to obtain a plurality of grids with the same size;
randomly selecting seed points and offset vectors in each grid, and offsetting pixel points in the grids according to the folding coefficients and the bending coefficients by using the diffusion principle on the basis of the seed points to obtain a target offset equation;
obtaining a disturbance grid by using the target offset equation;
and combining the perturbation grid, applying the distortion mapping graph to the original two-dimensional code picture, and obtaining the fold two-dimensional code picture.
7. The wrinkle two-dimensional code recovery method according to any one of claims 1 to 6, wherein performing wrinkle recovery processing on the target wrinkle two-dimensional code picture by using the target deep learning network to obtain a recognizable target two-dimensional code picture comprises:
performing a group of convolutions on the target fold two-dimensional code by using the target deep learning network to obtain a convolution result;
inputting the convolution result into a posing layer for scale transformation to obtain a scale transformation result;
and inputting the scale transformation result into a DenseNet network for wrinkle recovery processing to obtain the target two-dimensional code picture.
8. The utility model provides a fold two-dimensional code recovery unit which characterized in that includes:
the data acquisition module is used for acquiring an identifiable original two-dimensional code picture and performing wrinkling processing on the original two-dimensional code picture by using a distortion mapping map to obtain a wrinkled two-dimensional code picture;
the network training module is used for taking the fold two-dimensional code picture as input data and carrying out fold recovery training on the deep learning network by combining the original two-dimensional code picture to obtain a target deep learning network;
and the wrinkle recovery module is used for obtaining a target wrinkle two-dimensional code picture, and performing wrinkle recovery processing on the target wrinkle two-dimensional code picture by using the target deep learning network to obtain a recognizable target two-dimensional code picture.
9. The utility model provides a fold two-dimensional code recovery device which characterized in that includes:
a memory for storing a computer program;
a processor for implementing the steps of the wrinkle two-dimensional code recovery method according to any one of claims 1 to 7 when executing the computer program.
10. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program, which when executed by a processor implements the steps of the wrinkle two-dimensional code recovery method according to any one of claims 1 to 7.
CN201910135066.4A 2019-02-20 2019-02-20 Fold two-dimensional code recovery method, device and equipment and readable storage medium Pending CN111597846A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910135066.4A CN111597846A (en) 2019-02-20 2019-02-20 Fold two-dimensional code recovery method, device and equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910135066.4A CN111597846A (en) 2019-02-20 2019-02-20 Fold two-dimensional code recovery method, device and equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN111597846A true CN111597846A (en) 2020-08-28

Family

ID=72188921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910135066.4A Pending CN111597846A (en) 2019-02-20 2019-02-20 Fold two-dimensional code recovery method, device and equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111597846A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022047662A1 (en) * 2020-09-02 2022-03-10 Intel Corporation Method and system of neural network object recognition for warpable jerseys with multiple attributes

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030011618A1 (en) * 1998-02-17 2003-01-16 Sun Microsystems, Inc. Graphics system with a programmable sample position memory
US20050243103A1 (en) * 2004-04-30 2005-11-03 Microsoft Corporation Novel method to quickly warp a 2-D image using only integer math
CN103593664A (en) * 2013-11-29 2014-02-19 重庆大学 Preprocessing method for distorted image of QR (Quick Response) code
CN108460746A (en) * 2018-04-10 2018-08-28 武汉大学 A kind of image repair method predicted based on structure and texture layer
CN108537747A (en) * 2018-03-22 2018-09-14 南京大学 A kind of image repair method based on the convolutional neural networks with symmetrical parallel link
CN108647550A (en) * 2018-04-11 2018-10-12 中山大学 A kind of Quick Response Code fuzzy clustering recognition method and system based on machine learning
CN108920992A (en) * 2018-08-08 2018-11-30 长沙理工大学 A kind of positioning and recognition methods of the medical label bar code based on deep learning

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030011618A1 (en) * 1998-02-17 2003-01-16 Sun Microsystems, Inc. Graphics system with a programmable sample position memory
US20050243103A1 (en) * 2004-04-30 2005-11-03 Microsoft Corporation Novel method to quickly warp a 2-D image using only integer math
CN103593664A (en) * 2013-11-29 2014-02-19 重庆大学 Preprocessing method for distorted image of QR (Quick Response) code
CN108537747A (en) * 2018-03-22 2018-09-14 南京大学 A kind of image repair method based on the convolutional neural networks with symmetrical parallel link
CN108460746A (en) * 2018-04-10 2018-08-28 武汉大学 A kind of image repair method predicted based on structure and texture layer
CN108647550A (en) * 2018-04-11 2018-10-12 中山大学 A kind of Quick Response Code fuzzy clustering recognition method and system based on machine learning
CN108920992A (en) * 2018-08-08 2018-11-30 长沙理工大学 A kind of positioning and recognition methods of the medical label bar code based on deep learning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈柯成,等: "基于SDAE的受损QR码恢复算法", pages 1 - 6 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022047662A1 (en) * 2020-09-02 2022-03-10 Intel Corporation Method and system of neural network object recognition for warpable jerseys with multiple attributes

Similar Documents

Publication Publication Date Title
CN106778928B (en) Image processing method and device
WO2021048607A1 (en) Motion deblurring using neural network architectures
Cheong et al. Deep CNN-based super-resolution using external and internal examples
CN109684901B (en) Image processing apparatus and image processing method
CN104285239A (en) Image processing device, image processing method, program, print medium, and recording medium
CN112529776B (en) Training method of image processing model, image processing method and device
CN115345866B (en) Building extraction method in remote sensing image, electronic equipment and storage medium
CN113724134A (en) Aerial image blind super-resolution reconstruction method based on residual distillation network
CN114863539A (en) Portrait key point detection method and system based on feature fusion
CN114419392A (en) Hyperspectral snapshot image recovery method, device, equipment and medium
CN109829857B (en) Method and device for correcting inclined image based on generation countermeasure network
CN111597846A (en) Fold two-dimensional code recovery method, device and equipment and readable storage medium
CN111597847A (en) Two-dimensional code identification method, device and equipment and readable storage medium
CN111340950A (en) Digital elevation model reconstruction method and device
CN115937429A (en) Fine-grained 3D face reconstruction method based on single image
CN113658046B (en) Super-resolution image generation method, device, equipment and medium based on feature separation
CN112330572B (en) Generation type antagonistic neural network based on intensive network and distorted image restoration method
CN113496468B (en) Depth image restoration method, device and storage medium
CN114333069A (en) Object posture processing method, device, equipment and storage medium
CN113971738A (en) Image detection method, image detection device, electronic equipment and storage medium
CN113362249A (en) Text image synthesis method and device, computer equipment and storage medium
CN116420174A (en) Full scale convolution for convolutional neural networks
CN113256528A (en) Low-illumination video enhancement method based on multi-scale cascade depth residual error network
CN115170916B (en) Image reconstruction method and system based on multi-scale feature fusion
CN113012072A (en) Image motion deblurring method based on attention network

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 214105 No. 299 Dacheng Road, Xishan District, Jiangsu, Wuxi

Applicant after: Zhongke Weizhi intelligent manufacturing technology Jiangsu Co.,Ltd.

Address before: 214105 No. 299 Dacheng Road, Xishan District, Jiangsu, Wuxi

Applicant before: ZHONGKE WEIZHI INTELLIGENT MANUFACTURING TECHNOLOGY JIANGSU Co.,Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200922

Address after: 214105 No. 299 Dacheng Road, Xishan District, Jiangsu, Wuxi

Applicant after: ZHONGKE WEIZHI INTELLIGENT MANUFACTURING TECHNOLOGY JIANGSU Co.,Ltd.

Address before: Zuchongzhi road Kunshan city 215347 Suzhou City, Jiangsu province No. 1699 building 7 floor

Applicant before: KUNSHAN BRANCH, INSTITUTE OF MICROELECTRONICS OF CHINESE ACADEMY OF SCIENCES