CN113869077B - Bar code identification method and device and electronic equipment - Google Patents
Bar code identification method and device and electronic equipment Download PDFInfo
- Publication number
- CN113869077B CN113869077B CN202111150180.8A CN202111150180A CN113869077B CN 113869077 B CN113869077 B CN 113869077B CN 202111150180 A CN202111150180 A CN 202111150180A CN 113869077 B CN113869077 B CN 113869077B
- Authority
- CN
- China
- Prior art keywords
- target
- code
- bar code
- bar
- sample
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 68
- 238000012549 training Methods 0.000 claims abstract description 95
- 238000012545 processing Methods 0.000 claims description 63
- 238000010606 normalization Methods 0.000 claims description 23
- 238000004891 communication Methods 0.000 claims description 19
- 238000006073 displacement reaction Methods 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 11
- 239000003623 enhancer Substances 0.000 claims description 3
- 238000013527 convolutional neural network Methods 0.000 description 13
- 238000010586 diagram Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 10
- 238000013135 deep learning Methods 0.000 description 6
- 230000009467 reduction Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 230000003321 amplification Effects 0.000 description 2
- 238000003199 nucleic acid amplification method Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000003066 decision tree Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 238000011478 gradient descent method Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000035800 maturation Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000012706 support-vector machine Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods 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/1404—Methods for optical code recognition
- G06K7/1408—Methods for optical code recognition the method being specifically adapted for the type of code
- G06K7/1413—1D bar codes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods 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/1404—Methods for optical code recognition
- G06K7/146—Methods for optical code recognition the method including quality enhancement steps
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Electromagnetism (AREA)
- General Health & Medical Sciences (AREA)
- Toxicology (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The embodiment of the invention provides a bar code recognition method, a bar code recognition device and electronic equipment, and relates to the technical field of character recognition. The method comprises the following steps: acquiring a target bar code to be identified; inputting the target bar code into the recognition model, and obtaining a target bar space width ratio sequence of the target bar code output by the recognition model; the identification model is obtained based on a plurality of sample bar codes and labels of each sample bar code in a training mode, and the labels of each sample bar code comprise: a sample bar space-width ratio sequence of the sample bar code; determining a target code system category of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence; decoding the target bar code by using the target bar space-width ratio sequence, the target code system category and the preset code table to obtain a recognition result of the target bar code; the preset code table comprises corresponding relations of code system types, bar space combinations and characters. Compared with the prior art, the scheme provided by the embodiment of the invention can improve the flexibility of bar code identification.
Description
Technical Field
The present invention relates to the field of character recognition technologies, and in particular, to a barcode recognition method, a barcode recognition device, and an electronic device.
Background
The bar code, also called bar code (Barcode), is a graphic identifier for expressing a set of information by arranging a plurality of black bars and blanks with different widths according to a certain coding rule. The bar code can represent information such as numbers, symbols, letters and the like, and is widely applied to industries such as commodity circulation, book management, medical treatment and the like.
With the gradual maturation and development of deep learning, the barcode is identified, and when information marked by the barcode is obtained, a barcode identification method based on the deep learning is widely applied.
In the related art, decoding can be generally implemented using RNN (Recurrent Neural Network ) or CNN (Convolutional Neural Network, convolutional neural network). When the bar code is identified, the RNN or CNN can be utilized to directly output the characters corresponding to the bar space combination in the bar code, so that a simpler bar code identification method is provided.
However, in the related art described above, since the network obtained by training can usually identify only the combinations of spaces existing in the training sample in deep learning, the RNN or CNN obtained by training can only identify the combinations of spaces existing in the code system type of a certain barcode used for training. The code system type refers to: the types of the coding rules of the bar codes and different code system types represent the coding rules of different bar codes.
Based on this, when there is a barcode encoded by a new code system type, the space-space combination of the new code system type needs to be added to the training sample to retrain the RNN or the CNN, however, because the number of space-space combinations of each code system is larger, the retrain workload of the RNN or the CNN is larger, which takes more time, and further affects the flexibility of barcode recognition.
Disclosure of Invention
The embodiment of the invention aims to provide a bar code identification method, a device and electronic equipment, so as to improve the flexibility of bar code identification. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a barcode identification method, where the method includes:
acquiring a target bar code to be identified;
Inputting the target bar code into a preset recognition model, and acquiring a target bar space width ratio sequence of the target bar code output by the recognition model; the identification model is trained based on a plurality of sample bar codes and labels of each sample bar code, and the labels of each sample bar code comprise: a sample bar space-width ratio sequence of the sample bar code;
Determining a target code system category of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence;
Decoding the target bar code by using the target bar space-width ratio sequence, the target code system category and a preset code table to obtain a recognition result of the target bar code; the preset code table comprises corresponding relations of code system types, bar space combinations and characters.
Optionally, in a specific implementation manner, the step of decoding the target barcode by using the target barcode space-to-width ratio sequence, the target code system category and the preset code table to obtain the identification result of the target barcode includes:
determining a to-be-identified bar-space width ratio sequence of each target bar-space combination in the target bar code from the target bar-space width ratio sequence according to a division rule of the bar-space combination corresponding to the target code system type;
Determining target characters corresponding to each to-be-identified strip-space width ratio sequence from the corresponding relation between the strip-space width ratio sequence of the strip-space combination under the target code system category and the characters in a preset code table;
And arranging each target character according to the arrangement sequence of the corresponding to-be-identified bar space width ratio sequence in the target bar space width ratio sequence to obtain the identification result of the target bar code.
Optionally, in a specific implementation manner, the label of each sample barcode further includes: the number of sample code words of the sample bar code; wherein, the number of code words of each sample is: the sample bar code includes a number of bar spaces;
the step of inputting the target bar code into a preset recognition model and obtaining a target bar space width ratio sequence of the target bar code output by the recognition model comprises the following steps:
Inputting the target bar code into a preset recognition model, and obtaining a target bar space-width ratio sequence and the number of target code words of the target bar code output by the recognition model;
before the step of determining the target codebook class of the target barcode according to the start value and the end value in the target bar space-width ratio sequence, the method further comprises:
judging whether the number of the numerical values included in the target strip space width ratio sequence is the same as the number of the target code words;
If the target bar space width ratio sequence is the same, executing the step of determining the target code system category of the target bar according to the initial value and the termination value in the target bar space width ratio sequence;
otherwise, determining that the recognition result of the recognition model on the target bar code is an error result.
Optionally, in a specific implementation manner, the label of each sample barcode further includes: sample barcode type of the sample barcode; the sample bar code type of each sample bar code is any one of a plurality of preset bar code types, and the plurality of bar code types at least comprise: normal code, pleat code and cut-off code;
the step of inputting the target bar code into a preset recognition model and obtaining a target bar space width ratio sequence of the target bar code output by the recognition model comprises the following steps:
Inputting the target bar code into a preset recognition model, and acquiring a target bar space-width ratio sequence and a target bar code type of the target bar code output by the recognition model;
The step of determining the target code system category of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence comprises the following steps:
If the target bar code type of the target bar code is a normal code or a crease code, determining a target code system type of the target bar code according to a starting value and a stopping value in the target bar space-width ratio sequence;
The method further comprises the steps of:
If the target bar code type of the target bar code is a cut-off code, determining that the identification result of the target bar code cannot be obtained.
Optionally, in a specific implementation manner, the training manner of the identification model includes:
randomly generating a plurality of sample bar codes according to a preset bar space width ratio range, and determining the label of each sample bar code;
Normalizing each sample bar code to obtain normalized sample bar codes; the size of each normalized sample bar code is a preset size;
Carrying out image enhancement processing on each normalized sample bar code to obtain each sample bar code after enhancement processing; wherein the image enhancement processing includes: at least one of brightness adjustment, contrast adjustment, rotation, and displacement;
Training a preset initial model by utilizing each sample bar code subjected to image enhancement processing and the label of each sample bar code;
The step of obtaining the target bar code to be identified comprises the following steps:
acquiring an initial bar code to be identified, and carrying out normalization processing on the initial bar code to obtain a target bar code; wherein the size of the target bar code is the preset size
In a second aspect, an embodiment of the present invention provides a barcode recognition apparatus, the apparatus including:
The target bar code acquisition module is used for acquiring a target bar code to be identified;
The output result acquisition module is used for inputting the target bar code into a preset recognition model and acquiring a target bar space width ratio sequence of the target bar code output by the recognition model; the identification model is trained based on a plurality of sample bar codes and labels of each sample bar code, and the labels of each sample bar code comprise: a sample bar space-width ratio sequence of the sample bar code;
the code system type determining module is used for determining the target code system type of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence;
the decoding module is used for decoding the target bar code by utilizing the target bar space width ratio sequence, the target code system category and a preset code table to obtain a recognition result of the target bar code; the preset code table comprises corresponding relations of code system types, bar space combinations and characters.
Optionally, in a specific implementation manner, the decoding module is specifically configured to:
determining a to-be-identified bar-space width ratio sequence of each target bar-space combination in the target bar code from the target bar-space width ratio sequence according to a division rule of the bar-space combination corresponding to the target code system type;
Determining target characters corresponding to each to-be-identified strip-space width ratio sequence from the corresponding relation between the strip-space width ratio sequence of the strip-space combination under the target code system category and the characters in a preset code table;
And arranging each target character according to the arrangement sequence of the corresponding to-be-identified bar space width ratio sequence in the target bar space width ratio sequence to obtain the identification result of the target bar code.
Optionally, in a specific implementation manner, the label of each sample barcode further includes: the number of sample code words of the sample bar code; wherein, the number of code words of each sample is: the sample bar code includes a number of bar spaces;
The output result obtaining module is specifically configured to: inputting the target bar code into a preset recognition model, and obtaining a target bar space-width ratio sequence and the number of target code words of the target bar code output by the recognition model;
the apparatus further comprises:
The numerical value judging module is used for judging whether the number of the numerical values included in the target bar space-width ratio sequence is the same as the number of the target code words before the target code system type of the target bar code is determined according to the initial numerical value and the termination numerical value in the target bar space-width ratio sequence; if the code system category determining modules are the same, triggering the code system category determining modules; otherwise, determining that the recognition result of the recognition model on the target bar code is an error result.
Optionally, in a specific implementation manner, the label of each sample barcode further includes: sample barcode type of the sample barcode; the sample bar code type of each sample bar code is any one of a plurality of preset bar code types, and the plurality of bar code types are as follows: normal code, pleat code and cut-off code;
The output result obtaining module is specifically configured to: inputting the target bar code into a preset recognition model, and acquiring a target bar space-width ratio sequence and a target bar code type of the target bar code output by the recognition model;
The code class determining module is specifically configured to: if the target bar code type of the target bar code is a normal code or a crease code, determining a target code system type of the target bar code according to a starting value and a stopping value in the target bar space-width ratio sequence;
the apparatus further comprises:
And the result determining module is used for determining that the identification result of the target bar code cannot be obtained if the type of the target bar code is a cut-off code.
Optionally, in a specific implementation manner, the apparatus further includes: a model training module for training the recognition model, the model training module comprising:
the sample acquisition sub-module is used for randomly generating a plurality of sample bar codes according to a preset bar space width ratio range and determining the label of each sample bar code;
The normalization processing sub-module is used for carrying out normalization processing on each sample bar code to obtain each normalized sample bar code; the size of each normalized sample bar code is a preset size;
The image enhancer module is used for carrying out image enhancement processing on each normalized sample bar code to obtain each enhanced sample bar code; wherein the image enhancement processing includes: at least one of brightness adjustment, contrast adjustment, rotation, and displacement;
the model training sub-module is used for training a preset initial model by utilizing each sample bar code subjected to image enhancement processing and the label of each sample bar code;
The target bar code acquisition module is specifically used for: acquiring an initial bar code to be identified, and carrying out normalization processing on the initial bar code to obtain a target bar code; the size of the target bar code is the preset size.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
A memory for storing a computer program;
and the processor is used for realizing the steps of any bar code identification method provided in the first aspect when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of any one of the barcode recognition methods provided in the first aspect.
In a fifth aspect, embodiments of the present invention provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of any of the barcode recognition methods provided in the first aspect above.
The embodiment of the invention has the beneficial effects that:
The above can be seen that, when the scheme provided by the embodiment of the invention is applied to training the recognition model for bar code recognition, the training samples applied are: each sample barcode and a sample bar space-to-width ratio sequence for that sample barcode. Under different code system types, a preset code table comprising corresponding relations of code system types, bar space combinations and characters can be constructed according to the coding rules.
Thus, when the target bar code is identified, the identification model can be utilized to obtain a target bar space width ratio sequence of the target bar code. Since the code system type of the bar code can be determined by the width ratio of the starting end and the ending end of the bar code, the target code system type of the target bar code can be determined by utilizing the starting value and the ending value in the target bar space width ratio sequence. Therefore, the target bar space-width ratio sequence, the target code system type and the preset code table can be utilized to decode the bar code, and the recognition result of the target bar code is obtained.
Based on the above, by applying the scheme provided by the embodiment of the invention, when the target bar code is identified, the obtained identification result is obtained through the target bar space-width ratio sequence of the target bar code and the preset code table, and when the identification model is trained, the training sample is: each sample bar code and the sample bar space width ratio sequence of the sample bar code do not need to take the bar space combination of each code system type as a sample, so that when a new code system type exists, the bar space combination of the new code system type does not need to be added into a training sample, the recognition model is retrained, and the preset code table is only required to be expanded by utilizing characters corresponding to each bar space combination under the new code system type. Therefore, the workload and time consumption for expanding the preset code table are far smaller than the workload and time consumption for retraining the identification model, so that the flexibility of bar code identification can be improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other embodiments may be obtained according to these drawings to those skilled in the art.
FIG. 1 is a diagram of a bar code identification method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a bar space ratio sequence of a bar code;
FIG. 3 is a flow chart of one implementation of S104 in FIG. 1;
FIG. 4 is a flowchart of a training method of an identification model according to an embodiment of the present invention;
FIG. 5 is a flowchart of another training method for an identification model according to an embodiment of the present invention;
FIG. 6 is a flowchart of another training method for an identification model according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of another method for identifying a bar code according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating another exemplary method for identifying a bar code according to an embodiment of the present invention;
FIG. 9 is a diagram of another method for identifying a bar code according to an embodiment of the present invention;
Fig. 10 is a schematic structural diagram of a bar code recognition device according to an embodiment of the present invention;
Fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
Fig. 12 is a schematic diagram of a training process for training an identification model according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by the person skilled in the art based on the present application are included in the scope of protection of the present application.
In the related art, decoding can be generally implemented using RNN or CNN. Since in deep learning, the trained network usually only recognizes the combinations of spaces present in the training samples, the trained RNN or CNN only recognizes the combinations of spaces present in the code system type of each barcode used for training. Based on this, when there is a barcode encoded by a new code system type, the space-space combination of the new code system type needs to be added to the training sample to retrain the RNN or the CNN, however, because the number of space-space combinations of each code system is larger, the retrain workload of the RNN or the CNN is larger, which takes more time, and further affects the flexibility of barcode recognition.
In order to solve the technical problems, the embodiment of the invention provides a bar code identification method.
The method can be applied to any application scene requiring bar code identification, such as commodity logistics, book management, postal management, and the like, but is not limited to the application scene. In addition, the method can be applied to various electronic devices such as mobile phones, tablet computers and gates, and the embodiment of the invention is not particularly limited. Hereinafter, the execution subject of the method is collectively referred to as an electronic device.
The embodiment of the invention provides a bar code identification method, the method can comprise the following steps:
acquiring a target bar code to be identified;
Inputting the target bar code into a preset recognition model, and acquiring a target bar space width ratio sequence of the target bar code output by the recognition model; the identification model is trained based on a plurality of sample bar codes and labels of each sample bar code, and the labels of each sample bar code comprise: a sample bar space-width ratio sequence of the sample bar code;
Determining a target code system category of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence;
Decoding the target bar code by using the target bar space-width ratio sequence, the target code system category and a preset code table to obtain a recognition result of the target bar code; the preset code table comprises corresponding relations of code system types, bar space combinations and characters.
The above can be seen that, when the scheme provided by the embodiment of the invention is applied to training the recognition model for bar code recognition, the training samples applied are: each sample bar code and a sample bar space width ratio sequence of the sample bar code, wherein under different code system types, a preset code table comprising corresponding relations of code system types, bar space combinations and characters can be constructed according to the coding rules.
Thus, when the target bar code is identified, the identification model can be utilized to obtain a target bar space width ratio sequence of the target bar code. Since the code system type of the bar code can be determined by the width ratio of the starting end and the ending end of the bar code, the target code system type of the target bar code can be determined by utilizing the starting value and the ending value in the target bar space width ratio sequence. Therefore, the target bar space-width ratio sequence, the target code system type and the preset code table can be utilized to decode the bar code, and the recognition result of the target bar code is obtained.
Based on the above, by applying the scheme provided by the embodiment of the invention, when the target bar code is identified, the obtained identification result is obtained through the target bar space-width ratio sequence of the target bar code and the preset code table, and when the identification model is trained, the training sample is: each sample bar code and the sample bar space width ratio sequence of the sample bar code do not need to take the bar space combination of each code system type as a sample, so that when a new code system type exists, the bar space combination of the new code system type does not need to be added into a training sample, the recognition model is retrained, and the preset code table is only required to be expanded by utilizing characters corresponding to each bar space combination under the new code system type. Therefore, the workload and time consumption for expanding the preset code table are far smaller than the workload and time consumption for retraining the identification model, so that the flexibility of bar code identification can be improved.
The following describes a barcode recognition method according to an embodiment of the present invention with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of a barcode recognition method according to an embodiment of the present invention, as shown in fig. 1, the method may include steps S101 to S104 as follows:
S101: acquiring a target bar code to be identified;
When the bar code identification is performed, the electronic device may first acquire the target bar code to be identified. The electronic device can acquire the target bar code to be identified in various modes.
For example, the electronic device may perform image acquisition on the target bar code through the installed image acquisition device to acquire the target bar code; for another example, the electronic device may scan the target bar code through the installed bar code scanning device to obtain the target bar code; for another example, the electronic device may directly acquire the target bar code or the like transmitted by the other electronic device in communication. The embodiment of the present invention is not particularly limited in this regard.
S102: inputting the target bar code into a preset recognition model, and obtaining a target bar space width ratio sequence of the target bar code output by the recognition model;
The identification model is obtained based on a plurality of sample bar codes and labels of each sample bar code in a training mode, and the labels of each sample bar code comprise: a sample bar space-width ratio sequence of the sample bar code;
The bar code is a graphic identifier for expressing a group of information by arranging a plurality of black bars and blanks with different widths according to a certain coding rule, so that each bar code comprises a plurality of black bars and a plurality of blanks, and the widths of the black bars and the blanks are not identical. Thus, from the beginning end of the bar code to the ending end of the bar code, the widths of each black bar and each blank in the bar code can be determined in sequence, and accordingly, the bar-to-space width ratio sequence of the bar code is determined according to the proportional relation of the widths of each black bar and each blank in the bar code.
The bar space width ratio sequence of the bar code comprises a plurality of continuous values, wherein the initial value corresponds to the initial end of the bar code, and the termination value corresponds to the termination end of the bar code. And each value from the initial value to the final value in the bar-space width ratio sequence sequentially corresponds to each black bar or blank from the initial end to the final end in the bar code. Thus, any two values in the bar space width ratio sequence are the width ratio of the black bar or the blank corresponding to the two values in the bar code respectively.
For example, as shown in fig. 2, the upper black bar and blank are combined to form a bar code, and the lower digital sequence is the bar space width ratio sequence of the bar code.
After the target bar code to be identified is obtained, the electronic equipment can input the target bar code into a preset identification model, so that the identification model can learn the bar code characteristics of the target bar code, and an output result of the identification model can be obtained.
The identification model is trained based on a plurality of sample bar codes and a sample bar space width ratio sequence of each sample bar code, so that after the identification model learns bar code characteristics of a target bar code, an output result is: a target bar to space ratio sequence of target bar codes.
For clarity, the training method of the recognition model will be exemplified later.
S103: determining a target code system category of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence;
in different application scenarios, the bar code may be generated according to different coding rules, each coding rule may be referred to as a code system type, that is, there are multiple code system types.
In general, the start end and the end of the bar code are each a black bar having a certain width, and in order to facilitate recognition of the encoding rule used when generating the bar code, a fixed width ratio may be set for the start end and the end of the bar code generated according to the code type for each code type, and the set width ratio may be different for different code types.
Based on this, the width ratio of the start and end segments of each barcode generated by the codebook type is the same and fixed for each codebook type, while the width ratio of the start and end segments of each barcode generated by the different codebook types is different for different codebook types.
That is, there is a one-to-one correspondence between the width ratio of the start end and the end of the barcode and the code system type of the barcode, and the code system type of the barcode can be determined by the width ratio of the start end and the end of the barcode.
Because the initial value and the final value in the target bar space width ratio sequence of the target bar code respectively correspond to the initial end and the final end of the target bar code, the ratio of the initial value to the final value in the target bar space width ratio sequence is the width ratio of the initial end and the final end of the target bar code.
Thus, after the identification model is utilized to obtain the target bar space width ratio sequence of the target bar code, the target code system type of the target bar code can be determined according to the initial value and the termination value in the target bar space width ratio sequence of the target bar code.
That is, the ratio of the initial value to the final value in the target bar space-width ratio sequence may be determined first, and then, the code type corresponding to the ratio is determined according to the correspondence between the width ratio of the initial end and the final end of the bar code and the code type of the bar code, and the determined code type is the target code type of the target bar code.
S104: decoding the target bar code by using the target bar space-width ratio sequence, the target code system category and the preset code table to obtain a recognition result of the target bar code;
The preset code table comprises corresponding relations of code system types, bar space combinations and characters.
The bar code is composed of a plurality of black bars and a plurality of blank spaces, and the black bars and the blank spaces which form the bar code form a plurality of bar space combinations according to the coding type of the bar code, so that the information expressed by the bar code is the information expressed by characters respectively corresponding to the bar space combinations in the bar code.
That is, the bar code expresses information through each bar space combination included. Therefore, when decoding the bar code to obtain the recognition result of the bar code, the bar space combination included in the bar code needs to be determined first.
Each code class has a plurality of space-space combinations, and each space-space combination corresponds to each character under different code classes. Thus, various space combinations of the code system category and characters corresponding to the space combinations of the code system category can be determined for each code system category, and accordingly, correspondence relation between the code system category, the space combinations and the characters is established, for example, as shown in table 1. Further, a preset code table including correspondence relation with respect to the code system category, the space combination, and the character may be generated.
TABLE 1
Thus, after the target code system category of the target bar code is obtained, the corresponding relation between the bar space combination and the characters under the target code system category can be determined in the preset code table.
Further, since the target bar space width ratio sequence of the target bar code may represent the width ratio of each black bar and blank included in the target bar code, each bar space combination included in the target bar code may be determined according to the target bar space width ratio sequence.
And under the condition that the corresponding relation between the bar-space combination and the character and the corresponding relation between the bar-space combination and the character in the target code system category are determined, determining the character corresponding to each bar-space combination in the target code system from the corresponding relation between the bar-space combination and the character in the target code system category, and determining the recognition result of the target code according to each determined character.
That is, after the target space-to-width ratio sequence and the target code system category of the target bar code are determined, the target bar code can be decoded by using the target space-to-width ratio sequence, the target code system category and the preset code table, so as to obtain the recognition result of the target bar code.
Optionally, in a specific implementation manner, as shown in fig. 3, the step S104 may include the following steps S1041 to S1043:
S1041: according to the division rule of the bar-space combination corresponding to the target code system type, determining a to-be-identified bar-space width ratio sequence of each target bar-space combination in the target bar code from the target bar-space width ratio sequence;
S1042: determining target characters corresponding to each strip-space width ratio sequence to be identified from the corresponding relation between the strip-space width ratio sequence and the characters of the strip-space combination under the target code system category in a preset code table;
S1043: and arranging each target character according to the arrangement sequence of the corresponding to-be-identified bar-space width ratio sequence in the target bar-space width ratio sequence to obtain the identification result of the target bar code.
In this specific implementation manner, different code system types correspond to different division rules of the bar space combinations, so that the bar space combinations included in the bar codes generated according to the different code system types can be determined through the different division rules. The division rule of the stripe and space combination corresponding to each code type may be: in this codebook type, each stripe/space combination includes the number of black stripes and spaces.
For example, the division rule of the space-stripe combination corresponding to the code pattern a is: the two black bars and the two blanks, namely, the corresponding bar code generated according to the code system type A, can be divided into a bar space combination from the initial end of the bar code in sequence until the bar code is divided into the final end of the bar code.
Under each code system type, various bar-space combinations of the code system type correspond to different characters respectively, so that after each bar-space combination included in the bar code is obtained through division, the corresponding relation between the bar-space combination and the characters under the code system type for generating the bar code can be further determined, the characters corresponding to each bar-space combination obtained through division in the bar code can be determined, and the recognition result of the bar code can be obtained according to the determined characters.
Wherein, since the black bars and the blanks constituting the bar code may have various width ratios, the black bars and the blanks in the bar-space combination in the bar code may also have various width ratios. Thus, for each codebook type, various combinations of spaces and spaces that the codebook type has can be represented by a width ratio sequence of black bars and spaces in the various combinations of spaces and spaces.
That is, in this embodiment, the correspondence between the bar-space combinations and the characters in each code system category included in the preset code table is the correspondence between the width ratio sequence of the black bars and the blanks in the bar-space combinations and the characters in each code system category.
Thus, after each bar-space combination in the bar code is obtained by dividing, the corresponding character of each bar-space combination can be determined from the corresponding relation between the bar-space combination and the characters under the code type generating the item according to the width ratio sequence of the black bar and the blank in each bar-space combination, and the recognition result of the bar code can be further determined according to the determined characters.
Therefore, after the target code system type of the target bar code is determined, the to-be-identified bar space width ratio sequence of each target bar space combination in the target bar code can be determined from the target bar space width ratio sequence according to the division rule of the bar space combination corresponding to the target code system type.
Optionally, since each value in the target bar space ratio sequence corresponds to one black bar or blank in the target bar code, the target bar space ratio sequence can be directly divided according to the division rule of the bar space combination corresponding to the target code system type, so that each bar space ratio sequence obtained by division is the to-be-identified bar space ratio sequence of each target bar space combination in the target bar code.
In the target bar code, the black bars and the blanks are arranged at intervals, and the starting end and the ending section of the target bar code are both black bars, so that the direct division of the target bar-to-space width ratio sequence according to the division rule of the bar-to-space combination corresponding to the target code system type means that: under the code system type, the sum of the numbers of black bars and blanks included in each bar-space combination is divided into a bar-space width ratio sequence to be identified from the initial value of the target bar-space width ratio sequence, and the continuous numbers and numbers are divided into the termination value of the target bar-space width ratio sequence.
For example, the target code type of the target bar code is a, and the division rule of the bar space combination corresponding to the code type a is: the two black bars and the two blanks can be started from the initial value of the target bar space width ratio sequence of the target bar code, the 1 st to 4 th numerical values are divided into a bar space width ratio sequence to be identified, the 5 th to 8 th numerical values are divided into a bar space width ratio sequence to be identified, and the 9 th to 12 th numerical values are divided into a bar space width ratio sequence to be identified until the final numerical value of the target bar space width ratio sequence is reached.
Optionally, since each value in the target bar space width ratio sequence corresponds to one black bar or blank in the target bar code, the target bar code can be divided according to a division rule of the bar space combination corresponding to the target code system type to obtain each target bar space combination included in the target bar code, and then, for each target bar space combination obtained by division, determining the value corresponding to each black bar and each blank in the target bar space ratio sequence, and sequentially arranging the value sequences obtained by the value corresponding to each black bar and each blank in the target bar space combination according to the arrangement sequence of each black bar and each blank in the target bar space combination, namely, the bar space width ratio sequence to be identified of the target bar space combination.
After the to-be-identified space-to-bar width ratio sequences of each target space-to-bar combination in the target bar code are obtained, determining target characters corresponding to the to-be-identified space-to-bar width ratio sequences of each target space-to-bar combination in the corresponding relation between the space-to-bar width ratio sequences of the space-to-bar combinations under the target code system category and the characters in a preset code table.
Furthermore, according to the arrangement order of the to-be-identified strip-space-width-ratio sequences in the target strip-space-width-ratio sequences, target characters corresponding to the to-be-identified strip-space-width-ratio sequences can be sequentially arranged. Thus, after the arrangement is completed, the obtained character string is the recognition result of the target bar code.
Based on the above, by applying the scheme provided by the embodiment of the invention, when the target bar code is identified, the obtained identification result is obtained through the target bar space-width ratio sequence of the target bar code and the preset code table, and when the identification model is trained, the training sample is: each sample bar code and the sample bar space width ratio sequence of the sample bar code do not need to take the bar space combination of each code system type as a sample, so that when a new code system type exists, the bar space combination of the new code system type does not need to be added into a training sample, the recognition model is retrained, and the preset code table is only required to be expanded by utilizing characters corresponding to each bar space combination under the new code system type. Therefore, the workload and time consumption for expanding the preset code table are far smaller than the workload and time consumption for retraining the identification model, so that the flexibility of bar code identification can be improved.
Next, the training method of the above-described recognition model will be exemplified.
Optionally, in a specific implementation manner, as shown in fig. 4, a training manner of an identification model provided by an embodiment of the present invention may include the following steps S401 to S403:
s401: acquiring a plurality of sample bar codes and determining the label of each sample bar code;
S402: training a preset initial model by using a plurality of sample bar codes and labels of each sample bar code;
s403: and stopping training when the preset stopping condition is met, and obtaining the recognition model after training is completed.
In this particular implementation, multiple sample barcodes may be first acquired. The electronic device may obtain a plurality of sample barcodes in a plurality of manners, which is not specifically limited in the embodiment of the present invention.
Optionally, the electronic device may directly obtain each barcode existing in the application scenario, as a sample barcode, for example, may obtain barcodes on various commodities in a supermarket as sample barcodes; for another example, it is reasonable to obtain barcodes on various tickets such as air tickets as sample barcodes.
Alternatively, the electronic device may generate individual sample barcodes. The sample bar space width ratio sequence of each sample bar code is required to be used for model training, so that the bar space width ratio range in the sample bar code can be preset, and the electronic equipment can randomly generate a plurality of sample bar codes according to the preset bar space width ratio range.
The minimum value of the so-called stripe/space width ratio range is 1, and the maximum value is: the ratio of the width of the widest black bar or space that can occur in the bar code to the narrowest black bar or space that can occur.
For example, if the bar to space ratio is in the range of 1-9, the width ratio between the widest black bar or space that can occur in the bar code and the narrowest black bar or space that can occur is 9.
Of course, the above-mentioned 1-9 is merely an illustration of the ratio range of the stripe/space width, and not a limitation, and other ratio ranges of the stripe/space width meeting the requirements of the application scenario are also within the protection scope of the present invention.
Optionally, under the condition of presetting a space-to-bar width ratio range in the sample bar code, each code system type can be set, so that the electronic device can randomly generate a plurality of sample bar codes according to the preset space-to-bar width ratio range and each code system type.
Optionally, under the condition that the bar-space width ratio range in the sample bar code is preset, each bar code type, for example, a normal code, a truncated code and the like, can be set, so that the electronic device can randomly generate a plurality of sample bar codes according to the preset bar-space width ratio range and each bar code type.
After a plurality of sample bar codes are obtained, the width ratio of each black bar and each blank included in each sample bar code can be determined for each sample bar code, so that a sample bar space width ratio sequence of each sample bar code is obtained, and the sample bar space width ratio sequence of each sample bar code is used as a label of the sample.
In this way, the preset initial model can be trained by using a plurality of sample bar codes and the label of each sample bar code.
The electronic device can take each sample bar code and a label of the sample bar code as a training sample, so that a plurality of training samples determined according to the sample bar codes and the labels of the sample bar codes are input into a preset initial model for sequence, and further, an identification model is obtained.
The initial model may be a deep learning network such as RNN, CNN, or a machine learning model such as decision tree, support vector machine, etc., which is not limited by the specific type of the initial model in the embodiment of the present invention.
In the training process, the initial model can learn the bar code characteristics of the sample bar code, output the sample bar space width ratio sequence of the sample bar code, and through the learning of a large number of sample bar codes, the initial model can gradually establish the corresponding relation between the bar code characteristics and the bar space width ratio sequence, and further, when the preset training stop condition is met, the training is stopped, and the recognition model after the training is completed is obtained.
Alternatively, the stopping condition may be: the iteration times of the training samples reach the preset times.
Alternatively, the stopping condition may be: the loss value of the initial model is less than a preset loss value threshold.
After training for a certain period of time or a certain number of iterations, predicting the sample bar space-width ratio sequence of each sample item by using an initial model to obtain each predicted value, and further, calculating the difference value between the obtained predicted value and the sample bar space-width ratio sequence in the label of the sample bar code for each sample item to serve as a loss value of the initial model. When the loss value of the initial model is smaller than a preset loss value threshold, the preset stopping condition can be confirmed to be met, so that training is stopped, and a recognition model with completed training is obtained.
Thus, the recognition model obtained through training can be used for learning the target bar code and outputting the target bar space width ratio sequence of the target bar code.
That is, the electronic device can input the target bar code into the recognition model obtained by training to learn, and the recognition model outputs the target bar space width ratio sequence of the target bar code. When the recognition model learns the target bar code, the target bar space width ratio sequence of the target bar code is determined and output according to the bar code characteristics of the target bar code and the corresponding relation between the established bar code characteristics and the bar space width ratio sequence, and the electronic equipment can obtain the target bar space width ratio sequence of the target bar code.
In addition, the electronic device for training the identification model and the electronic device for executing the barcode identification method provided by the embodiment of the present invention may be the same electronic device or different electronic devices, and the embodiment of the present invention is not limited in detail.
In many cases, the sizes of the sample barcodes acquired by the electronic device are different, so, in order to improve the recognition accuracy of the obtained recognition model, before the initial model is trained by using the sample barcodes, the sample barcodes may be normalized first, so that the sizes of the sample barcodes used for training the initial model are the same.
Based on this, in an optional implementation manner, as shown in fig. 5, the training manner of the identification model provided by the embodiment of the present invention may further include the following step S404:
s404: normalizing each sample bar code to obtain normalized sample bar codes;
the size of each normalized sample bar code is a preset size;
correspondingly, in this embodiment, the step S402 of training the preset initial model by using a plurality of sample barcodes and the label of each sample barcode may include the following step S402A:
S4021: training a preset initial model by using each normalized sample bar code and the label of each sample bar code.
In this embodiment, an image size matched with the initial model may be preset as a preset size, so that normalization processing may be performed on each sample barcode, so that the size of each sample barcode after normalization is the preset size.
The normalization processing of each sample bar code means that; the sizes of the sample bar codes are unified into the same size through scaling treatment.
For each obtained sample barcode, the size of the sample barcode may be determined first, and then, the size relationship between the size of the sample barcode and the preset size may be determined. Further, according to the determined size relationship, it may be determined whether to perform a reduction or an amplification process on the sample barcode, so that the size of the sample barcode after the reduction or the amplification process is the predicted size.
For each sample bar code, if the size of the sample bar code is larger than the preset size, the sample bar code can be reduced by reducing treatment, so that the reduced size of the sample bar code is the preset size; if the size of the sample bar code is smaller than the preset size, amplifying the sample bar code by amplifying treatment so that the amplified size of the sample bar code is the preset size; if the size of the sample bar code is equal to the preset size, the sample bar code can be directly used as the normalized sample bar code without processing the sample bar code.
In this way, after normalization processing is performed on each sample bar code, each sample bar code after normalization is obtained, and the preset initial model can be trained by using each sample bar code after normalization and the label of each sample bar code.
The specific implementation manner of the step S4021 is similar to the specific implementation manner of the step S402, and will not be described herein.
In addition, in many cases, the image quality of some sample barcodes acquired by the electronic device may be poor, for example, the brightness of the image is low, the barcode is inclined, etc., so that in order to improve the recognition accuracy and generalization of the trained recognition model, the image enhancement processing may be performed on the acquired sample barcode.
Based on this, in an optional implementation manner, as shown in fig. 6, the training manner of the identification model provided by the embodiment of the present invention may further include the following step S405:
S405: carrying out image enhancement processing on each normalized sample bar code to obtain each sample bar code after enhancement processing;
Wherein the image enhancement processing includes: at least one of brightness adjustment, contrast adjustment, rotation, and displacement;
Correspondingly, in this embodiment, the step S4021, training the preset initial model by using the normalized sample barcodes and the label of each sample barcode may include the following steps S4021A:
S4021A: and training a preset initial model by utilizing each sample bar code subjected to image enhancement processing and the label of each sample bar code.
In this embodiment, after each normalized sample barcode is obtained, image enhancement processing is performed on the normalized sample barcode.
Wherein, the image enhancement processing may include: at least one of brightness adjustment, contrast adjustment, rotation and displacement. That is, when the image enhancement processing is performed on each sample bar code after normalization, one of the processing of brightness adjustment, contrast adjustment, rotation, and displacement may be adopted, or a plurality of the processing of brightness adjustment, contrast adjustment, rotation, and displacement may be adopted. Of course, the processing method adopted when the normalized sample bar codes are subjected to image enhancement processing is not limited to this.
Rotation means: rotating the sample bar code in the inclined posture to enable the sample bar code to be in the normal posture;
the displacement means: the position of the sample bar code in the image is moved so that it is at the designated position in the image. For example, the sample bar code located on the left side of the image is moved so that it is centered in the image.
In this way, after the normalized sample bar codes are subjected to image enhancement processing, the sample bar codes subjected to image enhancement processing can be used for training a preset initial model by utilizing the sample bar codes subjected to image enhancement processing and the labels of the sample bar codes.
The specific implementation manner of the step S4021A is similar to the specific implementation manner of the step S402, and will not be described herein.
Optionally, in another specific implementation manner, based on the specific manner shown in fig. 4, the training manner of the identification model provided by the embodiment of the present invention may further include the following step 11:
step 11: performing image enhancement processing on each sample bar code to obtain each sample bar code after the image enhancement processing;
Wherein the image enhancement processing includes: at least one of brightness adjustment, contrast adjustment, rotation, and displacement;
Correspondingly, in this embodiment, the step S402 of training the preset initial model by using the plurality of sample barcodes and the label of each sample barcode may include the following step 12:
step 12: and training a preset initial model by utilizing each sample bar code subjected to image enhancement processing and the label of each sample bar code.
In this embodiment, after the electronic device obtains each sample barcode, the electronic device may perform image enhancement processing on only each sample barcode, so as to obtain each sample barcode after image enhancement processing, and further, directly use each sample barcode after image enhancement processing and the label of each sample barcode to train the preset initial model.
The specific implementation manner of the step 11 is similar to the specific implementation manner of the step S405, and the specific implementation manner of the step 12 is similar to the specific implementation manner of the step S402, which is not repeated here.
Optionally, in a specific implementation manner, based on the specific implementation manner shown in fig. 4 to fig. 6, a training manner for an identification model provided by an embodiment of the present invention may include the following steps 21 to 24:
step 21: randomly generating a plurality of sample bar codes according to a preset bar space width ratio range, and determining the label of each sample bar code;
step 22: normalizing each sample bar code to obtain normalized sample bar codes;
the size of each normalized sample bar code is a preset size;
step 23: carrying out image enhancement processing on each normalized sample bar code to obtain each sample bar code after enhancement processing;
Wherein the image enhancement processing includes: at least one of brightness adjustment, contrast adjustment, rotation, and displacement;
step 24: and training a preset initial model by utilizing each sample bar code subjected to image enhancement processing and the label of each sample bar code.
On the basis of the specific implementation manner shown in fig. 5 and fig. 6, in order to improve the accuracy of the recognition model in recognizing the target bar space width ratio sequence of the target bar code, the size of the target bar code input into the recognition model may be the same as the size of each sample bar code after normalization used for training the recognition model, that is, the size of the target bar code input into the recognition model may be a preset size. However, in many cases, the initial size of the acquired barcode to be identified may not be a preset size, and thus, the acquired barcode to be identified may be resized to obtain a target barcode of a preset size.
Based on this, in an optional implementation manner, based on the implementation manner shown in fig. 5 and fig. 6, the step S101 of obtaining the target barcode to be identified may include the following step 31:
step 31: acquiring an initial bar code to be identified, and carrying out normalization processing on the initial bar code to obtain a target bar code;
the size of the target bar code is a preset size.
In this embodiment, in order to obtain a target barcode with a size that is a preset size, after an initial barcode to be identified is obtained, normalization processing may be performed on the initial barcode to obtain a target barcode with a size that is a preset size.
Here, the normalization processing of the initial stage means; and adjusting the size of the initial bar code to a preset size through scaling treatment.
The size of the initial bar code can be determined first according to the initial bar code, and then the size relation between the size of the initial bar code and the preset size is determined. Further, whether the initial bar code is reduced or enlarged is determined according to the determined size relationship so that the size of the initial bar code after the reduction or enlargement is the predicted size.
If the size of the initial bar code is larger than the preset size, the initial bar code can be reduced through reduction treatment, so that the reduced size of the initial bar code is the preset size; if the size of the initial bar code is smaller than the preset size, amplifying the initial bar code through amplifying treatment, so that the amplified size of the initial bar code is the preset size; if the size of the initial bar code is equal to the preset size, the initial bar code can be directly used as the target bar code without processing the initial bar code.
Based on the above various specific implementations, in some cases, in order to improve accuracy and efficiency of barcode recognition, when the recognition model is trained, the label of the sample barcode used may further include other information for representing barcode characteristics of the sample barcode, for example, the number of codewords of the sample barcode and the barcode type.
Based on this, in an optional implementation manner, the label of each sample barcode may further include, based on the above various implementation manners: the number of sample code words of the sample bar code; wherein, the number of code words of each sample is: the sample bar code includes the number of bar spaces, i.e., the sum of the number of black bars and spaces included in the sample bar code. Thus, when the recognition model is trained, the corresponding relation between the bar code characteristics and the number of the code words can be established in the recognition model.
In this embodiment, the method for training the initial model to obtain the identification model by using a plurality of sample barcodes and the labels including the sample barcode space-width ratio sequence and the sample codeword number of each sample barcode is similar to the embodiment shown in fig. 4 and will not be described herein.
Accordingly, in this embodiment, as shown in fig. 7, step S102, inputting the target barcode into a preset recognition model, and obtaining the target barcode space-width ratio sequence of the target barcode output by the recognition model may include the following step S1021:
S1021: inputting the target bar code into a preset recognition model, and obtaining a target bar space-width ratio sequence and the number of target code words of the target bar code output by the recognition model;
Further, as shown in fig. 7, the method for identifying a barcode according to the embodiment of the present invention may further include the following steps S105 and S106:
s105: judging whether the number of the numerical values included in the target strip space width ratio sequence is the same as the number of the target code words; if the two types are the same, executing step S103; otherwise, executing step S106;
s106: and determining the recognition result of the recognition model on the target bar code as an error result.
In this specific implementation manner, the corresponding relationship between the barcode features and the number of codewords can be further established in the recognition model, so that when the recognition model learns the target barcodes, the target barcode space-to-space ratio sequence and the target barcode number of the target barcodes can be output, wherein the target barcode number is: the target barcode includes the number of spaces.
For the same target bar code, since each value in the target bar space width ratio sequence of the target bar code corresponds to one black bar or one blank in the target bar code, the number of the values included in the target bar space width ratio sequence output by the recognition model should be the same as the number of the target code words.
Based on this, after obtaining the target space-width ratio sequence and the number of target codewords output by the recognition model, the electronic device may first determine whether the number of values included in the target space-width ratio sequence is the same as the number of target codewords.
If the judgment results are the same, it may be determined that the recognition model is accurate for the recognition of the target barcode, so the electronic device may continue to execute the step S103, and finally obtain the recognition result of the target barcode.
In contrast, if the judgment results are different, it can be determined that the recognition of the recognition model to the target bar code is wrong, and at least one of the target bar space-width ratio sequence and the target code word number output by the recognition model is wrong, so that the electronic device can determine that the recognition result of the recognition model to the target bar code is wrong.
Optionally, when the number of the numerical values included in the target bar space width ratio sequence is different from the number of the target code words, the electronic device may further output a prompt message indicating that the recognition model recognizes the target bar code as an error after determining that the recognition result of the recognition model to the target bar code is an error result.
For example, the electronic device may output the prompt information indicating the recognition error of the recognition model to the target bar code through various modes such as voice, text, warning light, etc., and is not limited to this.
Based on the above various specific implementations, in some cases, the obtained target barcode may not be a normal code, for example, may be a truncated code including only a part of the barcode, a folded code having distortion, etc., where for the truncated code, the identification result of the target barcode is not obtained, and for the folded code, after learning the barcode feature, the identification result of the target barcode may be obtained.
Based on this, in an optional implementation manner, the label of each sample barcode may further include, based on the above various implementation manners: sample barcode type of the sample barcode.
The sample bar code type of each sample bar code is any one of a plurality of preset bar code types, and the plurality of bar code types at least comprise: the normal code, the crease code, and the cut-off code, that is, the sample barcode type of each sample barcode may be the normal code, the crease code, or the cut-off code.
Here, the pleat code means: a bar code that is distorted but identifiable; the truncated code means: bar codes which only comprise partial bar spaces and do not comprise all bar spaces; the normal code means: including bar codes that are all bar-empty and have no distortion.
Thus, when the identification model is trained, the corresponding relation between the bar code characteristics and the bar code types can be established in the identification model.
In this particular implementation, the label of each sample barcode may include: the sample bar space width ratio sequence and the sample bar code type of the sample bar code are utilized, so that the initial model is trained to obtain an identification model by utilizing a plurality of sample bar codes and labels of each sample bar code, which comprise the sample bar space width ratio sequence and the sample bar code type, and the specific implementation modes are similar to those shown in the above-mentioned fig. 4-6, and are not repeated here.
Accordingly, in this embodiment, as shown in fig. 8, the step S102 of inputting the target barcode into the preset recognition model and the step of obtaining the target barcode space-to-space ratio sequence of the target barcode output by the recognition model may include the following step S1022:
s1022: inputting the target bar code into a preset recognition model, and obtaining a target bar space-width ratio sequence and a target bar code type of the target bar code output by the recognition model;
Further, as shown in fig. 8, the step S103 of determining the target code system type of the target bar code according to the start value and the end value in the target bar space width ratio sequence may include the following step S1031:
S1031: if the target bar code type of the target bar code is a normal code or a crease code, determining the target code type of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence;
Further, as shown in fig. 8, the method for identifying a barcode according to the embodiment of the present invention may further include the following step S107:
s107: if the target bar code type of the target bar code is a cut-off code, determining that the identification result of the target bar code cannot be obtained.
In the specific implementation manner, the corresponding relation between the bar code characteristics and the bar code types can be established in the identification model, so that the identification model can output the target bar space width ratio sequence and the target bar code types of the target bar code when learning the target bar code.
Because the electronic device cannot decode the target bar code to obtain the recognition result of the target bar code when the bar code type of the target bar code is the cut-off code, the electronic device does not need to execute the subsequent steps S103 and S104 when the bar code type of the target bar code is the cut-off code.
Based on the above, after the target bar code type output by the recognition model is obtained, if the target bar code type of the target bar code is a normal code or a crease code, the electronic device can continuously determine the target code type of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence, and finally obtain the recognition result of the target bar code.
In contrast, after the target bar code type output by the recognition model is obtained, if the target bar code type of the target bar code is a cut-off code, the electronic device can directly determine that the recognition result of the target bar code cannot be obtained.
Optionally, when the target barcode type of the target barcode is a truncated barcode, the electronic device may further output a prompt message indicating that the recognition result of the target barcode cannot be obtained after determining that the recognition result of the target barcode cannot be obtained.
For example, the electronic device may output the prompt information indicating that the recognition result of the target bar code cannot be obtained through various modes such as voice, text, warning light, etc., and is not limited to this.
Optionally, in a specific implementation manner, on the basis of the specific implementation manner shown in fig. 7 and fig. 8, the label of each sample barcode may further include: the number of sample code words and the type of the bar code of the sample bar code.
For example, as shown in fig. 12, a schematic diagram of a training process for training the recognition model in this specific implementation manner; wherein, training picture is: the picture comprising the sample bar code, and the picture corresponding label is: a label of a sample barcode included in a picture, the label comprising: the picture comprises bar blank information, bar code types and code word numbers of sample bar codes; wherein, the strip empty information is: sample bar to space width ratio sequence.
Thus, various deep learning networks including but not limited to CNN, RNN and the like can be adopted to extract the bar code characteristics of the sample bar code, and establish the corresponding relation between the bar code characteristics and the bar space width ratio sequence, the bar code type and the number of code words, and training is carried out to obtain the identification model.
The training process can adopt a gradient descent method for training, a recognition model with available convergence is finally obtained through training, and in the training process, three branches can be provided in total, and bar space information, bar code types and code word numbers of bar codes are predicted through a Softmax (normalization) function or an L2 (square) loss function respectively. Alternatively, the barcode types may include: normal code, truncated code, and pleated code.
Based on this, in this specific implementation manner, as shown in fig. 9, a barcode recognition method provided by the embodiment of the present invention may include the following steps:
S901: acquiring a target bar code to be identified;
s902: inputting the target bar code into a preset recognition model, and obtaining a target bar space width ratio sequence, a target code word number and a bar code type of the target bar code output by the recognition model;
s903: if the target bar code type of the target bar code is a cut-off code, determining that the identification result of the target bar code cannot be obtained;
S904: if the target bar code type of the target bar code is a normal code or a crease code, judging whether the number of the numerical values included in the target bar code space-width ratio sequence is the same as the number of the target code words; if not, then step S905 is performed; if so, step S906 is performed;
S905: determining that the recognition result of the recognition model on the target bar code is an error result;
S906: determining a target code system category of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence;
S907: and decoding the target bar code by using the target bar space-width ratio sequence, the target code system category and the preset code table to obtain the recognition result of the target bar code.
The steps in the specific implementation manner shown in fig. 9 are the same as or similar to the specific implementation manner of the corresponding steps in the specific implementation manner, and are not repeated herein. Specifically, step S901 corresponds to step S101, step S902 corresponds to steps S1021 and S1022, step S903 corresponds to step S107, step S904 corresponds to step 31, step S905 corresponds to step S106, step S906 corresponds to step S103, and step S907 corresponds to step S104, which will not be described herein.
Corresponding to the bar code identification method provided by the embodiment of the invention, the embodiment of the invention also provides a bar code identification device.
Fig. 10 is a schematic structural diagram of a bar code recognition device according to an embodiment of the present invention, and as shown in fig. 10, the device may include the following modules:
The target bar code acquisition module 1001 is configured to acquire a target bar code to be identified;
The output result obtaining module 1002 is configured to input the target barcode into a preset recognition model, and obtain a target barcode space-to-width ratio sequence of the target barcode output by the recognition model; the identification model is trained based on a plurality of sample bar codes and labels of each sample bar code, and the labels of each sample bar code comprise: a sample bar space-width ratio sequence of the sample bar code;
a code system type determining module 1003, configured to determine a target code system type of the target barcode according to a start value and a stop value in the target barcode space-width ratio sequence;
The decoding module 1004 is configured to decode the target barcode by using the target barcode space-to-space ratio sequence, the target code system category and a preset code table, so as to obtain a recognition result of the target barcode; the preset code table comprises corresponding relations of code system types, bar space combinations and characters.
Based on the above, by applying the scheme provided by the embodiment of the invention, when the target bar code is identified, the obtained identification result is obtained through the target bar space-width ratio sequence of the target bar code and the preset code table, and when the identification model is trained, the training sample is: each sample bar code and the sample bar space width ratio sequence of the sample bar code do not need to take the bar space combination of each code system type as a sample, so that when a new code system type exists, the bar space combination of the new code system type does not need to be added into a training sample, the recognition model is retrained, and the preset code table is only required to be expanded by utilizing characters corresponding to each bar space combination under the new code system type. Therefore, the workload and time consumption for expanding the preset code table are far smaller than the workload and time consumption for retraining the identification model, so that the flexibility of bar code identification can be improved.
Optionally, in one specific implementation, the decoding module 1004 is specifically configured to:
determining a to-be-identified bar-space width ratio sequence of each target bar-space combination in the target bar code from the target bar-space width ratio sequence according to a division rule of the bar-space combination corresponding to the target code system type;
Determining target characters corresponding to each to-be-identified strip-space width ratio sequence from the corresponding relation between the strip-space width ratio sequence of the strip-space combination under the target code system category and the characters in a preset code table;
And arranging each target character according to the arrangement sequence of the corresponding to-be-identified bar space width ratio sequence in the target bar space width ratio sequence to obtain the identification result of the target bar code.
Optionally, in a specific implementation manner, the label of each sample barcode further includes: the number of sample code words of the sample bar code; wherein, the number of code words of each sample is: the sample bar code includes a number of bar spaces;
The output result obtaining module 1002 is specifically configured to: inputting the target bar code into a preset recognition model, and obtaining a target bar space-width ratio sequence and the number of target code words of the target bar code output by the recognition model;
the apparatus further comprises:
the numerical value judging module is used for judging whether the number of the numerical values included in the target bar space-width ratio sequence is the same as the number of the target code words before the target code system type of the target bar code is determined according to the initial numerical value and the termination numerical value in the target bar space-width ratio sequence; if the code system category determination modules are the same, triggering the code system category determination module 1003; otherwise, determining that the recognition result of the recognition model on the target bar code is an error result.
Optionally, in a specific implementation manner, the label of each sample barcode further includes: sample barcode type of the sample barcode; the sample bar code type of each sample bar code is any one of a plurality of preset bar code types, and the plurality of bar code types at least comprise: normal code and truncated code;
The output result obtaining module 1002 is specifically configured to: inputting the target bar code into a preset recognition model, and acquiring a target bar space-width ratio sequence and a target bar code type of the target bar code output by the recognition model;
The code class determining module 1003 is specifically configured to: if the target bar code type of the target bar code is a normal code, determining a target code system type of the target bar code according to a starting value and a stopping value in the target bar space-width ratio sequence;
the apparatus further comprises:
And the result determining module is used for determining that the identification result of the target bar code cannot be obtained if the type of the target bar code is a cut-off code.
Optionally, in a specific implementation manner, the apparatus further includes: a model training module for training the recognition model, the model training module comprising:
the sample acquisition sub-module is used for randomly generating a plurality of sample bar codes according to a preset bar space width ratio range and determining the label of each sample bar code;
The normalization processing sub-module is used for carrying out normalization processing on each sample bar code to obtain each normalized sample bar code; the size of each normalized sample bar code is a preset size;
The image enhancer module is used for carrying out image enhancement processing on each normalized sample bar code to obtain each enhanced sample bar code; wherein the image enhancement processing includes: at least one of brightness adjustment, contrast adjustment, rotation, and displacement;
the model training sub-module is used for training a preset initial model by utilizing each sample bar code subjected to image enhancement processing and the label of each sample bar code;
The target barcode acquisition module 1001 is specifically configured to: acquiring an initial bar code to be identified, and carrying out normalization processing on the initial bar code to obtain a target bar code; the size of the target bar code is the preset size.
Corresponding to the barcode recognition method provided in the above embodiment of the present invention, the embodiment of the present invention further provides an electronic device, as shown in fig. 11, including a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, where the processor 1101, the communication interface 1102 and the memory 1103 complete communication with each other through the communication bus 1104,
A memory 1103 for storing a computer program;
The processor 1101 is configured to implement the steps of any one of the barcode recognition methods provided in the embodiments of the present invention when executing the program stored in the memory 1103.
The communication bus mentioned above for the electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present invention, there is also provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of any of the barcode recognition methods provided in the embodiments of the present invention described above.
In yet another embodiment of the present invention, a computer program product containing instructions is also provided, which when run on a computer, causes the computer to perform the steps of any of the barcode recognition methods provided by the embodiments of the present invention described above.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the apparatus embodiments, the electronic device embodiments, the computer-readable storage medium embodiments, and the computer program product embodiments, the description is relatively simple, as relevant to the description of the method embodiments in part, since they are substantially similar to the method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (12)
1. A method of bar code identification, the method comprising:
acquiring a target bar code to be identified;
Inputting the target bar code into a preset recognition model, and acquiring a target bar space width ratio sequence of the target bar code output by the recognition model; the identification model is trained based on a plurality of sample bar codes and labels of each sample bar code, and the labels of each sample bar code comprise: the sample bar space width ratio sequence of the sample bar code comprises a plurality of continuous values, and each value from the initial value to the end value in the target bar space width ratio sequence corresponds to each black bar or blank from the initial end to the end in the target bar code in sequence;
Determining a target code system category of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence;
Decoding the target bar code by using the target bar space-width ratio sequence, the target code system category and a preset code table to obtain a recognition result of the target bar code; the preset code table comprises corresponding relations of code types, bar space combinations and characters;
the training mode of the identification model comprises the following steps:
Randomly generating a plurality of sample bar codes according to a preset bar space width ratio range, a code system type and a bar code type, and determining the label of each sample bar code; the minimum value of the strip-space width ratio range is 1, and the maximum value is: the width ratio between the widest black bar or blank which can appear in the bar code and the narrowest black bar or blank which can appear in the bar code comprises a normal code, a fold code and a cut-off code;
training a preset initial model by using the plurality of sample bar codes and the label of each sample bar code;
and stopping training when the preset stopping condition is met, and obtaining the recognition model after training is completed.
2. The method according to claim 1, wherein the step of decoding the target bar code using the target bar space-width ratio sequence, the target code system category and a preset code table to obtain the recognition result of the target bar code comprises:
determining a to-be-identified bar-space width ratio sequence of each target bar-space combination in the target bar code from the target bar-space width ratio sequence according to a division rule of the bar-space combination corresponding to the target code system type;
Determining target characters corresponding to each to-be-identified strip-space width ratio sequence from the corresponding relation between the strip-space width ratio sequence of the strip-space combination under the target code system category and the characters in a preset code table;
And arranging each target character according to the arrangement sequence of the corresponding to-be-identified bar space width ratio sequence in the target bar space width ratio sequence to obtain the identification result of the target bar code.
3. The method of claim 1, wherein the label of each sample barcode further comprises: the number of sample code words of the sample bar code; wherein, the number of code words of each sample is: the sample bar code includes a number of bar spaces;
the step of inputting the target bar code into a preset recognition model and obtaining a target bar space width ratio sequence of the target bar code output by the recognition model comprises the following steps:
Inputting the target bar code into a preset recognition model, and obtaining a target bar space-width ratio sequence and the number of target code words of the target bar code output by the recognition model;
before the step of determining the target codebook class of the target barcode according to the start value and the end value in the target bar space-width ratio sequence, the method further comprises:
judging whether the number of the numerical values included in the target strip space width ratio sequence is the same as the number of the target code words;
If the target bar space width ratio sequence is the same, executing the step of determining the target code system category of the target bar according to the initial value and the termination value in the target bar space width ratio sequence;
otherwise, determining that the recognition result of the recognition model on the target bar code is an error result.
4. A method according to any one of claims 1 to 3, wherein the label of each sample barcode further comprises: sample barcode type of the sample barcode; the sample bar code type of each sample bar code is any one of a plurality of preset bar code types, and the plurality of bar code types at least comprise: normal code, pleat code and cut-off code;
the step of inputting the target bar code into a preset recognition model and obtaining a target bar space width ratio sequence of the target bar code output by the recognition model comprises the following steps:
Inputting the target bar code into a preset recognition model, and acquiring a target bar space-width ratio sequence and a target bar code type of the target bar code output by the recognition model;
The step of determining the target code system category of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence comprises the following steps:
If the target bar code type of the target bar code is a normal code or a crease code, determining a target code system type of the target bar code according to a starting value and a stopping value in the target bar space-width ratio sequence;
The method further comprises the steps of:
If the target bar code type of the target bar code is a cut-off code, determining that the identification result of the target bar code cannot be obtained.
5. The method of claim 1, wherein training the pre-set initial model using the plurality of sample barcodes and the label of each sample barcode comprises:
Normalizing each sample bar code to obtain normalized sample bar codes; the size of each normalized sample bar code is a preset size;
Carrying out image enhancement processing on each normalized sample bar code to obtain each sample bar code after enhancement processing; wherein the image enhancement processing includes: at least one of brightness adjustment, contrast adjustment, rotation, and displacement;
Training a preset initial model by utilizing each sample bar code subjected to image enhancement processing and the label of each sample bar code;
The step of obtaining the target bar code to be identified comprises the following steps:
Acquiring an initial bar code to be identified, and carrying out normalization processing on the initial bar code to obtain a target bar code; the size of the target bar code is the preset size.
6. A bar code identification device, the device comprising:
The target bar code acquisition module is used for acquiring a target bar code to be identified;
The output result acquisition module is used for inputting the target bar code into a preset recognition model and acquiring a target bar space width ratio sequence of the target bar code output by the recognition model; the identification model is trained based on a plurality of sample bar codes and labels of each sample bar code, and the labels of each sample bar code comprise: the sample bar space width ratio sequence of the sample bar code comprises a plurality of continuous values, and each value from the initial value to the end value in the target bar space width ratio sequence corresponds to each black bar or blank from the initial end to the end in the target bar code in sequence;
the code system type determining module is used for determining the target code system type of the target bar code according to the initial value and the termination value in the target bar space-width ratio sequence;
The decoding module is used for decoding the target bar code by utilizing the target bar space width ratio sequence, the target code system category and a preset code table to obtain a recognition result of the target bar code; the preset code table comprises corresponding relations of code types, bar space combinations and characters;
The apparatus further comprises: model training module for:
Randomly generating a plurality of sample bar codes according to a preset bar space width ratio range, a code system type and a bar code type, and determining the label of each sample bar code; the minimum value of the strip-space width ratio range is 1, and the maximum value is: the width ratio between the widest black bar or blank which can appear in the bar code and the narrowest black bar or blank which can appear in the bar code comprises a normal code, a fold code and a cut-off code;
training a preset initial model by using the plurality of sample bar codes and the label of each sample bar code;
and stopping training when the preset stopping condition is met, and obtaining the recognition model after training is completed.
7. The apparatus of claim 6, wherein the decoding module is specifically configured to:
determining a to-be-identified bar-space width ratio sequence of each target bar-space combination in the target bar code from the target bar-space width ratio sequence according to a division rule of the bar-space combination corresponding to the target code system type;
Determining target characters corresponding to each to-be-identified strip-space width ratio sequence from the corresponding relation between the strip-space width ratio sequence of the strip-space combination under the target code system category and the characters in a preset code table;
And arranging each target character according to the arrangement sequence of the corresponding to-be-identified bar space width ratio sequence in the target bar space width ratio sequence to obtain the identification result of the target bar code.
8. The apparatus of claim 6, wherein the label of each sample barcode further comprises: the number of sample code words of the sample bar code; wherein, the number of code words of each sample is: the sample bar code includes a number of bar spaces;
The output result obtaining module is specifically configured to: inputting the target bar code into a preset recognition model, and obtaining a target bar space-width ratio sequence and the number of target code words of the target bar code output by the recognition model;
the apparatus further comprises:
The numerical value judging module is used for judging whether the number of the numerical values included in the target bar space-width ratio sequence is the same as the number of the target code words before the target code system type of the target bar code is determined according to the initial numerical value and the termination numerical value in the target bar space-width ratio sequence; if the code system category determining modules are the same, triggering the code system category determining modules; otherwise, determining that the recognition result of the recognition model on the target bar code is an error result.
9. The apparatus of any one of claims 6-8, wherein the label of each sample barcode further comprises: sample barcode type of the sample barcode; the sample bar code type of each sample bar code is any one of a plurality of preset bar code types, and the plurality of bar code types are as follows: normal code, pleat code and cut-off code;
The output result obtaining module is specifically configured to: inputting the target bar code into a preset recognition model, and acquiring a target bar space-width ratio sequence and a target bar code type of the target bar code output by the recognition model;
The code class determining module is specifically configured to: if the target bar code type of the target bar code is a normal code or a crease code, determining a target code system type of the target bar code according to a starting value and a stopping value in the target bar space-width ratio sequence;
the apparatus further comprises:
And the result determining module is used for determining that the identification result of the target bar code cannot be obtained if the type of the target bar code is a cut-off code.
10. The apparatus of claim 6, wherein the model training module comprises:
The normalization processing sub-module is used for carrying out normalization processing on each sample bar code to obtain each normalized sample bar code; the size of each normalized sample bar code is a preset size;
The image enhancer module is used for carrying out image enhancement processing on each normalized sample bar code to obtain each enhanced sample bar code; wherein the image enhancement processing includes: at least one of brightness adjustment, contrast adjustment, rotation, and displacement;
the model training sub-module is used for training a preset initial model by utilizing each sample bar code subjected to image enhancement processing and the label of each sample bar code;
The target bar code acquisition module is specifically used for: acquiring an initial bar code to be identified, and carrying out normalization processing on the initial bar code to obtain a target bar code; the size of the target bar code is the preset size.
11. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
A memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-5 when executing a program stored on a memory.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111150180.8A CN113869077B (en) | 2021-09-29 | 2021-09-29 | Bar code identification method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111150180.8A CN113869077B (en) | 2021-09-29 | 2021-09-29 | Bar code identification method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113869077A CN113869077A (en) | 2021-12-31 |
CN113869077B true CN113869077B (en) | 2024-08-02 |
Family
ID=78992594
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111150180.8A Active CN113869077B (en) | 2021-09-29 | 2021-09-29 | Bar code identification method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113869077B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115510889B (en) * | 2022-11-01 | 2025-04-15 | 凌云光技术股份有限公司 | A barcode decoding method and device |
WO2025112057A1 (en) * | 2023-12-01 | 2025-06-05 | 深圳迈瑞生物医疗电子股份有限公司 | Sample recognition system and method, controller, and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109388999A (en) * | 2017-08-11 | 2019-02-26 | 杭州海康威视数字技术股份有限公司 | A kind of barcode recognition method and device |
CN110532825A (en) * | 2019-08-21 | 2019-12-03 | 厦门壹普智慧科技有限公司 | A kind of bar code identifying device and method based on artificial intelligence target detection |
CN111476050A (en) * | 2020-04-02 | 2020-07-31 | 北京致胜宏达科技有限公司 | Bar code identification method and device, electronic equipment and storage medium |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7007844B2 (en) * | 2003-10-02 | 2006-03-07 | Symbol Technologies, Inc. | Reader for electro-optically reading indicia through vertical window at which full coverage, omni-directional scan pattern is generated |
GB2526261B (en) * | 2014-04-28 | 2017-08-02 | Gelliner Ltd | Encoded cells and cell arrays |
CN104732183B (en) * | 2015-03-20 | 2017-06-13 | 杭州晟元数据安全技术股份有限公司 | A kind of bar code recognition methods based on the analysis of image sampling line half-tone information |
US10198648B1 (en) * | 2015-04-10 | 2019-02-05 | Digimarc Corporation | Decoding 1D-barcodes in digital capture systems |
JP2016212603A (en) * | 2015-05-07 | 2016-12-15 | 株式会社ケイオーエス | Bar code recognition device and bar code recognition method |
CN107016388B (en) * | 2017-03-02 | 2019-11-15 | 浙江华睿科技有限公司 | A kind of localization method and device in one-dimension code region |
CN109299628B (en) * | 2017-07-24 | 2021-06-18 | 杭州海康威视数字技术股份有限公司 | Bar code decoding method and device |
CN110276357A (en) * | 2019-07-01 | 2019-09-24 | 浪潮卓数大数据产业发展有限公司 | A kind of method for recognizing verification code based on convolutional neural networks |
-
2021
- 2021-09-29 CN CN202111150180.8A patent/CN113869077B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109388999A (en) * | 2017-08-11 | 2019-02-26 | 杭州海康威视数字技术股份有限公司 | A kind of barcode recognition method and device |
CN110532825A (en) * | 2019-08-21 | 2019-12-03 | 厦门壹普智慧科技有限公司 | A kind of bar code identifying device and method based on artificial intelligence target detection |
CN111476050A (en) * | 2020-04-02 | 2020-07-31 | 北京致胜宏达科技有限公司 | Bar code identification method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113869077A (en) | 2021-12-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3869385B1 (en) | Method for extracting structural data from image, apparatus and device | |
US9177238B2 (en) | Techniques for generating customized two-dimensional barcodes | |
US9208420B2 (en) | Techniques for generating customized two-dimensional barcodes | |
CN113869077B (en) | Bar code identification method and device and electronic equipment | |
WO2021031825A1 (en) | Network fraud identification method and device, computer device, and storage medium | |
US20200250469A1 (en) | Methods for optical character recognition (ocr) | |
CN107451106A (en) | Text method and device for correcting, electronic equipment | |
CN112380853A (en) | Service scene interaction method and device, terminal equipment and storage medium | |
CN110363830B (en) | Element image generation method, device and system | |
CN114005126A (en) | Table reconstruction method, apparatus, computer equipment and readable storage medium | |
CN113553847A (en) | Method, apparatus, system and storage medium for parsing address text | |
CN111865923A (en) | Method, system, device and medium for identifying abnormal behavior of Internet of things card | |
Phong et al. | An end‐to‐end framework for the detection of mathematical expressions in scientific document images | |
US11790170B2 (en) | Converting unstructured technical reports to structured technical reports using machine learning | |
US10217020B1 (en) | Method and system for identifying multiple strings in an image based upon positions of model strings relative to one another | |
CN107644245A (en) | Three value two-dimensional code generation methods, coding/decoding method and device | |
CN111159017A (en) | Test case generation method based on slot filling | |
CN110956170A (en) | Method, device, equipment and storage medium for generating passport machine-readable code sample | |
CN108108267B (en) | Data recovery method and device | |
CN110032716B (en) | Character encoding method and device, readable storage medium and electronic equipment | |
CN112149678A (en) | Character recognition method and device for special language and recognition model training method and device | |
CN118397290A (en) | Feature enhancement method, device, equipment and storage medium for image recognition | |
CN115147847B (en) | Method, device, storage medium and computer equipment for determining text recognition results | |
CN111368576A (en) | An automatic reading method of Code128 barcode based on global optimization | |
CN113626587B (en) | Text category identification method and device, electronic equipment and 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |