CN113468906B - Graphic code extraction model construction method, identification device, equipment and medium - Google Patents

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

Info

Publication number
CN113468906B
CN113468906B CN202110785353.7A CN202110785353A CN113468906B CN 113468906 B CN113468906 B CN 113468906B CN 202110785353 A CN202110785353 A CN 202110785353A CN 113468906 B CN113468906 B CN 113468906B
Authority
CN
China
Prior art keywords
graphic code
sample
image 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.)
Active
Application number
CN202110785353.7A
Other languages
Chinese (zh)
Other versions
CN113468906A (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Toxicology (AREA)
  • General Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Analysis (AREA)

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 device, computer equipment and a storage medium. The method and the device can construct and obtain the graphic code extraction model which is suitable for various application scenes so as to improve the accuracy of identifying 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 fusion of the graphic code standard image sample and the material background image sample, and 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.

Description

Graphic code extraction model construction method, identification device, equipment and medium
Technical Field
The present disclosure relates to the field of artificial intelligence, and in particular, to a method for constructing a graphic code extraction model, a graphic code identification method, a device, a computer device, 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, when the neural network model for graphic code extraction in the prior art is constructed or trained, due to factors of low complexity, limited quantity and the like of the adopted training samples, the model obtained by training is difficult to adapt to changeable and various application scenes where the graphic codes are located in actual application, so that the recognition accuracy of the model obtained by training in the mode on the graphic codes in the actual application scenes is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method of constructing a pattern code extraction model, a pattern code recognition method, apparatus, computer device, and storage medium.
A method of constructing a graphic code extraction model, the method comprising:
obtaining an original image sample of a graphic code and a background image sample of a material;
obtaining a corresponding graphic code standard image sample according to the graphic code original image sample;
obtaining an augmented image sample based on 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 of identifying a graphic code, the method comprising:
obtaining 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 region in the graphic code image to be identified according to the graphic code identification result output by the graphic code extraction model aiming at the graphic code image to be identified;
and carrying out graphic code edge fitting processing on the graphic code candidate areas, and determining the graphic code areas in the graphic code images 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 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 using the augmented image sample, the graphic code original image sample and the graphic code standard image sample.
A graphic code recognition apparatus comprising:
the model acquisition module is used for acquiring a graphic code extraction model constructed according to the method;
the image input module is used for inputting the graphic code image to be identified into the graphic code extraction model;
the coarse positioning module is used for obtaining a graphic code candidate region in the graphic code image to be identified according to the 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 carrying out graphic code edge fitting processing on the graphic code candidate areas and determining the graphic code areas in the graphic code images to be identified.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
obtaining an original image sample of a graphic code and a background image sample of a material; obtaining a corresponding graphic code standard image sample according to the graphic code original image sample; obtaining an augmented image sample based on 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 storing a computer program and a processor which when executing the computer program performs the steps of:
obtaining 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 region in the graphic code image to be identified according to the graphic code identification result output by the graphic code extraction model aiming at the graphic code image to be identified; and carrying out graphic code edge fitting processing on the graphic code candidate areas, and determining the graphic code areas in the graphic code images to be identified.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
obtaining an original image sample of a graphic code and a background image sample of a material; obtaining a corresponding graphic code standard image sample according to the graphic code original image sample; obtaining an augmented image sample based on 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 having stored thereon a computer program which when executed by a processor performs the steps of:
obtaining 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 region in the graphic code image to be identified according to the graphic code identification result output by the graphic code extraction model aiming at the graphic code image to be identified; and carrying out graphic code edge fitting processing on the graphic code candidate areas, and determining the graphic code areas in the graphic code images to be identified.
The method, the device, the computer equipment and the storage medium are used for acquiring the graphic code original image sample and the material background image sample, obtaining the corresponding graphic code standard image sample according to the graphic code original image sample, obtaining the augmented image sample based on 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, standard graphic codes and various material backgrounds can be fused in a model training stage to form the augmented image samples with various material backgrounds, the original image samples of the graphic codes and the standard image samples of the graphic codes are used as model training data for model training, a graphic code extraction model suitable for various application scenes can be constructed and obtained, and the accuracy of the model in identifying the graphic codes is improved.
Drawings
FIG. 1 is a flow diagram of a method of constructing a graphic code extraction model in one embodiment;
FIG. 2 is a flow chart of a method for identifying a graphic code according to one embodiment;
FIG. 3 is a block diagram of an apparatus for constructing a graphic code extraction model in one embodiment;
FIG. 4 is a block diagram of a graphic code recognition apparatus in one embodiment;
FIG. 5 is an internal block diagram of a computer device in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The following section first describes the method for constructing the graphic code extraction model provided in the present application, and then describes the graphic code recognition method provided in the present application. The method for constructing the graphic code extraction model can be mainly executed by a server, and the server can be realized by an independent server or a server cluster formed by a plurality of servers; the graphic code recognition 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, a method of constructing a graphic code extraction model is provided, which may include the steps of:
step S101, obtaining a graphic code original image sample and a material background image sample;
the description of related features such as images in the model construction stage is uniformly described in a mode such as image samples, so that the description is distinguished from the model application, namely the graphic code recognition stage. In this step, the original image sample of the graphic code and the background image sample of the material may be obtained by data collection and web crawler technology, where the original image sample of the graphic code is an image containing graphic codes such as two-dimensional codes, and the background image sample of the material is a background image containing multiple materials, and the materials may include various materials that may be used for printing the graphic code, such as various colors of paper, various types of wood 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 the application scenario 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 step mainly generates a graphic code standard image sample corresponding to the graphic code standard image sample according to the graphic code information contained in the graphic code original image sample, that is, performs certain conversion on the original image sample on the basis of basically retaining the original graphic code information to form a new graphic code image for subsequent fusion processing, wherein the new graphic code image is called a graphic code standard image sample, and the conversion can be used for, for example, changing the position, direction or 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 an initial sample of a graphic code standard image according to graphic code information carried by an original graphic code sample of the graphic code; and carrying out 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 embodiment mainly generates a corresponding initial sample of the graphic code standard image according to graphic code information carried by an original image sample of the graphic code, specifically, the graphic code information (text information) carried by the original image sample of the graphic code can be extracted first, then the text information is changed into standard graphic code picture information through a code system of the graphic code such as a two-dimensional code, and then a quadrilateral area is set for affine transformation, so that the initial sample of the graphic code standard image can be obtained. On the basis, in order to enrich the morphology of the graphic code so as to enable the model to adapt to more various and changeable application scenes, the graphic code points of the initial sample of the graphic code standard image are subjected to morphological transformation processing to obtain the graphic code standard image sample, 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, corrosion, random noise, etc.) on the shape of the graphic code point in the graphic code standard image initial sample, so as to obtain the graphic code standard image sample.
Step S103, obtaining an augmented image sample based on fusion of a graphic code standard image sample and a 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 texture background image samples may be plural, and for this purpose, in one embodiment, step S103 may include:
carrying out contrast preservation fusion on the standard image sample of the graphic code and the background image samples of a plurality of materials to obtain an initial sample of the enhanced image; and screening the initial sample of the enhanced image according to the semantic distance between the initial sample of the enhanced image and the initial sample of the graphic code to obtain the sample of the enhanced image.
The contrast preserving fusion (histocompatibility fusion) is an algorithm for carrying out contrast preserving fusion on two pictures by calculating the color distribution of the pictures. In this embodiment, the contrast preserving and fusing of the standard image sample of the graphic code and the background image samples of the plurality of materials may include the contrast preserving and fusing of the standard image sample of the graphic code and each background image sample of the plurality of materials respectively, and may further include the contrast preserving and fusing of the standard image sample of the graphic code and two or more background image samples of the plurality of materials respectively, so as to obtain the initial sample of the enhanced image in a rich sample form, and the number of the initial samples of the enhanced image is also a plurality of. Then, the image sample as the augmented image sample that meets the condition needs to be screened from the initial sample of the augmented image, the embodiment can screen according to the semantic distance (D (i_aug) -D (i_dm)) between the initial sample of the augmented image (i_aug) and the initial sample of the image (i_dm) of the graphic code, and if the semantic distance is lower than or equal to the semantic distance threshold, the initial sample of the augmented image can be screened as the sample of the augmented image.
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, a decoder can be composed through a skip-connection between layers using the image net 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 model training, and the graphic code extraction model is constructed by using the input data and the label data. The graphic code standard image sample is mainly a graphic code standard image sample generated according to graphic code information carried by the graphic code original image sample, and in the above part of embodiments or referred to as a graphic code standard image initial sample, i.e. a graphic code standard image sample without morphological transformation.
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 obtaining 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; carrying out 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, the augmented image sample and the original image sample of the graphic code as input data of the model training are input into the 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 original image sample of the graphic code, the standard image sample of the graphic code as the label data of the model training is subjected to loss function calculation with the graphic code extraction result sample to obtain a loss calculation result or a loss function calculation result, and then the loss calculation result can be used for adjusting the 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 and obtain the graphic code extraction model. In a specific application, after the augmented image sample and the 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 line loss function in a graphic code standard image sample can be calculated, a loss weight is added to a graphic code dead zone (quick zone) part, and the graphic code extraction model is constructed after a certain iteration.
According to the method for constructing the graphic code extraction model, the graphic code original image sample and the material background image sample are obtained, then the corresponding graphic code standard image sample is obtained according to the graphic code original image sample, then the enhanced image sample is obtained based on fusion of the graphic code standard image sample and the material background image sample, and the graphic code extraction model is constructed by utilizing the enhanced image sample, the graphic code original image sample and the graphic code standard image sample. According to the scheme, standard graphic codes and various material backgrounds can be fused in a model training stage to form the augmented image samples with various material backgrounds, the original image samples of the graphic codes and the standard image samples of the graphic codes are used as model training data for model training, a graphic code extraction model suitable for various application scenes can be constructed and obtained, and the accuracy of the model in identifying the graphic codes is improved.
In one embodiment, as shown in fig. 2, a method for identifying a graphic code is provided, which may include the steps of:
step S201, obtaining a graphic code extraction model constructed according to the method described in the embodiment;
step S202, inputting a graphic code image to be identified into a graphic code extraction model;
in this step, after the graphic code image to be identified is obtained, the graphic code image to be identified may be scaled to a set scale space, or a series of basic preprocessing operations such as graying, sharpening, denoising may be performed, and then input into the graphic code extraction model.
Step S203, a graphic code candidate region in the graphic code image to be identified is obtained according to the graphic code identification result output by the graphic code extraction model aiming at the graphic code image to be identified;
the method mainly comprises the step of coarsely positioning the region where the graphic code in the graphic code image to be identified is located by the graphic code extraction model. After the graphic code image to be identified is input into the graphic code extraction model, the graphic code extraction model outputs a corresponding graphic code identification result, so that a graphic code candidate region in the graphic code image to be identified is obtained according to the graphic code identification result, namely, a region where the graphic code located on the graphic code image to be identified by the graphic code extraction model is used as the graphic code candidate region.
Step S204, performing graphic code edge fitting processing on the graphic code candidate areas to determine the graphic code areas in the graphic code images to be identified.
The method comprises the step of performing edge fitting processing on the candidate region of the graphic code on the basis of rough positioning of a graphic code extraction model so as to accurately position the graphic code region in the 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 graphic code candidate region to obtain an outer layer edge point set; performing robust regression fit on the outer layer edge point set to obtain a graph code region edge fitting result in a graph code image to be identified; and determining the graphic code region in the graphic code image to be identified according to the graphic code region edge fitting result.
The method mainly comprises the steps of extracting at least one layer of outer layer edge points from a graphic code candidate region roughly positioned by a graphic code extraction model to form an outer layer edge point set, then carrying out robust regression fitting processing on the outer layer edge point set, determining the edge of the graphic code region according to the result of the edge fitting of the graphic code region, and accurately positioning the graphic code region in a graphic code image to be identified according to the edge. The robust regression fit refers to a statistical robust regression theory, such as Theil-Sen estimation, for example, to complete the fit of edges of the graphic code region. In a specific application, for the extraction of outer edge points, an edge extraction algorithm such as a canny operator can be applied to extract edge points of a candidate region of the graphic code, and edge points (corresponding to outer edge points) of a layer are extracted from the outer side of the region into the region to serve as an outer edge point set for fitting the boundary of the graphic code region, then the outer edge point set can be estimated by using Theil-Sen to perform fitting to obtain an edge fitting result of the graphic code region, the graphic code region in the graphic code image to be identified is positioned according to the edge fitting result, and image data corresponding to the graphic code region can be output to a graphic code decoding module after the graphic code region is positioned to finish decoding processing.
According to the graphic code identification method, the edge extraction and robust regression statistical method is used on the basis of the rough positioning of the model to realize the high-precision optimization of the rough positioning of the graphic code candidate region, the graphic code identification accuracy is improved, the method can adapt to continuously changing application scenes, has stronger robustness, and is beneficial to improving the readability and decoding rate of graphic codes such as two-dimensional codes (QR, DM codes) and the like.
It should be understood that, although the steps in the flowcharts are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps in the flowcharts above may include a plurality of steps or stages that are not necessarily performed at the same time, but may be performed at different times, and the order of execution of the steps or stages is not necessarily sequential, but may be performed in rotation or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in FIG. 3, an apparatus for constructing a graphic code extraction model is provided, the apparatus 300 may include:
the sample acquisition module 301 is configured to acquire 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;
the sample fusion module 303 is configured to obtain an augmented image sample based on fusion of the graphic code standard image sample and the material background image sample;
the model construction module 304 is configured to construct a graphics code extraction model using the augmented image sample and the graphics code original image sample and the graphics code standard image sample.
In one embodiment, the sample generating module 302 is configured to generate a graphic code standard image initial sample according to graphic code information carried by the graphic code original image sample; performing morphological transformation on the graphic code points of the graphic code standard image initial sample to obtain the graphic code standard image sample; the morphological transformation process includes at least one of swelling, erosion, or random noise.
In one embodiment, the number of the texture background image samples is a plurality; the sample fusion module 303 is configured to perform contrast preserving fusion on the graphic code standard image sample and a plurality of material background image samples, so as to obtain an amplified image initial sample; and screening the initial sample of the enhanced image according to the semantic distance between the initial sample of the enhanced image and the original image sample of the graphic code to obtain the sample of the enhanced image.
In one embodiment, the model building module 304 is configured to input the augmented image sample and the graphic code original image sample into a graphic code extraction model to be trained, and obtain a graphic code extraction result sample output by the graphic code extraction model to be trained for 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 one embodiment, as shown in fig. 4, a graphic code recognition apparatus is provided, and the apparatus 400 may include:
a model acquisition module 401 for acquiring a graphic code extraction model constructed according to the method described above;
an image input module 402, configured to input a graphic code image to be identified into the graphic code extraction model;
the coarse positioning module 403 is configured to obtain a candidate region of the graphic code in the graphic code image to be identified according to the graphic code recognition result output by the graphic code extraction model for the graphic code image to be identified;
and the fine positioning module 404 is configured to perform a graphic code edge fitting process on the graphic code candidate region, and determine a graphic code region in the graphic code image to be identified.
In one embodiment, the fine positioning module 404 is configured to extract at least one layer of outer edge points of the candidate region of the graphic code to obtain a set of outer edge points; performing robust regression fit on the outer layer edge point set to obtain a graphic code region edge fit result in the graphic code image to be identified; and determining the graphic code region in the graphic code image to be identified according to the graphic code region edge fitting result.
The specific limitations of the device for constructing the graphic code extraction model and the graphic code recognition device can be referred to as the limitations of the method for constructing the graphic code extraction model and the graphic code recognition method, respectively, and are not repeated herein. The above-described means for constructing a graphic code extraction model and the respective modules in the graphic code recognition means may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above 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 includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is 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 graphic code extraction model.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which 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 includes a non-volatile 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 the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode 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 method of identifying a graphic code. 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, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the structures shown in fig. 5 and 6 are block diagrams of only portions of structures that are relevant to the present application and are not intended to limit the computer device on which the present application may be implemented, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile memory may include Read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, or the like. Volatile memory can include Random access memory (Random AccessMemory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can take many forms, such as static random access memory (StaticRandomAccessMemory, SRAM) or dynamic random access memory (DynamicRandomAccessMemory, DRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (9)

1. A method of constructing a pattern code extraction model, the method comprising:
obtaining an original image sample of a graphic code and a background image sample of a material;
generating an initial sample of a graphic code standard image according to graphic code information carried by the graphic code original image sample; performing morphological transformation on the graphic code points of the graphic code standard image initial sample to obtain a graphic code standard image sample; the morphological transformation processing comprises at least one of expansion, corrosion or random noise;
obtaining an augmented image sample based on 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 of claim 1, wherein the number of texture background image samples is a plurality; the fusing of the standard image sample based on the graphic code and the background image sample based on the material to obtain an augmented image sample comprises the following steps:
performing contrast preservation fusion on the graphic code standard image sample and a plurality of material background image samples to obtain an initial sample of the augmented image;
and screening the initial sample of the enhanced image according to the semantic distance between the initial sample of the enhanced image and the original image sample of the graphic code to obtain the sample of the enhanced image.
3. The method according to any one of claims 1 to 2, wherein constructing a graphics code extraction model using the augmented image samples and graphics code raw image samples and the graphics code standard image samples comprises:
inputting the augmented image sample and the graphic code original image sample into a graphic code extraction model to be trained, and obtaining 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.
4. A method of identifying a graphic code, the method comprising:
obtaining a graphic code extraction model constructed according to the method of any one of claims 1 to 3;
inputting a graphic code image to be identified into the graphic code extraction model;
obtaining a graphic code candidate region in the graphic code image to be identified according to the graphic code identification result output by the graphic code extraction model aiming at the graphic code image to be identified;
and carrying out graphic code edge fitting processing on the graphic code candidate areas, and determining the graphic code areas in the graphic code images to be identified.
5. The method of claim 4, wherein said performing a graphics code edge fitting process on said graphics code candidate region to determine a graphics code region in said graphics code image to be identified comprises:
extracting at least one layer of outer layer edge points of the graphic code candidate region to obtain an outer layer edge point set;
performing robust regression fit on the outer layer edge point set to obtain a graphic code region edge fit result in the graphic code image to be identified;
and determining the graphic code region in the graphic code image to be identified according to the graphic code region edge fitting result.
6. 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 generating an initial sample of the graphic code standard image according to the graphic code information carried by the graphic code original image sample; performing morphological transformation on the graphic code points of the graphic code standard image initial sample to obtain a graphic code standard image sample; the morphological transformation processing comprises at least one of expansion, corrosion or random noise;
the sample fusion module is used for obtaining 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 is used for 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.
7. A graphic code recognition apparatus, comprising:
a model acquisition module for acquiring a graphic code extraction model constructed according to the method of any one of claims 1 to 3;
the image input module is used for inputting the graphic code image to be identified into the graphic code extraction model;
the coarse positioning module is used for obtaining a graphic code candidate region in the graphic code image to be identified according to the 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 carrying out graphic code edge fitting processing on the graphic code candidate areas and determining the graphic code areas in the graphic code images to be identified.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 5.
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 CN113468906A (en) 2021-10-01
CN113468906B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468906B (en) * 2021-07-12 2024-03-26 深圳思谋信息科技有限公司 Graphic code extraction model construction method, identification device, equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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 (8)

* 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
US10346721B2 (en) * 2017-11-01 2019-07-09 Salesforce.Com, Inc. Training a neural network using augmented training datasets
CN109325491B (en) * 2018-08-16 2023-01-03 腾讯科技(深圳)有限公司 Identification code identification method and device, computer equipment and storage medium
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 (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN113468906A (en) 2021-10-01
WO2023284670A1 (en) 2023-01-19

Similar Documents

Publication Publication Date Title
CN110738207B (en) Character detection method for fusing character area edge information in character image
CN109117848B (en) Text line character recognition method, device, medium and electronic equipment
WO2022001623A1 (en) Image processing method and apparatus based on artificial intelligence, and device and storage medium
Goodfellow et al. Multi-digit number recognition from street view imagery using deep convolutional neural networks
CN112396613B (en) Image segmentation method, device, computer equipment and storage medium
CN110866529B (en) Character recognition method, device, electronic equipment and storage medium
CN109343920B (en) Image processing method and device, equipment and storage medium thereof
CN114596566B (en) Text recognition method and related device
CN112183296B (en) Simulated bill image generation and bill image recognition method and device
CN112101386B (en) Text detection method, device, computer equipment and storage medium
CN115908363B (en) Tumor cell statistics method, device, equipment and storage medium
CN109165654B (en) Training method of target positioning model and target positioning method and device
CN112464798A (en) Text recognition method and device, electronic equipment and storage medium
CN110399760A (en) A kind of batch two dimensional code localization method, device, electronic equipment and storage medium
CN114170558B (en) Method, system, apparatus, medium, and article for video processing
CN116051575A (en) Image segmentation method, apparatus, computer device, and storage medium program product
CN113468906B (en) Graphic code extraction model construction method, identification device, equipment and medium
CN113537187A (en) Text recognition method and device, electronic equipment and readable storage medium
CN112839185A (en) Method, apparatus, device and medium for processing image
CN113554549B (en) Text image generation method, device, computer equipment and storage medium
CN114399782A (en) Text image processing method, device, equipment, storage medium and program product
CN113569608A (en) Text recognition method, device and equipment based on deep learning and storage medium
CN113128496A (en) Method, device and equipment for extracting structured data from image
CN118379586B (en) Training method, device, equipment, medium and product of key point prediction model
CN116612474B (en) Object detection method, device, computer equipment and computer readable storage medium

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

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

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant