CN113869077A - Bar code identification method and device and electronic equipment - Google Patents

Bar code identification method and device and electronic equipment Download PDF

Info

Publication number
CN113869077A
CN113869077A CN202111150180.8A CN202111150180A CN113869077A CN 113869077 A CN113869077 A CN 113869077A CN 202111150180 A CN202111150180 A CN 202111150180A CN 113869077 A CN113869077 A CN 113869077A
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.)
Pending
Application number
CN202111150180.8A
Other languages
Chinese (zh)
Inventor
王雪
杨勇
万其明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202111150180.8A priority Critical patent/CN113869077A/en
Publication of CN113869077A publication Critical patent/CN113869077A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14131D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • 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 barcode identification method, a barcode identification device and electronic equipment, and relates to the technical field of character identification. The method comprises the following steps: acquiring a target bar code to be identified; inputting the target bar code into an identification model, and acquiring a target bar space-width ratio sequence of the target bar code output by the identification model; the identification model is obtained based on a plurality of sample barcodes and label training of each sample barcode, and the label of each sample barcode comprises: a sample bar space-width ratio sequence of the sample bar code; determining the target code system category of the target bar code according to the initial numerical value and the final numerical 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 the identification result of the target bar code; the preset code table comprises the corresponding relation of code system categories, 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

Bar code identification method and device and electronic equipment
Technical Field
The invention relates to the technical field of character recognition, in particular to a bar code recognition method, a bar code recognition device and electronic equipment.
Background
A Barcode, also called Barcode (Barcode), is a graphic identifier in which a plurality of black bars and spaces with different widths are arranged according to a certain encoding rule to express a group of information. 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 maturity and development of deep learning, when the bar code is identified and the information identified by the bar code is obtained, the bar code identification method based on deep learning is widely applied.
In the related art, decoding may be generally implemented by using an RNN (Recurrent Neural Network) or a CNN (Convolutional Neural Network). When the bar code is identified, the characters corresponding to the bar-space combination in the bar code can be directly output by using the RNN or the CNN, so that a simpler bar code identification method is provided.
However, in the related art, since the trained network can usually only recognize the bar-space combination existing in the training sample in the deep learning, the trained RNN or CNN can only recognize the bar-space combination of the barcode type used for training. Wherein, the code system type means: the type of the coding rule of the bar code, and different coding system types represent different coding rules of the bar code.
Based on this, when there is a barcode encoded by a new code type, it is necessary to add the bar-space combination of the new code type to the training sample to retrain the RNN or CNN, however, because the number of the bar-space combinations of each code system is large, the workload of retraining the RNN or CNN is large, the time consumption is large, and the flexibility of barcode recognition is affected.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for identifying a bar code 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 identification model, and acquiring a target bar space-width ratio sequence of the target bar code output by the identification model; the identification model is obtained by training a label based on a plurality of sample barcodes and each sample barcode, and the label of each sample barcode comprises: a sample bar space-width ratio sequence of the sample bar code;
determining the target code system category of the target bar code according to the initial numerical value and the final numerical value in the target bar space-width ratio sequence;
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 an identification result of the target bar code; the preset code table comprises the corresponding relation of code system categories, bar-space combinations and characters.
Optionally, in a specific implementation manner, the decoding the target barcode by using the target barcode space-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 bar-space ratio sequence to be identified of each target bar-space combination in the target bar code from the target bar-space ratio sequence according to a dividing rule of the bar-space combination corresponding to the target code system category;
determining target characters corresponding to the bar-space ratio sequences to be recognized from the corresponding relation between the bar-space ratio sequences of the bar-space combinations under the target code system category and the characters in a preset code table;
and arranging the target characters 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 number of bar spaces included in the sample barcode;
the step of inputting the target bar code into a preset identification model and acquiring a target bar space-width ratio sequence of the target bar code output by the identification model comprises the following steps:
inputting the target bar code into a preset identification model, and acquiring a target bar space width ratio sequence and the number of target code words of the target bar code output by the identification model;
before the step of determining the target code system category of the target bar code according to the starting value and the ending value in the target bar space-width ratio sequence, the method further includes:
judging whether the number of numerical values included in the target strip space-width ratio sequence is the same as the number of the target code words or not;
if the target bar code is the same as the target bar code, executing the step of determining the target code system category of the target bar code according to the initial numerical value and the final numerical value in the target bar code space-width ratio sequence;
otherwise, determining that the identification result of the identification model to the target bar code is an error result.
Optionally, in a specific implementation manner, the label of each sample barcode further includes: a sample barcode type of the sample barcode; the sample barcode type of each sample barcode is any one of a plurality of preset barcode types, and the plurality of barcode types at least include: normal code, fold code and cut code;
the step of inputting the target bar code into a preset identification model and acquiring a target bar space-width ratio sequence of the target bar code output by the identification model comprises the following steps:
inputting the target bar code into a preset identification model, and acquiring a target bar space-width ratio sequence and a target bar code type of the target bar code output by the identification model;
the step of determining the target code system category of the target bar code according to the initial numerical value and the final numerical 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 fold code, determining the target code system category of the target bar code according to the initial numerical value and the final numerical value in the target bar space-width ratio sequence;
the method further comprises the following steps:
and if the target bar code type of the target bar code is the 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 recognition model includes:
randomly generating a plurality of sample bar codes according to a preset bar-space width ratio range, and determining a label of each sample bar code;
normalizing each sample bar code to obtain each normalized sample bar code; the normalized size of each 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 using each sample bar code after image enhancement processing and a 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 identification apparatus, where the apparatus includes:
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 identification model and acquiring a target bar space-width ratio sequence of the target bar code output by the identification model; the identification model is obtained by training a label based on a plurality of sample barcodes and each sample barcode, and the label of each sample barcode comprises: 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 numerical value and the final numerical 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 the identification result of the target bar code; the preset code table comprises the corresponding relation of code system categories, bar-space combinations and characters.
Optionally, in a specific implementation manner, the decoding module is specifically configured to:
determining a bar-space ratio sequence to be identified of each target bar-space combination in the target bar code from the target bar-space ratio sequence according to a dividing rule of the bar-space combination corresponding to the target code system category;
determining target characters corresponding to the bar-space ratio sequences to be recognized from the corresponding relation between the bar-space ratio sequences of the bar-space combinations under the target code system category and the characters in a preset code table;
and arranging the target characters 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 number of bar spaces included in the sample barcode;
the output result acquisition module is specifically configured to: inputting the target bar code into a preset identification model, and acquiring a target bar space width ratio sequence and the number of target code words of the target bar code output by the identification model;
the device further comprises:
a numerical value judging module, configured to judge whether the number of numerical values included in the target bar space-width ratio sequence is the same as the number of target code words before determining the target code system category of the target bar code according to a starting numerical value and an ending numerical value in the target bar space-width ratio sequence; if the codes are the same, triggering the code system type determining module; otherwise, determining that the identification result of the identification model to the target bar code is an error result.
Optionally, in a specific implementation manner, the label of each sample barcode further includes: a sample barcode type of the sample barcode; wherein the sample barcode type of each sample barcode is any one of a plurality of preset barcode types, and the plurality of barcode types are: normal code, fold code and cut code;
the output result acquisition module is specifically configured to: inputting the target bar code into a preset identification model, and acquiring a target bar space-width ratio sequence and a target bar code type of the target bar code output by the identification model;
the code system type determining module is specifically configured to: if the target bar code type of the target bar code is a normal code or a fold code, determining the target code system category of the target bar code according to the initial numerical value and the final numerical value in the target bar space-width ratio sequence;
the device 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 target bar code type of the target bar code is the truncation 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 submodule is used for randomly generating a plurality of sample bar codes according to a preset bar-space ratio range and determining a label of each sample bar code;
the normalization processing submodule is used for performing normalization processing on each sample bar code to obtain each normalized sample bar code; the normalized size of each sample bar code is a preset size;
the image enhancement submodule is used for 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;
the model training submodule is used for training a preset initial model by utilizing each sample bar code after image enhancement processing and a label of each sample bar code;
the target barcode acquisition module 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; and 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 and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the steps of any one of the barcode identification methods provided by 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, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of any barcode identification method provided in the first aspect.
In a fifth aspect, embodiments of the present invention provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the steps of any of the barcode identification methods provided in the first aspect.
The embodiment of the invention has the following beneficial effects:
as can be seen from the above, with the scheme provided by the embodiment of the present invention, when training an identification model for performing barcode identification, the applied training samples are: each sample barcode and the sample bar space-width ratio sequence of the sample barcode. And constructing a preset code table comprising the corresponding relation of code system types, bar-space combinations and characters according to the coding rules of the preset code table under different code system types.
Therefore, when the target bar code is identified, the identification model can be used for obtaining the target bar space-width ratio sequence of the target bar code. Because the code system type of the bar code can be determined by the width ratio of the starting end to the ending end of the bar code, the target code system type of the target bar code can be determined by using the starting numerical value and the ending numerical value in the target bar space width ratio sequence. Therefore, the bar code can be decoded by using the target bar space-width ratio sequence, the target code system type and the preset code table to obtain the identification result of the target bar code.
Based on this, with the scheme provided by the embodiment of the present invention, when the target barcode is identified, the obtained identification result is obtained through the target barcode space-width ratio sequence and the preset code table, and when the identification model is trained, the training samples used are: each sample bar code and the sample bar space width ratio sequence of the sample bar code, therefore, the bar space combination of each code system type is not needed to be used as a sample, and therefore, when a new code system type exists, the bar space combination of the new code system type is not needed to be added into a training sample to retrain the recognition model, and only the preset code table needs to be expanded by using the characters corresponding to each bar space combination under the new code system type. Therefore, the workload and the time consumption for expanding the preset code table are far less than those for retraining the recognition model, and therefore the flexibility of barcode recognition can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by referring to these drawings.
Fig. 1 is a barcode identification method according to an embodiment of the present invention;
FIG. 2 is a schematic representation of a bar space ratio sequence of a barcode;
FIG. 3 is a flowchart illustrating an embodiment of S104 in FIG. 1;
FIG. 4 is a schematic flow chart illustrating a training method for recognizing a model according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating another training method for recognition models according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating another training method for recognition models according to an embodiment of the present invention;
FIG. 7 is a diagram of another method for barcode identification according to an embodiment of the present invention;
FIG. 8 is a block diagram of another method for barcode identification according to an embodiment of the present invention;
FIG. 9 is a diagram of another method for barcode identification according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a barcode identification apparatus 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 a recognition model according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
In the related art, decoding may be generally implemented using RNN or CNN. In deep learning, the trained network can only recognize the bar-space combination existing in the training sample, so the trained RNN or CNN can only recognize the bar-space combination of the code system type of each barcode used for training. Based on this, when there is a barcode encoded by a new code type, it is necessary to add the bar-space combination of the new code type to the training sample to retrain the RNN or CNN, however, because the number of the bar-space combinations of each code system is large, the workload of retraining the RNN or CNN is large, the time consumption is large, and the flexibility of barcode recognition is affected.
In order to solve the above technical problem, an embodiment of the present invention provides a barcode identification method.
The method may be applied to any application scenario in which a barcode needs to be identified, such as commodity logistics, book management, postal management, and the like, but is not limited thereto. Moreover, the method can be applied to various electronic devices such as mobile phones, tablet computers, gates and the like, and the embodiment of the invention is not particularly limited. Hereinafter, the execution subject of the method is collectively referred to as an electronic apparatus.
The barcode identification method provided by the embodiment of the invention can comprise the following steps:
acquiring a target bar code to be identified;
inputting the target bar code into a preset identification model, and acquiring a target bar space-width ratio sequence of the target bar code output by the identification model; the identification model is obtained by training a label based on a plurality of sample barcodes and each sample barcode, and the label of each sample barcode comprises: a sample bar space-width ratio sequence of the sample bar code;
determining the target code system category of the target bar code according to the initial numerical value and the final numerical value in the target bar space-width ratio sequence;
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 an identification result of the target bar code; the preset code table comprises the corresponding relation of code system categories, bar-space combinations and characters.
As can be seen from the above, with the scheme provided by the embodiment of the present invention, when training an identification model for performing barcode identification, the applied training samples are: and each sample bar code and the sample bar space width ratio sequence of the sample bar code, wherein under different code system types, a preset code table comprising the corresponding relation of code system types, bar space combinations and characters can be constructed according to the coding rules.
Therefore, when the target bar code is identified, the identification model can be used for obtaining the target bar space-width ratio sequence of the target bar code. Because the code system type of the bar code can be determined by the width ratio of the starting end to the ending end of the bar code, the target code system type of the target bar code can be determined by using the starting numerical value and the ending numerical value in the target bar space width ratio sequence. Therefore, the bar code can be decoded by using the target bar space-width ratio sequence, the target code system type and the preset code table to obtain the identification result of the target bar code.
Based on this, with the scheme provided by the embodiment of the present invention, when the target barcode is identified, the obtained identification result is obtained through the target barcode space-width ratio sequence and the preset code table, and when the identification model is trained, the training samples used are: each sample bar code and the sample bar space width ratio sequence of the sample bar code, therefore, the bar space combination of each code system type is not needed to be used as a sample, and therefore, when a new code system type exists, the bar space combination of the new code system type is not needed to be added into a training sample to retrain the recognition model, and only the preset code table needs to be expanded by using the characters corresponding to each bar space combination under the new code system type. Therefore, the workload and the time consumption for expanding the preset code table are far less than those for retraining the recognition model, and therefore the flexibility of barcode recognition can be improved.
The following describes a barcode identification method according to an embodiment of the present invention with reference to the accompanying drawings.
Fig. 1 is a barcode identification method according to an embodiment of the present invention, as shown in fig. 1, the method may include the following steps S101 to S104:
s101: acquiring a target bar code to be identified;
when performing barcode recognition, the electronic device may first acquire a target barcode to be recognized. The electronic device can acquire the target bar code to be identified in various ways.
For example, the electronic device may acquire an image of the target barcode through the installed image acquisition device to obtain the target barcode; for another example, the electronic device may scan an image of the target barcode through the installed barcode scanning device to obtain the target barcode; for another example, the electronic device may directly acquire a target barcode or the like transmitted by another electronic device to be communicated. The embodiment of the present invention is not particularly limited.
S102: inputting the target bar code into a preset identification model, and acquiring a target bar space-width ratio sequence of the target bar code output by the identification model;
the identification model is obtained based on a plurality of sample barcodes and label training of each sample barcode, and the label of each sample barcode comprises: a sample bar space-width ratio sequence of the sample bar code;
the bar code is a graphic identifier which is used 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 completely the same. In this way, the widths of each black bar and each blank in the bar code can be determined in sequence from the start end of the bar code to the end of the bar code, so that the bar-to-blank width ratio sequence of the bar code is determined according to the proportional relationship 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 numerical values, the initial numerical value corresponds to the initial end of the bar code, and the termination numerical value corresponds to the termination end of the bar code. And the values from the starting value to the ending value in the bar space width ratio sequence sequentially correspond to the black bars or the blanks from the starting end to the ending end in the bar code respectively. Thus, any two values in the bar-space width ratio sequence are the width ratio of the black bar or the space corresponding to the two values in the bar code.
For example, as shown in fig. 2, the combination of the upper black bar and the blank is a bar code, and the lower number sequence is the bar-to-space ratio sequence of the bar code.
After the target bar code to be recognized is obtained, the electronic device can input the target bar code into a preset recognition model, so that the recognition model can learn the bar code characteristics of the target bar code, and thus, the output result of the recognition model can be obtained.
The identification model is obtained by training based on a plurality of sample barcodes and the sample barcode space-width ratio sequence of each sample barcode, so that after the identification model learns the barcode features of the target barcode, the output result is as follows: a target bar space-width ratio sequence of a target barcode.
For clarity, the training method of the recognition model will be illustrated later.
S103: determining the target code system category of the target bar code according to the initial numerical value and the final numerical value in the target bar space-width ratio sequence;
in different application scenarios, the barcodes may be generated according to different encoding rules, each encoding rule may be referred to as a symbology type, that is, there are multiple symbology 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 identification 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 type of the code system for each type of the code system, and the set width ratios are different for different types of the code system.
Based on this, for each code type, the width ratio of the start and end sections of each barcode generated according to the code type is the same and fixed, while for different code types, the width ratio of the start and end sections of each barcode generated according to different code types is different.
That is, there is a one-to-one correspondence between the width ratio of the start end to 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 to the end of the barcode.
The initial value and the end value in the target bar space-width ratio sequence of the target bar code correspond to the initial end and the end of the target bar code respectively, so that the ratio of the initial value and the end value in the target bar space-width ratio sequence is the width ratio of the initial end and the end of the target bar code.
Thus, after the target bar space-width ratio sequence of the target bar code is obtained by using the identification model, the target code system category of the target bar code can be determined according to the initial value and the final value in the target bar space-width ratio sequence of the target bar code.
That is, the ratio of the start value to the end value in the target bar space-width ratio sequence may be determined, and then the code system type corresponding to the ratio is determined according to the corresponding relationship between the width ratio of the start end to the end of the barcode and the code system type of the barcode, and the determined code system type is the target code system type of the target barcode.
S104: 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 the identification result of the target bar code;
the preset code table comprises the corresponding relation of code system categories, bar-space combinations and characters.
The bar code is composed of a plurality of black bars and a plurality of blanks, and the plurality of black bars and the plurality of blanks composing the bar code form a plurality of bar-blank combinations according to the coding type of the bar code, so that the information expressed by the bar code is the information expressed by the characters respectively corresponding to the plurality of bar-blank combinations in the bar code.
That is, the barcode is represented by information of each of the included bar space combinations. Therefore, when the bar code is decoded to obtain the identification result of the bar code, the bar-space combination included in the bar code needs to be determined first.
Each of the code system categories has a plurality of bar-space combinations, and under different code system categories, each of the bar-space combinations corresponds to each of the characters. In this way, for each code system category, the various bar-space combinations that the code system category has and the characters that the various bar-space combinations under the code system category correspond to can be determined, so as to establish the corresponding relationship among the code system category, the bar-space combinations and the characters, for example, as shown in table 1. Further, a preset code table including a correspondence relation with respect to the code system category, the bar-space combination, and the character may be generated.
TABLE 1
Figure BDA0003286711460000121
Therefore, after the target code system type of the target bar code is obtained, the corresponding relation between the bar-space combination and the character under the target code system type can be determined in the preset code table.
Furthermore, the target bar space-width ratio sequence of the target barcode may represent the width ratio of each black bar and blank included in the target barcode, so that each bar space combination included in the target barcode may be determined according to the target bar space-width ratio sequence.
When the corresponding relation between the bar-space combination and the character in the target code system type and each bar-space combination included in the target bar code are determined, the character corresponding to each bar-space combination included in the target bar code can be determined from the corresponding relation between the bar-space combination and the character in the target code system type, and the identification result of the target bar code is determined according to each determined character.
That is, after the target bar space-width ratio sequence and the target code system type of the target bar code are determined, the target bar code can be decoded by using the target bar space-width ratio sequence, the target code system type and the preset code table to obtain the identification 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: determining a bar-space ratio sequence to be identified of each target bar-space combination in the target bar code from the target bar-space ratio sequence according to a dividing rule of the bar-space combination corresponding to the target code system category;
s1042: determining target characters corresponding to the bar-space ratio sequences to be recognized from the corresponding relation between the bar-space ratio sequences of the bar-space combinations under the target code system category and the characters in a preset code table;
s1043: and arranging the target characters 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 barcode types correspond to the division rules of different bar-space combinations, so that the bar-space combinations included in the barcodes generated according to different barcode types can be determined according to different division rules. The division rule of the stripe-space combination corresponding to each code system type may be: under the code system type, each bar-space combination comprises the number of black bars and spaces.
For example, the division rule of the stripe-space combination corresponding to the code system type a is as follows: two black bars and two blanks, that is, two continuous black bars and two blanks can be sequentially divided into a bar-blank combination from the start end of the barcode until the bar-blank combination is divided to the end of the barcode, for the barcode generated according to the barcode type a.
In each code type, the various bar space combinations of the code type respectively correspond to different characters, so that after the bar space combinations included in the bar code are obtained through division, the characters corresponding to the bar space combinations obtained through division in the bar code can be further determined according to the corresponding relation between the bar space combinations and the characters in the code type for generating the bar code, and the identification result of the bar code is obtained according to the determined characters.
Among them, since the black bars and spaces constituting the bar code may have various width ratios, the black bars and spaces in the bar-space combination in the bar code may also have various width ratios. Thus, for each code type, the various bar-space combinations that the code type has can be represented by the width ratio sequence of the black bars and the spaces in the various bar-space combinations.
That is, in this specific implementation manner, the correspondence between the bar-space combination and the character in each code system category included in the preset code table is the correspondence between the width ratio sequence of the black bar and the space in the bar-space combination in each code system category and the character.
In this way, after each bar-space combination in the bar code is obtained through division, the character corresponding to each bar-space combination can be determined from the corresponding relationship between the bar-space combination and the character in the code system type generating the entry according to the width ratio sequence of the black bar and the blank in each bar-space combination, and the identification result of the bar code can be further determined according to the determined character.
Thus, after the target code system type of the target bar code is determined, the bar-space ratio sequence to be identified of each target bar-space combination in the target bar code can be determined from the target bar-space ratio sequence according to the bar-space combination division rule corresponding to the target code system type.
Optionally, each numerical value in the target bar space-width ratio sequence corresponds to one black bar or blank in the target bar code, the target bar space-width ratio sequence may be directly divided according to the division rule of the bar space combination corresponding to the target code system category, and thus each divided bar space-width ratio sequence is the bar space-width ratio sequence to be identified of each target bar space combination in the target bar code.
In the target bar code, black bars and blanks are arranged at intervals, and the start end and the end section of the target bar code are both black bars, so that the direct division of the target bar blank width ratio sequence according to the division rule of the bar blank combination corresponding to the target code system category means that: under the code system type, the sum of the number of black bars and blanks included in each bar-space combination is divided into a bar-space ratio sequence to be identified in sequence from the initial numerical value of the target bar-space ratio sequence until the final numerical value of the target bar-space ratio sequence is obtained.
For example, the target code system category of the target barcode is a, and the rule for dividing the barcode space combination corresponding to the code system type a is as follows: two black bars and two blanks, starting from the initial value of the target bar space-width ratio sequence of the target bar code, dividing the 1 st to 4 th numerical values into a bar space-width ratio sequence to be identified, dividing the 5 th to 8 th numerical values into a bar space-width ratio sequence to be identified, and dividing the 9 th to 12 th numerical values into a bar space-width ratio sequence to be identified until the final numerical value of the target bar space-width ratio sequence is obtained.
Optionally, each numerical value in the target bar-space ratio sequence corresponds to one black bar or blank in the target bar code, the target bar code may be divided according to a division rule of the bar-space combination corresponding to the category of the target code system to obtain each target bar-space combination included in the target bar code, further, for each target bar-space combination obtained by division, a numerical value corresponding to each black bar and each blank in the target bar-space combination is determined from the target bar-space ratio sequence, and a numerical value sequence obtained by sequentially arranging the numerical values 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 is the bar-space ratio sequence to be identified of the target bar-space combination.
After the bar-space ratio sequence to be recognized of each target bar-space combination in the target bar code is obtained, the target characters corresponding to the bar-space ratio sequence to be recognized of each target bar-space combination can be determined in the corresponding relation between the bar-space ratio sequence of the bar-space combination under the category of the target code system and the characters in the preset code table.
Furthermore, the target characters corresponding to the bar space-width ratio sequences to be recognized can be sequentially arranged according to the arrangement sequence of the bar space-width ratio sequences to be recognized in the target bar space-width ratio sequences. Thus, after the arrangement is completed, the obtained character string is the identification result of the target bar code.
Based on this, with the scheme provided by the embodiment of the present invention, when the target barcode is identified, the obtained identification result is obtained through the target barcode space-width ratio sequence and the preset code table, and when the identification model is trained, the training samples used are: each sample bar code and the sample bar space width ratio sequence of the sample bar code, therefore, the bar space combination of each code system type is not needed to be used as a sample, and therefore, when a new code system type exists, the bar space combination of the new code system type is not needed to be added into a training sample to retrain the recognition model, and only the preset code table needs to be expanded by using the characters corresponding to each bar space combination under the new code system type. Therefore, the workload and the time consumption for expanding the preset code table are far less than those for retraining the recognition model, and therefore the flexibility of barcode recognition can be improved.
Next, an example of the training method of the recognition model will be described.
Optionally, in a specific implementation manner, as shown in fig. 4, a training manner of a recognition model provided in the embodiment of the present invention may include the following steps S401 to S403:
s401: obtaining a plurality of sample bar codes and determining a label of each sample bar code;
s402: training a preset initial model by utilizing a plurality of sample barcodes and a label of each sample barcode;
s403: and when the preset stopping condition is met, stopping training to obtain the trained recognition model.
In this particular implementation, a plurality of sample barcodes may be acquired first. The electronic device may obtain the plurality of sample barcodes in a plurality of ways, which is not limited in the embodiments of the present invention.
Optionally, the electronic device may directly obtain each barcode existing in the application scene as a sample barcode, for example, may obtain barcodes on various goods in a supermarket as sample barcodes; further, for example, it is reasonable to acquire barcodes on various tickets such as air tickets as sample barcodes.
Optionally, the electronic device can 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 codes can be preset, and therefore 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 stripe-space width ratio range is 1, and the maximum value is: the ratio of the width between the widest black bar or space that can appear in a barcode and the narrowest black bar or space that can appear.
For example, a bar to space width ratio in the range of 1-9, the ratio of the width between the widest black bar or space that can appear in a bar code and the narrowest black bar or space that can appear is 9.
Of course, the above-mentioned ranges 1 to 9 are merely illustrative and not restrictive, and other ranges of the bar-space ratio meeting the requirements of the application scenario are also within the protection scope of the present invention.
Optionally, under the condition that the bar space width ratio range in the sample bar codes is preset, each code system category 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 code system category.
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, an intercept code, and the like, may be set, so that the electronic device may 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 barcodes are obtained, for each sample barcode, the width ratio of each black bar and each blank included in the sample barcode can be determined, a sample bar blank width ratio sequence of each sample barcode is obtained, and the sample bar blank width ratio sequence of each sample barcode is used as a label of the sample.
In this way, the preset initial model can be trained using the plurality of sample barcodes and the label of each sample barcode.
The electronic equipment can take each sample barcode and the label of the sample barcode as a training sample, so that a plurality of training samples determined according to the plurality of sample barcodes and the label of each sample barcode are input into a preset initial model for sequence, and then the identification model is obtained.
The initial model may be a deep learning network such as RNN, CNN, or a machine learning model such as a decision tree and a support vector machine, and thus, the specific type of the initial model is not limited in the embodiment of the present invention.
In the training process, the initial model can learn the bar code characteristics of the sample bar codes and output a sample bar space width ratio sequence of the sample bar codes, the initial model can gradually establish the corresponding relation between the bar code characteristics and the bar space width ratio sequence through learning a large number of sample bar codes, and then, when the preset training stopping condition is met, the training is stopped, and the trained recognition model is obtained.
Optionally, the stop condition may be: the iteration times of the training samples reach the preset times.
Optionally, the stop condition may be: and the loss value of the initial model is smaller than a preset loss value threshold value.
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 entry 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 entry to serve as the loss value of the initial model. And when the loss value of the initial model is smaller than the preset loss value threshold, determining that the preset stop condition is met, and stopping training to obtain the trained recognition model.
Therefore, the trained recognition model can be used for learning the target bar code and outputting a target bar space-width ratio sequence of the target bar code.
That is, the electronic device may input the target barcode into the obtained recognition model for learning, and the recognition model may further output the target barcode target bar space-width ratio sequence. When the identification 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 also obtain the target bar space-width ratio sequence of the target bar code.
In addition, the electronic device for training the recognition model and the electronic device for executing the barcode recognition 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 specifically.
In many cases, the sizes of the sample barcodes acquired by the electronic device are different, so that, 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, optionally, in a specific implementation manner, as shown in fig. 5, the training manner of the recognition model provided in the embodiment of the present invention may further include the following step S404:
s404: normalizing each sample bar code to obtain each normalized sample bar code;
the normalized size of each sample bar code is a preset size;
accordingly, in this specific implementation manner, in the step S402, the training of the preset initial model by using the plurality of sample barcodes and the label of each sample barcode may include the following steps S402A:
s4021: and training the preset initial model by using the normalized sample bar codes and the label of each sample bar code.
In this specific implementation manner, 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, and the size of each sample barcode after normalization is the preset size.
The normalization processing of the bar codes of the samples refers to the normalization processing of the bar codes of the samples; and through scaling processing, the sizes of the sample barcodes are unified into the same size.
For each 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 is determined. Further, it is possible to determine whether to reduce or enlarge the sample barcode such that the size of the sample barcode after the reduction or enlargement processing is the predicted size, based on the determined size relationship.
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 through reduction processing, 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, the sample bar code can be amplified through amplification processing, so that the size of the amplified 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 being processed.
Therefore, after normalization processing is carried out on the sample bar codes to obtain the normalized sample bar codes, the normalized sample bar codes and the labels of the sample bar codes can be used for training the preset initial model.
The specific implementation manner of step S4021 is similar to that of step S402, and is not described herein again.
In addition, in many cases, the image quality of some sample barcodes acquired by the electronic device may be poor, for example, the image brightness is low, the barcodes are tilted, and the like, so that the acquired sample barcodes may be subjected to image enhancement processing in order to improve the recognition accuracy and generalization of the trained recognition model.
Based on this, optionally, in a specific implementation manner, as shown in fig. 6, the training manner of the recognition model provided in 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 specific implementation manner, the step S4021 of 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 the preset initial model by using each sample bar code after image enhancement processing and the label of each sample bar code.
In this specific implementation, 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 barcode after normalization, one of the brightness adjustment, the contrast adjustment, the rotation, and the displacement may be used, or a plurality of the brightness adjustment, the contrast adjustment, the rotation, and the displacement may be used. Of course, when the normalized sample barcodes are subjected to image enhancement processing, the processing method used is not limited to this.
The rotation means: rotating the sample bar code in the inclined posture to enable the sample bar code to be in a normal posture;
the displacement means: the position of the sample barcode in the image is moved to be at the position specified in the image. For example, the sample barcode on the left side of the image is moved to be in the center of the image.
In this way, after the normalized sample barcodes are subjected to image enhancement processing to obtain the sample barcodes subjected to image enhancement processing, the preset initial model can be trained by using the sample barcodes subjected to image enhancement processing and the labels of the sample barcodes.
The specific implementation manner of step S4021A is similar to that of step S402, and is not described herein again.
Optionally, in another specific implementation manner, on the basis of the specific implementation manner shown in fig. 4, the training manner of the recognition model provided in the embodiment of the present invention may further include the following step 11:
step 11: carrying out 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 specific implementation manner, in the step S402, the training of 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 the preset initial model by using each sample bar code after image enhancement processing and the label of each sample bar code.
In this specific implementation manner, after the electronic device acquires each sample barcode, the electronic device may only perform image enhancement processing on each sample barcode to obtain each sample barcode after the image enhancement processing, and then train the preset initial model by directly using each sample barcode after the image enhancement processing and the tag of each sample barcode.
The specific implementation manner of step 11 is similar to the specific implementation manner of step S405, and the specific implementation manner of step 12 is similar to the specific implementation manner of step S402, and is not described herein again.
Optionally, in a specific implementation manner, on the basis of the specific implementation manners shown in fig. 4 to fig. 6, the training manner of the recognition model provided in the 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 a label of each sample bar code;
step 22: normalizing each sample bar code to obtain each normalized sample bar code;
the normalized size of each 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 the preset initial model by using each sample bar code after image enhancement processing and the label of each sample bar code.
On the basis of the specific implementation manners shown in fig. 5 and fig. 6, in order to improve the recognition accuracy of the recognition model for 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 normalized sample bar code 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 recognized may not be a preset size, and therefore, the acquired barcode to be recognized may be resized to obtain a target barcode having a size of the preset size.
Based on this, optionally, in a specific implementation manner, on the basis of the specific implementation manners shown in fig. 5 and fig. 6, the step S101 of acquiring 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;
wherein, the size of the target bar code is a preset size.
In this specific implementation manner, in order to obtain a target barcode with a size of a preset size, after obtaining an initial barcode to be identified, normalization processing may be performed on the initial barcode to obtain the target barcode with the size of the preset size.
Wherein, the normalization processing on the initial is performed; and adjusting the size of the initial bar code to a preset size through scaling processing.
For the initial barcode, the size of the initial barcode may be determined first, and then, the size relationship between the size of the initial barcode and the preset size is determined. Further, it is possible to determine whether or not to perform reduction or enlargement processing on the initial barcode based on the determined size relationship such that the size of the initial barcode after the reduction or enlargement processing 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 processing, so that the size of the reduced initial bar code is the preset size; if the size of the initial bar code is smaller than the preset size, the initial bar code can be amplified through amplification processing, so that the size of the amplified 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 being processed.
On the basis of the various specific implementation manners, in some cases, in order to improve accuracy and efficiency of barcode recognition, in training the recognition model, the tag of the sample barcode used may further include other information used for representing barcode features of the sample barcode, for example, the number of codewords of the sample barcode and the type of the barcode.
Based on this, optionally, in a specific implementation manner, on the basis of the various specific implementation manners, the tag of each sample barcode may further include: the number of sample code words of the sample bar code; wherein, the number of code words of each sample is: the sample barcode includes the number of bar spaces, i.e., the sum of the number of black bars and spaces included in the sample barcode. Therefore, 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 specific implementation manner, a plurality of sample barcodes, and tags of each sample barcode including the sample barcode space width ratio sequence and the sample codeword number are used to train the initial model to obtain an identification model, which is similar to the specific implementation manner shown in fig. 4 and will not be described herein again.
Accordingly, in this specific implementation manner, as shown in fig. 7, the step S102 of inputting the target barcode into the preset identification model and acquiring the target barcode space-width ratio sequence of the target barcode output by the identification model may include the following steps S1021:
s1021: inputting the target bar code into a preset identification model, and acquiring a target bar space-width ratio sequence and the number of target code words of the target bar code output by the identification model;
furthermore, as shown in fig. 7, the barcode identification method provided in the embodiment of the present invention may further include the following steps S105 and S106:
s105: judging whether the number of numerical values included in the target strip space-width ratio sequence is the same as the number of target code words or not; if yes, go to step S103; otherwise, go to step S106;
s106: and determining that the recognition result of the target bar code by the recognition model is an error result.
In this specific implementation manner, since the identification model may further establish a corresponding relationship between the barcode features and the number of codewords, when the identification model learns the target barcode, the identification model may output a target barcode space-width ratio sequence and a target barcode number, where the target barcode number is: the target barcode includes a number of bar spaces.
For the same target bar code, each numerical value in the target bar space-width ratio sequence of the target bar code corresponds to a black bar or a blank in the target bar code, so the number of numerical values included in the target bar space-width ratio sequence output by the identification model and the number of target code words should be the same.
Based on this, after the target strip space-width ratio sequence and the number of target code words output by the identification model are obtained, the electronic device may first determine whether the number of numerical values included in the target strip space-width ratio sequence is the same as the number of target code words.
If the determination results are the same, it may be determined that the identification of the target barcode by the identification model is accurate, and thus, the electronic device may continue to execute the step S103, and finally obtain the identification result of the target barcode.
On the contrary, if the determination results are different, it may be determined that the identification of the target barcode by the identification model is wrong, and at least one of the target barcode space-width ratio sequence and the target codeword number output by the identification model is wrong, so that the electronic device may determine that the identification result of the target barcode by the identification model is a wrong result.
Optionally, under the condition that 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, after determining that the identification result of the identification model on the target bar code is an error result, the electronic device may further output prompt information indicating that the identification model has an error in identifying the target bar code.
For example, the electronic device may output the prompt information indicating that the recognition model has a wrong recognition to the target barcode in various manners such as voice, text, and warning light, but is not limited thereto.
On the basis of the various specific implementations described above, in some cases, the obtained target barcode may not be a normal code, for example, an intercepted code including only a partial bar space, a wrinkled code with distortion, and the like, where for the intercepted code, the identification result of the target barcode cannot be obtained, and for the wrinkled code, after learning the barcode features, the identification result of the target barcode may be obtained.
Based on this, optionally, in a specific implementation manner, on the basis of the various specific implementation manners, the tag of each sample barcode may further include: a sample barcode type of the sample barcode.
The sample barcode type of each sample barcode is any one of a plurality of preset barcode types, and the plurality of barcode types at least include: normal code, wrinkled code, and truncated code, that is, the sample barcode type of each sample barcode may be normal code, wrinkled code, or truncated code.
Wherein, the fold code is: distorted but recognizable barcodes; the truncation code means: barcodes that include only partial bar spaces, but not all bar spaces; the normal code means: including barcodes where all bars are empty and there is no distortion.
Therefore, when the recognition model is trained, the corresponding relation between the barcode characteristics and the barcode types can be established in the recognition 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 similar to the specific implementation manners shown in fig. 4 to 6, and details are not repeated here, so that a plurality of sample bar codes and the label of each sample bar code, which includes the sample bar space-width ratio sequence and the sample bar code type, are used to train the initial model to obtain the identification model.
Correspondingly, in this specific implementation manner, as shown in fig. 8, the step S102 of inputting the target barcode into the preset identification model and acquiring the target barcode space-width ratio sequence of the target barcode output by the identification model may include the following steps S1022:
s1022: inputting the target bar code into a preset identification model, and acquiring a target bar space-width ratio sequence and a target bar code type of the target bar code output by the identification model;
furthermore, as shown in fig. 8, the step S103 of determining the target code system type of the target barcode according to the start value and the end value in the target barcode space-width ratio sequence may include the following steps S1031:
s1031: if the target bar code type of the target bar code is a normal code or a fold code, determining the target code system type of the target bar code according to the initial numerical value and the final numerical value in the target bar space-width ratio sequence;
furthermore, as shown in fig. 8, the barcode identification method provided in the embodiment of the present invention may further include the following step S107:
s107: and if the target bar code type of the target bar code is the cut-off code, determining that the identification result of the target bar code cannot be obtained.
In the specific implementation manner, since the corresponding relationship between the barcode features and the barcode types can be established in the identification model, the identification model can output the target barcode space-width ratio sequence and the target barcode type when learning the target barcode.
Since the electronic device cannot decode the target barcode to obtain the identification result of the target barcode when the barcode type of the target barcode is the truncated code, the electronic device does not need to perform the subsequent steps S103 and S104 when the barcode type of the target barcode is the truncated code.
Based on this, after the target barcode type output by the identification model is obtained, if the target barcode type of the target barcode is a normal code or a fold code, the electronic device may continue to determine the target barcode system type of the target barcode according to the initial value and the final value in the target barcode space-width ratio sequence, and finally obtain the identification result of the target barcode.
On the contrary, after the target barcode type output by the identification model is obtained, if the target barcode type of the target barcode is the intercept code, the electronic device can directly determine that the identification result of the target barcode cannot be obtained.
Optionally, when the type of the target barcode is the truncated code, the electronic device may further output a prompt message indicating that the identification result of the target barcode cannot be obtained after determining that the identification 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 barcode cannot be obtained in various manners such as voice, text, and warning light, but is not limited thereto.
Optionally, in a specific implementation manner, on the basis of the specific implementation manners 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 sample bar code.
For example, as shown in fig. 12, a schematic diagram of a training process for training a recognition model in the present embodiment is shown; wherein, the training picture is: a picture including a sample barcode, and the picture corresponding label is: a label for a sample barcode included in a picture, the label comprising: the bar space information, the bar code type and the number of code words of the sample bar code included in the picture; wherein, the bar space information is: sample strip space-width ratio sequence.
Therefore, 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, 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 train to obtain the identification model.
In the training process, a gradient descent method can be adopted for training, a converged available identification model is obtained through final training, and in the training process, a total of three branches can be provided, and the bar space information, the bar code type and the number of code words of the bar code are predicted through a Softmax (normalization) function or an L2 (square) loss function respectively. Optionally, the barcode types may include: normal code, truncated code, and fold code.
Based on this, in this specific implementation manner, as shown in fig. 9, a barcode identification method provided in 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 identification model, and acquiring a target bar space width ratio sequence, the number of target code words and the type of the bar code of the target bar code output by the identification model;
s903: if the target bar code type of the target bar code is the 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 fold code, judging whether the number of numerical values included in the target bar space-width ratio sequence is the same as the number of target code words; if not, executing step S905; if the two are the same, executing step S906;
s905: determining that the recognition result of the recognition model on the target bar code is an error result;
s906: determining the target code system category of the target bar code according to the initial numerical value and the final numerical value in the target bar space-width ratio sequence;
s907: and decoding the target bar code by utilizing the target bar space-width ratio sequence, the target code system category and the preset code table to obtain the identification result of the target bar code.
Each step in the specific implementation manner shown in fig. 9 is the same as or similar to the specific implementation manner of each corresponding step in the specific implementation manner, and is not described herein again. 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 is not described again here.
Corresponding to the barcode identification method provided by the embodiment of the invention, the embodiment of the invention also provides a barcode identification device.
Fig. 10 is a schematic structural diagram of a barcode identification apparatus according to an embodiment of the present invention, and as shown in fig. 10, the apparatus may include the following modules:
a target barcode acquisition module 1001 configured to acquire a target barcode to be identified;
an output result obtaining module 1002, configured to input the target barcode into a preset identification model, and obtain a target barcode space-width ratio sequence of the target barcode output by the identification model; the identification model is obtained by training a label based on a plurality of sample barcodes and each sample barcode, and the label of each sample barcode comprises: 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 starting numerical value and a terminating numerical value in the target barcode space-width ratio sequence;
a decoding module 1004, configured to decode the target barcode by using the target barcode space-width ratio sequence, the target code system category, and a preset code table, so as to obtain an identification result of the target barcode; the preset code table comprises the corresponding relation of code system categories, bar-space combinations and characters.
Based on this, with the scheme provided by the embodiment of the present invention, when the target barcode is identified, the obtained identification result is obtained through the target barcode space-width ratio sequence and the preset code table, and when the identification model is trained, the training samples used are: each sample bar code and the sample bar space width ratio sequence of the sample bar code, therefore, the bar space combination of each code system type is not needed to be used as a sample, and therefore, when a new code system type exists, the bar space combination of the new code system type is not needed to be added into a training sample to retrain the recognition model, and only the preset code table needs to be expanded by using the characters corresponding to each bar space combination under the new code system type. Therefore, the workload and the time consumption for expanding the preset code table are far less than those for retraining the recognition model, and therefore the flexibility of barcode recognition can be improved.
Optionally, in a specific implementation manner, the decoding module 1004 is specifically configured to:
determining a bar-space ratio sequence to be identified of each target bar-space combination in the target bar code from the target bar-space ratio sequence according to a dividing rule of the bar-space combination corresponding to the target code system category;
determining target characters corresponding to the bar-space ratio sequences to be recognized from the corresponding relation between the bar-space ratio sequences of the bar-space combinations under the target code system category and the characters in a preset code table;
and arranging the target characters 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 number of bar spaces included in the sample barcode;
the output result obtaining module 1002 is specifically configured to: inputting the target bar code into a preset identification model, and acquiring a target bar space width ratio sequence and the number of target code words of the target bar code output by the identification model;
the device further comprises:
a numerical value judging module, configured to judge whether the number of numerical values included in the target bar space-width ratio sequence is the same as the number of target code words before determining the target code system category of the target bar code according to a starting numerical value and an ending numerical value in the target bar space-width ratio sequence; if the codes are the same, the code system type determining module 1003 is triggered; otherwise, determining that the identification result of the identification model to the target bar code is an error result.
Optionally, in a specific implementation manner, the label of each sample barcode further includes: a sample barcode type of the sample barcode; the sample barcode type of each sample barcode is any one of a plurality of preset barcode types, and the plurality of barcode types at least include: normal code and truncated code;
the output result obtaining module 1002 is specifically configured to: inputting the target bar code into a preset identification model, and acquiring a target bar space-width ratio sequence and a target bar code type of the target bar code output by the identification model;
the code system type determining module 1003 is specifically configured to: if the target bar code type of the target bar code is a normal code, determining the target code system type of the target bar code according to the initial numerical value and the final numerical value in the target bar code space-width ratio sequence;
the device 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 target bar code type of the target bar code is the truncation 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 submodule is used for randomly generating a plurality of sample bar codes according to a preset bar-space ratio range and determining a label of each sample bar code;
the normalization processing submodule is used for performing normalization processing on each sample bar code to obtain each normalized sample bar code; the normalized size of each sample bar code is a preset size;
the image enhancement submodule is used for 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;
the model training submodule is used for training a preset initial model by utilizing each sample bar code after image enhancement processing and a 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; and the size of the target bar code is the preset size.
Corresponding to the barcode identification method provided by the above embodiment of the present invention, an 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 mutual communication through the communication bus 1104,
a memory 1103 for storing a computer program;
the processor 1101 is configured to implement the steps of any barcode identification method provided in the above embodiments of the present invention when executing the program stored in the memory 1103.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a 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 processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the barcode identification methods provided in the embodiments of the present invention.
In another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the steps of any of the barcode identification methods provided in the embodiments of the present invention described above.
In the above embodiments, the implementation may be wholly or partially realized 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, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, apparatus embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are described for simplicity because they are substantially similar to method embodiments, as may be found in some descriptions of method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A method of barcode identification, the method comprising:
acquiring a target bar code to be identified;
inputting the target bar code into a preset identification model, and acquiring a target bar space-width ratio sequence of the target bar code output by the identification model; the identification model is obtained by training a label based on a plurality of sample barcodes and each sample barcode, and the label of each sample barcode comprises: a sample bar space-width ratio sequence of the sample bar code;
determining the target code system category of the target bar code according to the initial numerical value and the final numerical value in the target bar space-width ratio sequence;
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 an identification result of the target bar code; the preset code table comprises the corresponding relation of code system categories, bar-space combinations and characters.
2. The method according to claim 1, wherein the step of decoding the target barcode by using the target barcode space-width ratio sequence, the target code system category and a preset code table to obtain the identification result of the target barcode comprises:
determining a bar-space ratio sequence to be identified of each target bar-space combination in the target bar code from the target bar-space ratio sequence according to a dividing rule of the bar-space combination corresponding to the target code system category;
determining target characters corresponding to the bar-space ratio sequences to be recognized from the corresponding relation between the bar-space ratio sequences of the bar-space combinations under the target code system category and the characters in a preset code table;
and arranging the target characters 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 labeling 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 number of bar spaces included in the sample barcode;
the step of inputting the target bar code into a preset identification model and acquiring a target bar space-width ratio sequence of the target bar code output by the identification model comprises the following steps:
inputting the target bar code into a preset identification model, and acquiring a target bar space width ratio sequence and the number of target code words of the target bar code output by the identification model;
before the step of determining the target code system category of the target bar code according to the starting value and the ending value in the target bar space-width ratio sequence, the method further includes:
judging whether the number of numerical values included in the target strip space-width ratio sequence is the same as the number of the target code words or not;
if the target bar code is the same as the target bar code, executing the step of determining the target code system category of the target bar code according to the initial numerical value and the final numerical value in the target bar code space-width ratio sequence;
otherwise, determining that the identification result of the identification model to the target bar code is an error result.
4. The method of any one of claims 1-3, wherein the labeling of each sample barcode further comprises: a sample barcode type of the sample barcode; the sample barcode type of each sample barcode is any one of a plurality of preset barcode types, and the plurality of barcode types at least include: normal code, fold code and cut code;
the step of inputting the target bar code into a preset identification model and acquiring a target bar space-width ratio sequence of the target bar code output by the identification model comprises the following steps:
inputting the target bar code into a preset identification model, and acquiring a target bar space-width ratio sequence and a target bar code type of the target bar code output by the identification model;
the step of determining the target code system category of the target bar code according to the initial numerical value and the final numerical 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 fold code, determining the target code system category of the target bar code according to the initial numerical value and the final numerical value in the target bar space-width ratio sequence;
the method further comprises the following steps:
and if the target bar code type of the target bar code is the cut-off code, determining that the identification result of the target bar code cannot be obtained.
5. The method of claim 1, wherein the training of the recognition model comprises:
randomly generating a plurality of sample bar codes according to a preset bar-space width ratio range, and determining a label of each sample bar code;
normalizing each sample bar code to obtain each normalized sample bar code; the normalized size of each 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 using each sample bar code after image enhancement processing and a 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; and 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 identification model and acquiring a target bar space-width ratio sequence of the target bar code output by the identification model; the identification model is obtained by training a label based on a plurality of sample barcodes and each sample barcode, and the label of each sample barcode comprises: 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 numerical value and the final numerical 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 the identification result of the target bar code; the preset code table comprises the corresponding relation of code system categories, bar-space combinations and characters.
7. The apparatus of claim 6, wherein the decoding module is specifically configured to:
determining a bar-space ratio sequence to be identified of each target bar-space combination in the target bar code from the target bar-space ratio sequence according to a dividing rule of the bar-space combination corresponding to the target code system category;
determining target characters corresponding to the bar-space ratio sequences to be recognized from the corresponding relation between the bar-space ratio sequences of the bar-space combinations under the target code system category and the characters in a preset code table;
and arranging the target characters 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 number of bar spaces included in the sample barcode;
the output result acquisition module is specifically configured to: inputting the target bar code into a preset identification model, and acquiring a target bar space width ratio sequence and the number of target code words of the target bar code output by the identification model;
the device further comprises:
a numerical value judging module, configured to judge whether the number of numerical values included in the target bar space-width ratio sequence is the same as the number of target code words before determining the target code system category of the target bar code according to a starting numerical value and an ending numerical value in the target bar space-width ratio sequence; if the codes are the same, triggering the code system type determining module; otherwise, determining that the identification result of the identification model to 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: a sample barcode type of the sample barcode; wherein the sample barcode type of each sample barcode is any one of a plurality of preset barcode types, and the plurality of barcode types are: normal code, fold code and cut code;
the output result acquisition module is specifically configured to: inputting the target bar code into a preset identification model, and acquiring a target bar space-width ratio sequence and a target bar code type of the target bar code output by the identification model;
the code system type determining module is specifically configured to: if the target bar code type of the target bar code is a normal code or a fold code, determining the target code system category of the target bar code according to the initial numerical value and the final numerical value in the target bar space-width ratio sequence;
the device 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 target bar code type of the target bar code is the truncation code.
10. The apparatus of claim 6, further comprising: a model training module for training the recognition model, the model training module comprising:
the sample acquisition submodule is used for randomly generating a plurality of sample bar codes according to a preset bar-space ratio range and determining a label of each sample bar code;
the normalization processing submodule is used for performing normalization processing on each sample bar code to obtain each normalized sample bar code; the normalized size of each sample bar code is a preset size;
the image enhancement submodule is used for 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;
the model training submodule is used for training a preset initial model by utilizing each sample bar code after image enhancement processing and a label of each sample bar code;
the target barcode acquisition module 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; and the size of the target bar code is the preset size.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN202111150180.8A 2021-09-29 2021-09-29 Bar code identification method and device and electronic equipment Pending CN113869077A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111150180.8A CN113869077A (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 CN113869077A (en) 2021-09-29 2021-09-29 Bar code identification method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN113869077A true CN113869077A (en) 2021-12-31

Family

ID=78992594

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111150180.8A Pending CN113869077A (en) 2021-09-29 2021-09-29 Bar code identification method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113869077A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1722150A (en) * 2003-10-02 2006-01-18 讯宝科技公司 Reader for electro-optically reading display symbol through vertical window
CN104732183A (en) * 2015-03-20 2015-06-24 杭州晟元芯片技术有限公司 One-dimensional barcode identification method based on image sampling line grey scale information analysis
JP2016212603A (en) * 2015-05-07 2016-12-15 株式会社ケイオーエス Bar code recognition device and bar code recognition method
CN107016388A (en) * 2017-03-02 2017-08-04 浙江华睿科技有限公司 A kind of localization method and device in one-dimension code region
NZ724612A (en) * 2014-04-28 2018-08-31 Gelliner Ltd Encoded cells and cell arrays
CN109299628A (en) * 2017-07-24 2019-02-01 杭州海康威视数字技术股份有限公司 A kind of interpretation method and device of bar code
US10198648B1 (en) * 2015-04-10 2019-02-05 Digimarc Corporation Decoding 1D-barcodes in digital capture systems
CN109388999A (en) * 2017-08-11 2019-02-26 杭州海康威视数字技术股份有限公司 A kind of barcode recognition method and device
CN110276357A (en) * 2019-07-01 2019-09-24 浪潮卓数大数据产业发展有限公司 A kind of method for recognizing verification code based on convolutional neural networks
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

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1722150A (en) * 2003-10-02 2006-01-18 讯宝科技公司 Reader for electro-optically reading display symbol through vertical window
NZ724612A (en) * 2014-04-28 2018-08-31 Gelliner Ltd Encoded cells and cell arrays
CN104732183A (en) * 2015-03-20 2015-06-24 杭州晟元芯片技术有限公司 One-dimensional barcode identification method based on image sampling line grey scale information analysis
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
CN107016388A (en) * 2017-03-02 2017-08-04 浙江华睿科技有限公司 A kind of localization method and device in one-dimension code region
CN109299628A (en) * 2017-07-24 2019-02-01 杭州海康威视数字技术股份有限公司 A kind of interpretation method and device of bar code
CN109388999A (en) * 2017-08-11 2019-02-26 杭州海康威视数字技术股份有限公司 A kind of barcode recognition method and device
CN110276357A (en) * 2019-07-01 2019-09-24 浪潮卓数大数据产业发展有限公司 A kind of method for recognizing verification code based on convolutional neural networks
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

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHIHUI WANG, TE.AL: "1D barcode region detection based on the Hough transform and support vector machine", INTERNATIONAL CONFERENCE ON MULTIMEDIA MODETING, 1 January 2016 (2016-01-01), pages 79 - 90, XP047343437, DOI: 10.1007/978-3-319-27674-8_8 *
赵华,等: "基于PDF417扫描模组的条码识别技术研究与实现", 电子与封装, vol. 18, no. 12, 20 December 2018 (2018-12-20), pages 45 - 47 *

Similar Documents

Publication Publication Date Title
US11392838B2 (en) Method, equipment, computing device and computer-readable storage medium for knowledge extraction based on TextCNN
CN112380853B (en) Service scene interaction method and device, terminal equipment and storage medium
EP3869385A1 (en) Method for extracting structural data from image, apparatus and device
CN111539502B (en) Anti-counterfeiting two-dimensional code generation method and device, server and storage medium
CN109460434B (en) Data extraction model establishing method and device
CN110674303B (en) Event statement processing method and device, computer equipment and readable storage medium
CN107451106A (en) Text method and device for correcting, electronic equipment
CN116071077B (en) Risk assessment and identification method and device for illegal account
CN110309301B (en) Enterprise category classification method and device and intelligent terminal
CN114036950B (en) Medical text named entity recognition method and system
CN111160188A (en) Financial bill identification method, device, equipment and storage medium
CN113553847A (en) Method, device, system and storage medium for parsing address text
CN115100668A (en) Method and device for identifying table information in image
CN113204956B (en) Multi-model training method, abstract segmentation method, text segmentation method and text segmentation device
US11790170B2 (en) Converting unstructured technical reports to structured technical reports using machine learning
CN111126056B (en) Method and device for identifying trigger words
CN112149678A (en) Character recognition method and device for special language and recognition model training method and device
CN113869077A (en) Bar code identification method and device and electronic equipment
CN111859933A (en) Training method, recognition method, device and equipment of Malay recognition model
CN110956170A (en) Method, device, equipment and storage medium for generating passport machine-readable code sample
CN113449524B (en) Named entity identification method, system, equipment and medium
CN113626587B (en) Text category identification method and device, electronic equipment and medium
CN112560534B (en) Multi-parameter configuration static sequential decoding output method
CN115294593A (en) Image information extraction method and device, computer equipment and storage medium
US11557136B1 (en) Identity document verification based on barcode structure

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