CN113468906A - Graphic code extraction model construction method, recognition method, device, equipment and medium - Google Patents

Graphic code extraction model construction method, recognition method, device, equipment and medium Download PDF

Info

Publication number
CN113468906A
CN113468906A CN202110785353.7A CN202110785353A CN113468906A CN 113468906 A CN113468906 A CN 113468906A CN 202110785353 A CN202110785353 A CN 202110785353A CN 113468906 A CN113468906 A CN 113468906A
Authority
CN
China
Prior art keywords
graphic code
image sample
sample
image
extraction model
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.)
Granted
Application number
CN202110785353.7A
Other languages
Chinese (zh)
Other versions
CN113468906B (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.)
Shenzhen Smartmore Technology Co Ltd
Shanghai Smartmore Technology Co Ltd
Original Assignee
Shenzhen Smartmore Technology Co Ltd
Shanghai Smartmore Technology Co Ltd
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 Shenzhen Smartmore Technology Co Ltd, Shanghai Smartmore Technology Co Ltd filed Critical Shenzhen Smartmore Technology Co Ltd
Priority to CN202110785353.7A priority Critical patent/CN113468906B/en
Publication of CN113468906A publication Critical patent/CN113468906A/en
Priority to PCT/CN2022/104857 priority patent/WO2023284670A1/en
Application granted granted Critical
Publication of CN113468906B publication Critical patent/CN113468906B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1443Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image
    • 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

Abstract

The application relates to the technical field of artificial intelligence, and provides a method for constructing a graphic code extraction model, a graphic code identification method, a graphic code identification device, computer equipment and a storage medium. According to the method and the device, the graphic code extraction model suitable for various application scenes can be constructed to improve the accuracy of the graphic code extraction model in recognition of the graphic code. The construction method comprises the following steps: obtaining a graphic code original image sample and a material background image sample, obtaining a corresponding graphic code standard image sample according to the graphic code original image sample, obtaining an augmented image sample based on the fusion of the graphic code standard image sample and the material background image sample, and constructing a graphic code extraction model by using the augmented image sample, the graphic code original image sample and the graphic code standard image sample.

Description

Graphic code extraction model construction method, recognition method, device, equipment and medium
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a method for constructing a graphic code extraction model, a graphic code identification method, a graphic code identification device, computer equipment and a storage medium.
Background
With the development of artificial intelligence technology, a technology for scanning and extracting graphic codes such as two-dimensional codes in various scenes by using a neural network model appears.
However, in the prior art, when a neural network model for extracting a graphic code is constructed or trained, due to the factors such as low complexity and limited number of adopted training samples, the trained model is difficult to adapt to the variable and diverse application scenarios of the graphic code in practical application, and the model trained in this way has low accuracy in recognizing the graphic code in the practical application scenarios.
Disclosure of Invention
In view of the above, it is necessary to provide a method for constructing a graphic code extraction model, a graphic code identification method, an apparatus, a computer device and a storage medium for solving the above technical problems.
A method of constructing a graphical code extraction model, the method comprising:
acquiring a graphic code original image sample and a material background image sample;
obtaining a corresponding graphic code standard image sample according to the graphic code original image sample;
obtaining an augmented image sample based on the fusion of the graphic code standard image sample and the material background image sample;
and constructing a graphic code extraction model by using the augmented image sample, the graphic code original image sample and the graphic code standard image sample.
A method for identifying a graphic code, the method comprising:
acquiring a graphic code extraction model constructed according to the method;
inputting a graphic code image to be identified into the graphic code extraction model;
obtaining a graphic code candidate area in the graphic code image to be recognized according to a graphic code recognition result output by the graphic code extraction model aiming at the graphic code image to be recognized;
and performing graph code edge fitting processing on the graph code candidate area to determine the graph code area in the graph code image to be identified.
An apparatus for constructing a graphic code extraction model, comprising:
the sample acquisition module is used for acquiring a graphic code original image sample and a material background image sample;
the sample generation module is used for obtaining a corresponding graphic code standard image sample according to the graphic code original image sample;
the sample fusion module is used for obtaining an augmented image sample based on the fusion of the graphic code standard image sample and the material background image sample;
and the model construction module is used for constructing a graphic code extraction model by utilizing the augmented image sample, the graphic code original image sample and the graphic code standard image sample.
A graphic code recognition device comprises:
the model acquisition module is used for acquiring the graphic code extraction model constructed according to the method;
the image input module is used for inputting the graphic code image to be identified to the graphic code extraction model;
the rough positioning module is used for obtaining a graphic code candidate area in the graphic code image to be identified according to a graphic code identification result output by the graphic code extraction model aiming at the graphic code image to be identified;
and the fine positioning module is used for performing graphic code edge fitting processing on the graphic code candidate area and determining the graphic code area in the graphic code image to be identified.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a graphic code original image sample and a material background image sample; obtaining a corresponding graphic code standard image sample according to the graphic code original image sample; obtaining an augmented image sample based on the fusion of the graphic code standard image sample and the material background image sample; and constructing a graphic code extraction model by using the augmented image sample, the graphic code original image sample and the graphic code standard image sample.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a graphic code extraction model constructed according to the method; inputting a graphic code image to be identified into the graphic code extraction model; obtaining a graphic code candidate area in the graphic code image to be recognized according to a graphic code recognition result output by the graphic code extraction model aiming at the graphic code image to be recognized; and performing graph code edge fitting processing on the graph code candidate area to determine the graph code area in the graph code image to be identified.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a graphic code original image sample and a material background image sample; obtaining a corresponding graphic code standard image sample according to the graphic code original image sample; obtaining an augmented image sample based on the fusion of the graphic code standard image sample and the material background image sample; and constructing a graphic code extraction model by using the augmented image sample, the graphic code original image sample and the graphic code standard image sample.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a graphic code extraction model constructed according to the method; inputting a graphic code image to be identified into the graphic code extraction model; obtaining a graphic code candidate area in the graphic code image to be recognized according to a graphic code recognition result output by the graphic code extraction model aiming at the graphic code image to be recognized; and performing graph code edge fitting processing on the graph code candidate area to determine the graph code area in the graph code image to be identified.
The method, the device, the computer equipment and the storage medium obtain the graphic code original image sample and the material background image sample, then obtain the corresponding graphic code standard image sample according to the graphic code original image sample, then obtain the augmented image sample based on the fusion of the graphic code standard image sample and the material background image sample, and construct the graphic code extraction model by utilizing the augmented image sample, the graphic code original image sample and the graphic code standard image sample. According to the scheme, the standard graphic code and various material backgrounds can be fused in a model training stage to form the augmented image samples with various material background styles, the graphic code original image samples and the graphic code standard image samples are used as model training data to perform model training, a graphic code extraction model suitable for various application scenes can be constructed, and the accuracy of the model in recognizing the graphic code is improved.
Drawings
FIG. 1 is a schematic flow chart diagram illustrating a method for constructing a graphical code extraction model in one embodiment;
FIG. 2 is a flow chart illustrating a method for identifying a graphic code according to an embodiment;
FIG. 3 is a block diagram of an apparatus for constructing a graphic code extraction model according to an embodiment;
FIG. 4 is a block diagram of an embodiment of a graphic code recognition apparatus;
FIG. 5 is a diagram illustrating an internal structure of a computer device according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The following sections firstly introduce the method for constructing the graphic code extraction model provided by the application, and then introduce the method for identifying the graphic code provided by the application. The method for constructing the graphic code extraction model provided by the application can be mainly executed by a server, and the server can be realized by an independent server or a server cluster consisting of a plurality of servers; the graphic code identification method provided by the application can be mainly executed by a terminal, and the terminal can be but is not limited to various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices.
In one embodiment, as shown in fig. 1, there is provided a method for constructing a graphic code extraction model, which may include the following steps:
step S101, obtaining a graphic code original image sample and a material background image sample;
in the description of the relevant features such as the image and the like in the model construction stage, description modes such as an image sample and the like are uniformly adopted so as to be distinguished from the model application, namely the graphic code identification stage. In this step, the graphic code original image sample and the material background image sample may be obtained by data acquisition and web crawler technology, the graphic code original image sample is an image containing a graphic code such as a two-dimensional code, the material background image sample is a background image containing a plurality of materials, the materials may include various materials that can be used for printing the graphic code, such as paper of various colors, various wood materials and plastic materials, and the like, and may further include such materials under various lighting conditions (such as different light and shade conditions) to cover application scenes where the graphic code may exist as much as possible.
Step S102, obtaining a corresponding graphic code standard image sample according to the graphic code original image sample;
the method mainly comprises the steps of generating a graphic code standard image sample corresponding to graphic code information contained in an original graphic code image sample according to the graphic code information, namely, converting the original image sample to form a new graphic code image for subsequent fusion processing on the basis of basically reserving the original graphic code information, wherein the new graphic code image is called the graphic code standard image sample, the conversion can be, for example, changing the position, the direction or the shape of the graphic code on the image, and the like, and can be used for enriching or standardizing the form of the graphic code on the image in some embodiments.
In one embodiment, the step S102 may include: generating a graphic code standard image initial sample according to the graphic code information carried by the graphic code original image sample; and performing morphological transformation processing on the graphic code points of the initial sample of the graphic code standard image to obtain the graphic code standard image sample.
The method mainly comprises the steps of generating a corresponding graphic code standard image initial sample according to graphic code information carried by a graphic code original image sample, specifically, extracting the graphic code information (character information) carried by the graphic code original image sample, changing the character information into standard graphic code image information through the code system of graphic codes such as two-dimensional codes, and setting a quadrilateral area to perform affine transformation on the standard graphic code image information, so that the graphic code standard image initial sample can be obtained. On the basis, in order to enrich the form of the graphic code so that the model can adapt to more diversified and changeable application scenes, the graphic code points of the initial sample of the standard image of the graphic code are further subjected to morphological transformation processing to obtain the standard image sample of the graphic code, and the morphological transformation processing at least comprises one of expansion, corrosion or random noise. Specifically, the probability P may be set to perform random morphological transformation (expansion, erosion, random noise, and the like) on the shape of the graphic code point in the initial sample of the graphic code standard image, so as to obtain the graphic code standard image sample.
Step S103, obtaining an augmented image sample based on the fusion of the graphic code standard image sample and the material background image sample;
in this step, the material background image sample can be used as the background of the graphic code standard image sample, and the graphic code standard image sample is fused into the material background image sample to obtain the augmented image sample. In a specific application, the number of the material background image samples may be multiple, and for this, in an embodiment, the step S103 may include:
performing contrast preservation fusion on the graphic code standard image sample and a plurality of material background image samples to obtain an augmented image initial sample; and screening the augmented image initial sample according to the semantic distance between the augmented image initial sample and the graphic code original image sample to obtain the augmented image sample.
The contrast-preserving blending (histograppervirngblending) is an algorithm for performing contrast-preserving blending on two pictures by calculating the color distribution of the pictures. In this embodiment, the contrast preservation fusion of the image code standard image sample and the multiple material background image samples may include performing the contrast preservation fusion of the image code standard image sample and each material background image sample, and may further include performing the contrast preservation fusion of the image code standard image sample and two or more material background image samples simultaneously, and performing multiple fusions with different material background combinations, so as to enrich the sample form, obtain the augmented image initial sample, where the number of the augmented image initial samples is multiple. Then, it is necessary to screen qualified augmented image samples from the augmented image initial samples, in this embodiment, the augmented image initial samples may be screened according to the semantic distance (D (I _ AUG) -D (I _ DM)) between the obtained augmented image initial samples (I _ AUG) and the original image samples (I _ DM) of the graphic code, and for example, if the semantic distance is lower than or equal to the semantic distance threshold, the augmented image initial samples may be screened as the augmented image samples.
And step S104, constructing a graphic code extraction model by using the augmented image sample, the graphic code original image sample and the graphic code standard image sample.
In this step, for the graphic code extraction model, the decoder may be formed by using a skip-connection between layers, using ImageNet pre-trained ResNet34 as a backbone network. Specifically, the augmented image sample and the original image sample of the graphic code can be used as input data of model training, the standard image sample of the graphic code can be used as label data of the model training, and the input data and the label data are used for constructing a graphic code extraction model. The graphic code standard image sample is mainly a graphic code standard image sample generated according to graphic code information carried by a graphic code original image sample, and is referred to as a graphic code standard image initial sample, i.e., a graphic code standard image sample which is not subjected to morphological transformation, as in the above embodiment.
In one embodiment, step S104 specifically includes: inputting the augmented image sample and the graphic code original image sample into a graphic code extraction model to be trained, and acquiring a graphic code extraction result sample output by the graphic code extraction model to be trained aiming at the augmented image sample and the graphic code original image sample; performing loss function calculation by using the graphic code extraction result sample and the graphic code standard image sample to obtain a loss calculation result; and training the graphic code extraction model to be trained by using the loss calculation result, and constructing to obtain the graphic code extraction model.
In the training process of this embodiment, an augmented image sample and a graphic code original image sample, which are input data for model training, are input into a graphic code extraction model to be trained, the graphic code extraction model to be trained outputs a corresponding graphic code extraction result sample for the augmented image sample and the graphic code original image sample, a graphic code standard image sample, which is label data for model training, and the graphic code extraction result sample perform loss function calculation to obtain a loss calculation result or a loss function calculation result, and then the loss calculation result can be used to adjust model network parameters of the graphic code extraction model to be trained, so as to train the graphic code extraction model to be trained and construct the graphic code extraction model. In a specific application, after an augmented image sample and a graphic code original image sample are input into a graphic code extraction model to be trained, a graphic code part in a graphic code extraction result sample output by the graphic code extraction model and a graphic code part in a graphic code standard image sample can be subjected to line loss function calculation, a loss weight is added to a graphic code quiet zone (quietzone) part, and the graphic code extraction model is constructed after certain iteration.
The method for constructing the graphic code extraction model comprises the steps of obtaining a graphic code original image sample and a material background image sample, obtaining a corresponding graphic code standard image sample according to the graphic code original image sample, obtaining an augmented image sample based on the fusion of the graphic code standard image sample and the material background image sample, and constructing the graphic code extraction model by utilizing the augmented image sample, the graphic code original image sample and the graphic code standard image sample. According to the scheme, the standard graphic code and various material backgrounds can be fused in a model training stage to form the augmented image samples with various material background styles, the graphic code original image samples and the graphic code standard image samples are used as model training data to perform model training, a graphic code extraction model suitable for various application scenes can be constructed, and the accuracy of the model in recognizing the graphic code is improved.
In one embodiment, as shown in fig. 2, there is provided a pattern code recognition method, which may include the steps of:
step S201, obtaining a graphic code extraction model constructed according to the method in the embodiment;
step S202, inputting a graphic code image to be identified into a graphic code extraction model;
in this step, after the image of the graphic code to be recognized is obtained, the image of the graphic code to be recognized may be scaled to a set scale space, and a series of basic preprocessing operations such as graying, sharpening and denoising may be performed before being input into the graphic code extraction model.
Step S203, obtaining a graph code candidate area in the graph code image to be identified according to a graph code identification result output by the graph code extraction model aiming at the graph code image to be identified;
the method mainly comprises the step of roughly positioning an area where the graphic code in the graphic code image to be recognized is located by a graphic code extraction model. After the graphic code image to be recognized is input into the graphic code extraction model, the graphic code extraction model outputs a corresponding graphic code recognition result, so that a graphic code candidate area in the graphic code image to be recognized is obtained according to the graphic code recognition result, namely, the area where the graphic code positioned on the graphic code image to be recognized by the graphic code extraction model is located is used as the graphic code candidate area.
And step S204, performing graph code edge fitting processing on the graph code candidate area, and determining the graph code area in the graph code image to be identified.
The method comprises the following steps of carrying out edge fitting processing on a candidate region of the graphic code on the basis of rough positioning of a graphic code extraction model so as to accurately position a graphic code region in a graphic code image to be identified.
In one embodiment, step S204 specifically includes: extracting at least one layer of outer layer edge points of the candidate region of the graphic code to obtain an outer layer edge point set; performing robust regression fitting on the outer layer edge point set to obtain a graphic code region edge fitting result in the graphic code image to be identified; and determining the graphic code area in the graphic code image to be identified according to the edge fitting result of the graphic code area.
The method mainly comprises the steps of extracting at least one layer of outer layer edge points from a graph code candidate area of the graph code extraction model rough positioning to form an outer layer edge point set, then carrying out robust regression fitting processing on the outer layer edge point set to determine the edge of the graph code area according to the graph code area edge fitting result, and accurately positioning the graph code area in the graph code image to be identified according to the edge. Wherein, the robust regression fitting refers to a statistical robust regression theory, such as Theil-Sen estimation to complete the fitting of the edge of the graphic code area. In specific application, for the extraction of the outer edge point, an edge extraction algorithm such as canny operator can be used for extracting the edge point of a candidate area of the graphic code, for example, a layer of edge points (corresponding to the outer edge point) are extracted from the outer side area of the candidate area to serve as an outer edge point set for fitting the boundary of the graphic code area, then the outer edge point set can be fitted by using Theil-Sen estimation to obtain the edge fitting result of the graphic code area, the graphic code area in the graphic code image to be identified is located according to the edge fitting result, and after the graphic code area is located, the image data corresponding to the graphic code area can be output to a graphic code decoding module to complete decoding processing.
According to the graphic code identification method, high-precision optimization of the edges of the graphic code candidate area rough positioning is achieved by applying a statistical method of edge extraction and robust regression on the basis of model rough positioning, the graphic code identification accuracy is improved, the method can adapt to continuously changing application scenes, has strong robustness, and is beneficial to improving the readability and decoding rate of graphic codes such as two-dimensional codes (QR and DM codes).
It should be understood that, although the steps in the above flowcharts are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the above flowcharts may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.
In one embodiment, as shown in fig. 3, there is provided an apparatus for constructing a graphic code extraction model, where the apparatus 300 may include:
the sample acquisition module 301 is used for acquiring a graphic code original image sample and a material background image sample;
the sample generation module 302 is configured to obtain a corresponding graphic code standard image sample according to the graphic code original image sample;
a sample fusion module 303, configured to obtain an augmented image sample based on fusion of the graphic code standard image sample and the material background image sample;
and the model construction module 304 is configured to construct a graphic code extraction model by using the augmented image sample, the graphic code original image sample and the graphic code standard image sample.
In an embodiment, the sample generating module 302 is configured to generate a graphic code standard image initial sample according to the graphic code information carried by the graphic code original image sample; carrying out morphological transformation processing on graphic code points of the initial sample of the graphic code standard image to obtain a graphic code standard image sample; the morphological transformation process includes at least one of dilation, erosion, or random noise.
In one embodiment, the number of the material background image samples is multiple; the sample fusion module 303 is configured to perform contrast preservation fusion on the graphic code standard image sample and the multiple material background image samples to obtain an augmented image initial sample; and screening the initial sample of the augmented image according to the semantic distance between the initial sample of the augmented image and the original image sample of the graphic code to obtain the sample of the augmented image.
In an embodiment, the model building module 304 is configured to input the augmented image sample and the original image sample of the graphical code into a to-be-trained graphical code extraction model, and obtain a graphical code extraction result sample output by the to-be-trained graphical code extraction model for the augmented image sample and the original image sample of the graphical code; performing loss function calculation by using the graphic code extraction result sample and the graphic code standard image sample to obtain a loss calculation result; and training the graphic code extraction model to be trained by using the loss calculation result to construct and obtain the graphic code extraction model.
In one embodiment, as shown in fig. 4, there is provided a pattern code recognition apparatus, and the apparatus 400 may include:
a model obtaining module 401, configured to obtain a graphic code extraction model constructed according to the method described above;
an image input module 402, configured to input a to-be-identified graph code image to the graph code extraction model;
the rough positioning module 403 is configured to obtain a pattern code candidate region in the pattern code image to be recognized according to a pattern code recognition result output by the pattern code extraction model for the pattern code image to be recognized;
and the fine positioning module 404 is configured to perform edge fitting processing on the candidate region of the graphic code, and determine a graphic code region in the graphic code image to be identified.
In an embodiment, the fine positioning module 404 is configured to extract at least one layer of outer layer edge points of the candidate region of the graphic code, so as to obtain an outer layer edge point set; performing robust regression fitting on the outer layer edge point set to obtain a graphic code region edge fitting result in the graphic code image to be identified; and determining the graphic code area in the graphic code image to be identified according to the edge fitting result of the graphic code area.
For specific limitations of the apparatus for constructing the pattern code extraction model and the pattern code recognition apparatus, reference may be made to the above limitations of the method for constructing the pattern code extraction model and the pattern code recognition method, which are not described herein again. The modules in the device for constructing the graphic code extraction model and the graphic code identification device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing image sample data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of constructing a graphical code extraction model.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a pattern code recognition method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configurations shown in fig. 5 and 6 are block diagrams of only some of the configurations relevant to the present disclosure, and do not constitute a limitation on the computing devices to which the present disclosure may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile memory may include Read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, or the like. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for constructing a graphic code extraction model is characterized by comprising the following steps:
acquiring a graphic code original image sample and a material background image sample;
obtaining a corresponding graphic code standard image sample according to the graphic code original image sample;
obtaining an augmented image sample based on the fusion of the graphic code standard image sample and the material background image sample;
and constructing a graphic code extraction model by using the augmented image sample, the graphic code original image sample and the graphic code standard image sample.
2. The method according to claim 1, wherein obtaining a corresponding standard image sample of the graphic code according to the original image sample of the graphic code comprises:
generating a graphic code standard image initial sample according to the graphic code information carried by the graphic code original image sample;
carrying out morphological transformation processing on graphic code points of the initial sample of the graphic code standard image to obtain a graphic code standard image sample; the morphological transformation process includes at least one of dilation, erosion, or random noise.
3. The method according to claim 1, wherein the number of the material background image samples is plural; obtaining an augmented image sample based on the fusion of the graphic code standard image sample and the material background image sample, wherein the augmented image sample comprises:
performing contrast preservation fusion on the graphic code standard image sample and a plurality of material background image samples to obtain an augmented image initial sample;
and screening the initial sample of the augmented image according to the semantic distance between the initial sample of the augmented image and the original image sample of the graphic code to obtain the sample of the augmented image.
4. The method according to any one of claims 1 to 3, wherein the constructing a graphic code extraction model by using the augmented image sample and the graphic code original image sample and the graphic code standard image sample comprises:
inputting the augmented image sample and the graphic code original image sample into a graphic code extraction model to be trained, and acquiring a graphic code extraction result sample output by the graphic code extraction model to be trained aiming at the augmented image sample and the graphic code original image sample;
performing loss function calculation by using the graphic code extraction result sample and the graphic code standard image sample to obtain a loss calculation result;
and training the graphic code extraction model to be trained by using the loss calculation result to construct and obtain the graphic code extraction model.
5. A graphic code identification method is characterized by comprising the following steps:
acquiring a graphic code extraction model constructed according to the method of any one of claims 1 to 4;
inputting a graphic code image to be identified into the graphic code extraction model;
obtaining a graphic code candidate area in the graphic code image to be recognized according to a graphic code recognition result output by the graphic code extraction model aiming at the graphic code image to be recognized;
and performing graph code edge fitting processing on the graph code candidate area to determine the graph code area in the graph code image to be identified.
6. The method according to claim 5, wherein the performing the graphic code edge fitting processing on the candidate area of the graphic code to determine the area of the graphic code in the graphic code image to be recognized comprises:
extracting at least one layer of outer layer edge points of the candidate region of the graphic code to obtain an outer layer edge point set;
performing robust regression fitting on the outer layer edge point set to obtain a graphic code region edge fitting result in the graphic code image to be identified;
and determining the graphic code area in the graphic code image to be identified according to the edge fitting result of the graphic code area.
7. An apparatus for constructing a graphic code extraction model, comprising:
the sample acquisition module is used for acquiring a graphic code original image sample and a material background image sample;
the sample generation module is used for obtaining a corresponding graphic code standard image sample according to the graphic code original image sample;
the sample fusion module is used for obtaining an augmented image sample based on the fusion of the graphic code standard image sample and the material background image sample;
and the model construction module is used for constructing a graphic code extraction model by utilizing the augmented image sample, the graphic code original image sample and the graphic code standard image sample.
8. A graphic code recognition device, comprising:
the model acquisition module is used for acquiring the graphic code extraction model constructed according to the method of any one of claims 1 to 4;
the image input module is used for inputting the graphic code image to be identified to the graphic code extraction model;
the rough positioning module is used for obtaining a graphic code candidate area in the graphic code image to be identified according to a graphic code identification result output by the graphic code extraction model aiming at the graphic code image to be identified;
and the fine positioning module is used for performing graphic code edge fitting processing on the graphic code candidate area and determining the graphic code area in the graphic code image to be identified.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202110785353.7A 2021-07-12 2021-07-12 Graphic code extraction model construction method, identification device, equipment and medium Active CN113468906B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110785353.7A CN113468906B (en) 2021-07-12 2021-07-12 Graphic code extraction model construction method, identification device, equipment and medium
PCT/CN2022/104857 WO2023284670A1 (en) 2021-07-12 2022-07-11 Construction method and apparatus for graphic code extraction model, identification method and apparatus, and device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110785353.7A CN113468906B (en) 2021-07-12 2021-07-12 Graphic code extraction model construction method, identification device, equipment and medium

Publications (2)

Publication Number Publication Date
CN113468906A true CN113468906A (en) 2021-10-01
CN113468906B CN113468906B (en) 2024-03-26

Family

ID=77879841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110785353.7A Active CN113468906B (en) 2021-07-12 2021-07-12 Graphic code extraction model construction method, identification device, equipment and medium

Country Status (2)

Country Link
CN (1) CN113468906B (en)
WO (1) WO2023284670A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023284670A1 (en) * 2021-07-12 2023-01-19 深圳思谋信息科技有限公司 Construction method and apparatus for graphic code extraction model, identification method and apparatus, and device and medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190130218A1 (en) * 2017-11-01 2019-05-02 Salesforce.Com, Inc. Training a neural network using augmented training datasets
CN109815765A (en) * 2019-01-21 2019-05-28 东南大学 A kind of method and device for extracting the business license information containing two dimensional code
CN110490193A (en) * 2019-07-24 2019-11-22 西安网算数据科技有限公司 Single Text RegionDetection method and ticket contents recognition methods
CN110619330A (en) * 2019-09-18 2019-12-27 上海眼控科技股份有限公司 Recognition model training method and device, computer equipment and recognition method
WO2020037960A1 (en) * 2018-08-21 2020-02-27 深圳大学 Sar target recognition method and apparatus, computer device, and storage medium
CN112016630A (en) * 2020-09-03 2020-12-01 平安科技(深圳)有限公司 Training method, device and equipment based on image classification model and storage medium
US20200394376A1 (en) * 2018-08-16 2020-12-17 Tencent Technology (Shenzhen) Company Limited Method, apparatus, and storage medium for identifying identification code
CN112232349A (en) * 2020-09-23 2021-01-15 成都佳华物链云科技有限公司 Model training method, image segmentation method and device
CN112990205A (en) * 2021-05-11 2021-06-18 创新奇智(北京)科技有限公司 Method and device for generating handwritten character sample, electronic equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103955663B (en) * 2014-04-22 2017-02-01 广州宽度信息技术有限公司 QR code fouling resistance identification method
CN109344904B (en) * 2018-10-16 2020-10-30 杭州睿琪软件有限公司 Method, system and storage medium for generating training samples
CN109858488B (en) * 2018-12-28 2021-09-17 众安信息技术服务有限公司 Handwritten sample recognition method and system based on sample enhancement
CN110070130A (en) * 2019-04-23 2019-07-30 杭州智趣智能信息技术有限公司 A kind of certificate information recognition methods, transposition, equipment and medium
CN111275080B (en) * 2020-01-14 2021-01-08 腾讯科技(深圳)有限公司 Artificial intelligence-based image classification model training method, classification method and device
CN113468906B (en) * 2021-07-12 2024-03-26 深圳思谋信息科技有限公司 Graphic code extraction model construction method, identification device, equipment and medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190130218A1 (en) * 2017-11-01 2019-05-02 Salesforce.Com, Inc. Training a neural network using augmented training datasets
US20200394376A1 (en) * 2018-08-16 2020-12-17 Tencent Technology (Shenzhen) Company Limited Method, apparatus, and storage medium for identifying identification code
WO2020037960A1 (en) * 2018-08-21 2020-02-27 深圳大学 Sar target recognition method and apparatus, computer device, and storage medium
CN109815765A (en) * 2019-01-21 2019-05-28 东南大学 A kind of method and device for extracting the business license information containing two dimensional code
CN110490193A (en) * 2019-07-24 2019-11-22 西安网算数据科技有限公司 Single Text RegionDetection method and ticket contents recognition methods
CN110619330A (en) * 2019-09-18 2019-12-27 上海眼控科技股份有限公司 Recognition model training method and device, computer equipment and recognition method
CN112016630A (en) * 2020-09-03 2020-12-01 平安科技(深圳)有限公司 Training method, device and equipment based on image classification model and storage medium
CN112232349A (en) * 2020-09-23 2021-01-15 成都佳华物链云科技有限公司 Model training method, image segmentation method and device
CN112990205A (en) * 2021-05-11 2021-06-18 创新奇智(北京)科技有限公司 Method and device for generating handwritten character sample, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023284670A1 (en) * 2021-07-12 2023-01-19 深圳思谋信息科技有限公司 Construction method and apparatus for graphic code extraction model, identification method and apparatus, and device and medium

Also Published As

Publication number Publication date
WO2023284670A1 (en) 2023-01-19
CN113468906B (en) 2024-03-26

Similar Documents

Publication Publication Date Title
CN112580623B (en) Image generation method, model training method, related device and electronic equipment
CN110738207A (en) character detection method for fusing character area edge information in character image
CN111615702B (en) Method, device and equipment for extracting structured data from image
CN111027563A (en) Text detection method, device and recognition system
CN109343920B (en) Image processing method and device, equipment and storage medium thereof
CN110866529A (en) Character recognition method, character recognition device, electronic equipment and storage medium
CN112183296B (en) Simulated bill image generation and bill image recognition method and device
US20150228259A1 (en) Method and apparatus for recognising music symbols
CN114694038A (en) High-resolution remote sensing image classification method and system based on deep learning
CN110163864B (en) Image segmentation method and device, computer equipment and storage medium
CN110610180A (en) Method, device and equipment for generating recognition set of wrongly-recognized words and storage medium
CN109165654B (en) Training method of target positioning model and target positioning method and device
CN112101386B (en) Text detection method, device, computer equipment and storage medium
CN110414523A (en) A kind of identity card recognition method, device, equipment and storage medium
CN114495102A (en) Text recognition method, and training method and device of text recognition network
CN110414622B (en) Classifier training method and device based on semi-supervised learning
JP7320570B2 (en) Method, apparatus, apparatus, medium and program for processing images
CN113468906B (en) Graphic code extraction model construction method, identification device, equipment and medium
CN111652181B (en) Target tracking method and device and electronic equipment
CN113537187A (en) Text recognition method and device, electronic equipment and readable storage medium
CN115908363B (en) Tumor cell statistics method, device, equipment and storage medium
CN112840622B (en) Pushing method and related product
CN111539390A (en) Small target image identification method, equipment and system based on Yolov3
CN117115824A (en) Visual text detection method based on stroke region segmentation strategy
CN113128496B (en) Method, device and equipment for extracting structured data from image

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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Wu Tayang

Inventor after: Zhang Yuechen

Inventor after: Mo Yu

Inventor after: Shen Xiaoyong

Inventor after: Lv Jiangbo

Inventor before: Wu Tayang

Inventor before: Zhang Yuechen

Inventor before: Mo Yu

Inventor before: Jia Jiaya

Inventor before: Shen Xiaoyong

Inventor before: Lv Jiangbo

GR01 Patent grant
GR01 Patent grant