CN107016317B - Bar code decoding method and device - Google Patents

Bar code decoding method and device Download PDF

Info

Publication number
CN107016317B
CN107016317B CN201710119932.1A CN201710119932A CN107016317B CN 107016317 B CN107016317 B CN 107016317B CN 201710119932 A CN201710119932 A CN 201710119932A CN 107016317 B CN107016317 B CN 107016317B
Authority
CN
China
Prior art keywords
character
decoding
scanning line
decoding result
bar code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710119932.1A
Other languages
Chinese (zh)
Other versions
CN107016317A (en
Inventor
周璐
马诗洁
谢世斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Huaray Technology Co Ltd
Original Assignee
Zhejiang Huaray 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 Zhejiang Huaray Technology Co Ltd filed Critical Zhejiang Huaray Technology Co Ltd
Priority to CN201710119932.1A priority Critical patent/CN107016317B/en
Publication of CN107016317A publication Critical patent/CN107016317A/en
Application granted granted Critical
Publication of CN107016317B publication Critical patent/CN107016317B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Toxicology (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Printers Characterized By Their Purpose (AREA)
  • Character Input (AREA)

Abstract

The embodiment of the invention discloses a bar code decoding method and a device, wherein the method comprises the following steps: determining at least three scanning lines in a bar code to be decoded, decoding each character corresponding to each scanning line, determining the frequency of each scanning line for the occurrence of the decoding result of the character, and taking the decoding result with the maximum frequency as the target decoding result of the character; and determining the decoding result of the bar code according to the target decoding result of each character. In the embodiment of the invention, the frequency of occurrence of the decoding result of each scanning line for each character is determined for each corresponding character on the scanning line, and the decoding result with the largest frequency of occurrence is used as the target decoding result of the character, so that the influence of decoding errors and decoding incapability caused by the conditions of breakage, scratch, poor printing quality, dirt, breakage and the like of the bar code is weakened, and the accuracy and the success rate of decoding the bar code are improved.

Description

Bar code decoding method and device
Technical Field
The invention relates to the technical field of bar code identification, in particular to a bar code decoding method and a bar code decoding device.
Background
The bar code is a graphic identifier which arranges a plurality of bars and spaces with different widths according to a certain coding rule and is used for expressing a group of information. A common bar code is a pattern of parallel lines of bars and spaces of widely differing reflectivity. The bar code can mark many information such as the producing country, the manufacturer, the name of the goods, the production date, the book classification number, the starting and stopping place of the mail, the category, the date and the like, so the bar code is widely applied to many fields such as commodity circulation, book management, postal management, bank systems and the like.
The existing bar code decoding method mainly comprises the following steps: average distance method: obtaining the actual total width of the bar code after positioning the initial position of the bar code, solving the pixel number of a unit template according to the total length of the bar code template and the actual total width, further measuring the actual width of each bar and space in the bar code, and matching the determined actual width with a template with standard width to determine the corresponding code value; similar edge distance method: decoding by calculating the sum of the widths of the adjacent bars and spaces, matching the sum of the widths of the adjacent bars and spaces of the standard character template; template matching algorithm based on barcode width: and determining the actual widths of the strip and the space according to the number of the pixel points contained in the record strip or the space, and matching the determined actual widths with a template with a standard width to determine a corresponding code value.
However, when the bar code is decoded by the above methods, the bar code is decoded depending on the widths of the bar and the space in the bar code, but in practical application, the bar code has the problems of breakage, scratch, poor printing quality, dirt and the like, or the bar code is damaged due to illumination, the actual widths of the bar and the space are changed, so that the decoding is inaccurate, even cannot be decoded, and the decoding rate is low. In addition, the image processing method in the prior art can only solve the problem of poor image acquisition, and can not repair and correct the bar code with the conditions of fracture, scratch, poor printing quality, dirt, damage and the like, thereby influencing the accuracy and the decoding rate of the bar code decoding.
Disclosure of Invention
The invention provides a bar code decoding method and a bar code decoding device, which are used for solving the problems of inaccurate bar code decoding and low decoding rate in the prior art under the conditions of fracture, scratch, poor printing quality, dirt, breakage and the like.
The embodiment of the invention discloses a bar code decoding method, which comprises the following steps:
determining at least three scanning lines in a bar code to be decoded;
decoding each character corresponding to each scanning line, determining the frequency of the character decoding result of each scanning line, and taking the decoding result with the maximum frequency as the target decoding result of the character;
and determining the decoding result of the bar code according to the target decoding result of each character.
Further, if the decoding result for the first character on the first scan line is not the target decoding result, the decoding for each corresponding character on each scan line includes:
identifying a second scanning line of which the decoding result of the first character is a target decoding result, and updating the initial position of a next character on the first scanning line according to the initial position of the next character adjacent to the first character on the second scanning line;
and decoding the next character on the first scanning line according to the updated initial position of the next character on the first scanning line.
Further, after the at least three scanning lines are determined in the barcode to be decoded and before decoding is performed on each character corresponding to each scanning line, the method further includes:
for each scanning line, determining the positions of the start symbol and the end symbol on the scanning line according to the pre-stored templates of the start symbol and the end symbol;
and determining the position of each character on the scanning line according to the positions of the start character and the end character on the scanning line.
Further, the determining at least three scan lines in the barcode to be decoded comprises:
for a bar code to be decoded, a first dividing line perpendicular to the bar code is adopted to divide the bar code into at least three regions, and at least one scanning line is determined in each region.
Further, the determining at least three scan lines for a barcode to be decoded includes:
and for the bar code to be decoded, dividing the bar code into at least four regions by adopting at least three second dividing lines perpendicular to the bar code, and determining each second dividing line as each corresponding scanning line.
Further, the character includes:
a start symbol, an end symbol, and a data symbol.
The embodiment of the invention discloses a bar code decoding device, which comprises:
the first determining module is used for determining at least three scanning lines in the bar code to be decoded;
the decoding module is used for decoding each character corresponding to each scanning line, determining the frequency of occurrence of the decoding result of each scanning line for the character, and taking the decoding result with the maximum frequency of occurrence as the target decoding result of the character;
and the second determining module is used for determining the decoding result of the bar code according to the target decoding result of each character.
Further, the decoding module is specifically configured to, if the decoding result for the first character on the first scan line is not the target decoding result, identify a second scan line in which the decoding result for the first character is the target decoding result, and update the starting position of a next character on the first scan line according to the starting position of the next character adjacent to the first character on the second scan line; and decoding the next character on the first scanning line according to the updated initial position of the next character on the first scanning line.
Further, the apparatus further comprises:
a third determining module, configured to determine, for each scan line, positions of a start symbol and an end symbol on the scan line according to pre-stored templates of the start symbol and the end symbol; and determining the position of each character on the scanning line according to the positions of the start character and the end character on the scanning line.
Further, the first determining module is specifically configured to, for a barcode to be decoded, divide the barcode into at least three regions by using a first dividing line perpendicular to the barcode, and determine at least one scanning line in each region.
Further, the first determining module is specifically configured to, for a barcode to be decoded, equally divide the barcode into at least four regions by using at least three second dividing lines perpendicular to the barcode, and determine each second dividing line as each corresponding scanning line.
The invention discloses a bar code decoding method and a device, wherein the method comprises the following steps: determining at least three scanning lines in a bar code to be decoded, decoding each character corresponding to each scanning line, determining the frequency of each scanning line for the occurrence of the decoding result of the character, and taking the decoding result with the maximum frequency as the target decoding result of the character; and determining the decoding result of the bar code according to the target decoding result of each character. In the embodiment of the invention, the frequency of the decoding result of each scanning line for the character is determined, and the decoding result with the largest frequency is used as the target decoding result of the character, so that the influence of decoding errors and decoding incapability caused by the conditions of breakage, scratch, poor printing quality, dirt, breakage and the like of the bar code is weakened, and the accuracy and the success rate of bar code decoding are improved.
Drawings
Fig. 1 is a schematic diagram of a barcode decoding process provided in embodiment 1 of the present invention;
fig. 2 is a schematic diagram of a barcode decoding process provided in embodiment 2 of the present invention;
fig. 3 is a schematic structural diagram of a barcode decoding apparatus according to embodiment 5 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 by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1:
fig. 1 is a schematic diagram of a barcode decoding process provided in an embodiment of the present invention, where the process includes:
s101: at least three scan lines are determined in the barcode to be decoded.
The barcode decoding method provided by the embodiment of the invention is applied to electronic equipment, and the electronic equipment can be barcode reading equipment such as a handheld barcode reader and a fixed barcode reader, and can also be terminal equipment such as a mobile phone and a tablet personal computer with a barcode decoding function.
Specifically, when the barcode to be decoded is decoded, at least three scanning lines are determined on the barcode to be decoded, and the distances between two adjacent scanning lines may be the same or different. Preferably, in order to avoid the error parts of the bar code information caused by the conditions of fracture, scratch, poor printing quality, dirt, damage and the like existing in the bar code due to too close distance between the scanning lines, and simultaneously cause interference on the character information of the bar code acquired by a plurality of scanning lines and influence the accuracy of bar code decoding, the scanning lines can be selected at equal intervals, and the distance between the adjacent scanning lines is not less than one pixel. And the number of the scanning lines can be determined according to the contamination degree of the bar code to be decoded, if the contamination degree of the bar code to be decoded is low, the decoding efficiency can be ensured by adopting a small number of the scanning lines, and if the contamination degree of the bar code to be decoded is high, the decoding accuracy can be ensured by adopting a large number of the scanning lines.
S102: and decoding each character corresponding to each scanning line, determining the frequency of the decoding result of each scanning line for the character, and taking the decoding result with the maximum frequency as the target decoding result of the character.
In the embodiment of the invention, each character is identified on each scanning line, each character is decoded, and the position corresponding to each character is sequentially determined on each scanning line according to the appearance sequence and the corresponding width of each character corresponding to the bar code to be decoded when each character on the scanning line is identified, so that the number of the characters contained on each scanning line is the same, and the character corresponding to each character on each scanning line in the bar code to be decoded can be known in advance. When the information of each character corresponding to the bar code is determined, decoding is carried out on each corresponding character on the scanning lines, the frequency of occurrence of the decoding result of each scanning line on the character is determined, and the decoding result with the largest frequency of occurrence is used as the target decoding result of the character.
In the embodiment of the present invention, the process of decoding each character on a scan line is the prior art, and is not described again.
For example: the number of the scanning lines determined in the bar code to be decoded is 5, the scanning lines are respectively scanning line 1, scanning line 2, scanning line 3, scanning line 4 and scanning line 5, the decoding results of the characters A corresponding to the scanning lines 1, 2, 3, 4 and 5 are respectively 001, 002, 001 and 001, the frequency of the decoding result of 001 appearing for the characters A is determined to be 4 times, the frequency of the decoding result of 002 appearing is determined to be 1 time, the 4 times are more than 1 time, and the decoding result 001 with the frequency of 4 appearing for the decoding result is taken as the target decoding result of the characters A.
S103: and determining the decoding result of the bar code according to the target decoding result of each character.
Specifically, the decoding result of the bar code is determined according to the target decoding result of each character in the bar code. For example: the characters contained in the bar code are character A, character B, character C, character D and character E, wherein the target decoding results corresponding to the character A, the character B, the character C, the character D and the character E are 001, 003, 005, 006 and 004 respectively, and the decoding result corresponding to the bar code is determined to be 001003005006004.
In the embodiment of the invention, the frequency of the decoding result of each scanning line for the character is determined, and the decoding result with the largest frequency is used as the target decoding result of the character, so that the influence of decoding errors and decoding incapability caused by the conditions of breakage, scratch, poor printing quality, dirt, breakage and the like of the bar code is weakened, and the accuracy and the success rate of bar code decoding are improved.
Example 2:
in order to improve the accuracy and success rate of decoding the bar code, on the basis of the above embodiment, in an embodiment of the present invention, if the decoding result for the first character on the first scan line is not the target decoding result, the decoding for each corresponding character on each scan line includes:
identifying a second scanning line of which the decoding result of the first character is a target decoding result, and updating the initial position of a next character on the first scanning line according to the initial position of the next character adjacent to the first character on the second scanning line;
and decoding the next character on the first scanning line according to the updated initial position of the next character on the first scanning line.
When a certain part of a bar code has the conditions of fracture, scratch, poor printing quality, dirt, breakage and the like, the scanning line which collects the character information of the bar code through the part can cause inaccurate positioning of the character corresponding to the part, and influence on the positioning of the scanning line on the character position behind the character corresponding to the part, the normal decoding of the character behind the character is influenced, and the accuracy of bar code decoding is influenced.
In the embodiment of the present invention, in order to improve the accuracy of decoding a bar code, if a decoding result for a first character on a first scan line is a non-target decoding result, before a next character adjacent to the first character on the first scan line is decoded, a second scan line in which the decoding result for the first character is a target decoding result is identified, a starting position of the next character on the first scan line is updated according to a position of the next character adjacent to the first character on the second scan line, and the next character on the first scan line is decoded according to the updated starting position of the next character on the first scan line. Specifically, the starting position of the next character on the first scan line may be determined according to the distance between the starting position of the next character on the second scan line and the starting position of the scan line.
For example: and if the decoding result for the first character on the first scanning line is 001 and the target decoding result is 003, the decoding result for the first character on the first scanning line is a non-target decoding result, and the decoding result for the first character on the second scanning line is a target decoding result, updating the starting position of the next character on the first scanning line according to the distance between the starting position of the next character determined on the second scanning line and the starting position of the second scanning line.
Fig. 2 is a schematic diagram of a barcode decoding process provided in an embodiment of the present invention, where the process includes:
s201: at least three scan lines are determined in the barcode to be decoded.
S202: and determining the frequency of the occurrence of the decoding result of each scanning line for the character to be decoded currently, and taking the decoding result with the maximum frequency as the target decoding result of the character to be decoded currently.
S203: and judging whether a character to be decoded next to the character to be decoded currently exists, if so, performing S204, and if not, performing S206.
S204: and for each scanning line, judging whether the decoding result of the current character to be decoded on the scanning line is a target decoding result, if so, taking the next character to be decoded as the current character to be decoded, and performing S202, and if not, performing S205.
S205: and updating the starting position of the next character on the scanning line according to the starting position of the next character of the character to be decoded on the other scanning lines of which the decoding results of the character to be decoded are target decoding results, and performing S202 by taking the character to be decoded as the character to be decoded currently.
S206: and determining the decoding result of the bar code according to the target decoding result of each character to be decoded.
Example 3:
in order to accurately decode each character corresponding to a scan line, on the basis of the foregoing embodiments, in an embodiment of the present invention, after at least three scan lines are determined in a barcode to be decoded, before decoding each character corresponding to each scan line, the method further includes:
for each scanning line, determining the positions of the start symbol and the end symbol on the scanning line according to the pre-stored templates of the start symbol and the end symbol;
and determining the position of each character on the scanning line according to the positions of the start character and the end character on the scanning line.
In the embodiment of the invention, templates of a start symbol and an end symbol corresponding to a type of a barcode to be decoded are pre-stored in electronic equipment, information of bar space widths of the start symbol and the end symbol corresponding to the type of barcode is recorded in the templates of the start symbol and the end symbol, and positions on a scanning line, which are matched with the information of the bar space widths of the start symbol and the end symbol, can be determined according to the information of the bar space widths of the start symbol and the end symbol, so that the positions of the start symbol and the end symbol on the scanning line are determined, and the position of each character before the end symbol after the start symbol on the scanning line is determined according to the positions of the start symbol and the end symbol. In the embodiment of the present invention, determining the positions of the start symbol and the end symbol on the scan line according to the templates of the start symbol and the end symbol is the prior art and will not be described again.
In addition, if the electronic equipment stores not only the templates of the start character and the end character corresponding to the type of the bar code to be decoded, but also the templates of the start character and the end character corresponding to other types of bar codes, when the positions of the start character and the end character on the scanning line are determined, the templates of the start character and the end character corresponding to each type of bar code are matched on the scanning line in sequence, and if the templates of the start character and the end character corresponding to the type of bar code are successfully matched on the scanning line, the positions of the start character and the end character determined on the scanning line by the start character and the end character corresponding to the type of bar code are used as the positions of the start character and the end character on the scanning line.
The character includes:
a start symbol, an end symbol, and a data symbol.
Specifically, after the type of the barcode to be decoded is determined, the boundary points on the scanning line may be matched according to the standard template corresponding to the start symbol, the end symbol, and the data symbol corresponding to the barcode of the type, so as to determine the positions of the start symbol, the end symbol, and the data symbol on the scanning line. In the embodiment of the present invention, determining the positions of the start symbol, the end symbol, and the data symbol on the scan line of the barcode according to the type of the barcode is prior art and will not be described again.
Example 4:
in order to ensure the accuracy of decoding the barcode, on the basis of the foregoing embodiments, in an embodiment of the present invention, a method for determining at least three scan lines includes:
in a first way,
The determining at least three scan lines in the barcode to be decoded comprises:
for a bar code to be decoded, a first dividing line perpendicular to the bar code is adopted to divide the bar code into at least three regions, and at least one scanning line is determined in each region.
Specifically, the barcode is divided into at least three regions by a first dividing line in a direction perpendicular to the barcode, the three regions may be the same or different in size, at least one scanning line is determined in each region, and at least three scanning lines of the barcode are determined.
The second way,
The determining at least three scan lines for a barcode to be decoded includes:
and for the bar code to be decoded, dividing the bar code into at least four regions by adopting at least three second dividing lines perpendicular to the bar code, and determining each second dividing line as each corresponding scanning line.
Specifically, for the bar code to be decoded, the bar code is equally divided into at least four regions by at least three second dividing lines perpendicular to the bar code, each second dividing line is determined to be corresponding to each scanning line, and at least three scanning lines with equal distance between adjacent scanning lines are obtained.
Example 5:
fig. 3 is a schematic structural diagram of a barcode decoding apparatus according to an embodiment of the present invention, where the apparatus includes:
a first determining module 31, configured to determine at least three scanning lines in a barcode to be decoded;
a decoding module 32, configured to decode each character corresponding to each scan line, determine the number of occurrences of a decoding result of each scan line for the character, and use the decoding result with the largest number of occurrences as a target decoding result of the character;
and a second determining module 33, configured to determine a decoding result of the barcode according to the target decoding result of each character.
The decoding module 32 is specifically configured to, if the decoding result for the first character on the first scan line is not the target decoding result, identify a second scan line in which the decoding result for the first character is the target decoding result, and update the starting position of a next character on the first scan line according to the starting position of the next character adjacent to the first character on the second scan line; and decoding the next character on the first scanning line according to the updated initial position of the next character on the first scanning line.
The device further comprises:
a third determining module 34, configured to determine, for each scan line, positions of a start symbol and an end symbol on the scan line according to pre-stored templates of the start symbol and the end symbol; and determining the position of each character on the scanning line according to the positions of the start character and the end character on the scanning line.
The first determining module 31 is specifically configured to, for a barcode to be decoded, divide the barcode into at least three regions by using a first dividing line perpendicular to the barcode, and determine at least one scanning line in each region.
The first determining module 31 is specifically configured to, for a barcode to be decoded, equally divide the barcode into at least four regions by using at least three second dividing lines perpendicular to the barcode, and determine each second dividing line as each corresponding scanning line.
The invention discloses a bar code decoding method and a device, wherein the method comprises the following steps: determining at least three scanning lines in a bar code to be decoded; decoding each character corresponding to each scanning line, determining the frequency of the character decoding result of each scanning line, and taking the decoding result with the maximum frequency as the target decoding result of the character; and determining the decoding result of the bar code according to the target decoding result of each character. In the embodiment of the invention, the frequency of the decoding result of each scanning line for the character is determined, and the decoding result with the largest frequency is used as the target decoding result of the character, so that the influence of decoding errors and decoding incapability caused by the conditions of breakage, scratch, poor printing quality, dirt, breakage and the like of the bar code is weakened, and the accuracy and the success rate of bar code decoding are improved.
For the system/apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (9)

1. A method of decoding a barcode, the method comprising:
determining at least three scanning lines in a bar code to be decoded;
decoding each character corresponding to each scanning line, determining the frequency of the character decoding result of each scanning line, and taking the decoding result with the maximum frequency as the target decoding result of the character;
determining a decoding result of the bar code according to a target decoding result of each character;
wherein, if the decoding result for the first character on the first scan line is not the target decoding result, the decoding for each corresponding character on each scan line includes:
identifying a second scanning line of which the decoding result of the first character is a target decoding result, and updating the initial position of a next character on the first scanning line according to the initial position of the next character adjacent to the first character on the second scanning line;
and decoding the next character on the first scanning line according to the updated initial position of the next character on the first scanning line.
2. The method of claim 1, wherein after determining at least three scan lines in the barcode to be decoded, prior to decoding for each corresponding character on each scan line, the method further comprises:
for each scanning line, determining the positions of the start symbol and the end symbol on the scanning line according to the pre-stored templates of the start symbol and the end symbol;
and determining the position of each character on the scanning line according to the positions of the start character and the end character on the scanning line.
3. The method of claim 1, wherein determining at least three scan lines in a barcode to be decoded comprises:
for a bar code to be decoded, a first dividing line perpendicular to the bar code is adopted to divide the bar code into at least three regions, and at least one scanning line is determined in each region.
4. The method of claim 1, wherein the determining at least three scan lines for a barcode to be decoded comprises:
and for the bar code to be decoded, dividing the bar code into at least four regions by adopting at least three second dividing lines perpendicular to the bar code, and determining each second dividing line as each corresponding scanning line.
5. The method of claim 1, wherein the character comprises:
a start symbol, an end symbol, and a data symbol.
6. A barcode decoding apparatus, the apparatus comprising:
the first determining module is used for determining at least three scanning lines in the bar code to be decoded;
the decoding module is used for decoding each character corresponding to each scanning line, determining the frequency of occurrence of the decoding result of each scanning line for the character, and taking the decoding result with the maximum frequency of occurrence as the target decoding result of the character;
the second determining module is used for determining the decoding result of the bar code according to the target decoding result of each character;
the decoding module is specifically configured to, if a decoding result for a first character on a first scan line is a non-target decoding result, identify a second scan line in which the decoding result for the first character is a target decoding result, and update an initial position of a next character on the first scan line according to an initial position of the next character adjacent to the first character on the second scan line; and decoding the next character on the first scanning line according to the updated initial position of the next character on the first scanning line.
7. The apparatus of claim 6, wherein the apparatus further comprises:
a third determining module, configured to determine, for each scan line, positions of a start symbol and an end symbol on the scan line according to pre-stored templates of the start symbol and the end symbol; and determining the position of each character on the scanning line according to the positions of the start character and the end character on the scanning line.
8. The apparatus of claim 6, wherein the first determining module is configured to, for a barcode to be decoded, divide the barcode into at least three regions using a first dividing line perpendicular to the barcode, and determine at least one scan line in each region.
9. The apparatus of claim 6, wherein the first determining module is specifically configured to determine each second dividing line as each corresponding scan line by dividing the barcode into at least four regions using at least three second dividing lines perpendicular to the barcode for the barcode to be decoded.
CN201710119932.1A 2017-03-02 2017-03-02 Bar code decoding method and device Active CN107016317B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710119932.1A CN107016317B (en) 2017-03-02 2017-03-02 Bar code decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710119932.1A CN107016317B (en) 2017-03-02 2017-03-02 Bar code decoding method and device

Publications (2)

Publication Number Publication Date
CN107016317A CN107016317A (en) 2017-08-04
CN107016317B true CN107016317B (en) 2019-12-24

Family

ID=59440255

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710119932.1A Active CN107016317B (en) 2017-03-02 2017-03-02 Bar code decoding method and device

Country Status (1)

Country Link
CN (1) CN107016317B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111797642B (en) * 2020-07-08 2021-06-29 北京京东振世信息技术有限公司 Bar code identification method and terminal
CN111797647B (en) * 2020-07-08 2023-11-03 北京京东振世信息技术有限公司 Bar code decoding method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5384451A (en) * 1993-01-29 1995-01-24 United Parcel Service Of America, Inc. Method and apparatus for decoding bar code symbols using composite signals
US7314175B1 (en) * 2006-12-20 2008-01-01 Ncr Corporation Methods and apparatus for improved use of partial bar code information to decode a complete bar code
CN101882205A (en) * 2010-06-01 2010-11-10 福建新大陆电脑股份有限公司 Bar code image scanning method
CN106203216A (en) * 2016-06-30 2016-12-07 杭州晟元数据安全技术股份有限公司 A kind of high-performance bar code decoding method
CN106295443A (en) * 2016-08-03 2017-01-04 浙江华睿科技有限公司 The localization method in a kind of bar code region and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9092682B2 (en) * 2012-05-25 2015-07-28 Metrologic Instruments, Inc. Laser scanning code symbol reading system employing programmable decode time-window filtering

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5384451A (en) * 1993-01-29 1995-01-24 United Parcel Service Of America, Inc. Method and apparatus for decoding bar code symbols using composite signals
US7314175B1 (en) * 2006-12-20 2008-01-01 Ncr Corporation Methods and apparatus for improved use of partial bar code information to decode a complete bar code
CN101882205A (en) * 2010-06-01 2010-11-10 福建新大陆电脑股份有限公司 Bar code image scanning method
CN106203216A (en) * 2016-06-30 2016-12-07 杭州晟元数据安全技术股份有限公司 A kind of high-performance bar code decoding method
CN106295443A (en) * 2016-08-03 2017-01-04 浙江华睿科技有限公司 The localization method in a kind of bar code region and device

Also Published As

Publication number Publication date
CN107016317A (en) 2017-08-04

Similar Documents

Publication Publication Date Title
CN109214229B (en) Bar code scanning method and device and electronic equipment
CN108399025B (en) Method and device for correcting identification deviation and terminal equipment
CN111783495A (en) Bar code identification method and device, electronic equipment and storage medium
CN111046859A (en) Character recognition method and device
CN107016317B (en) Bar code decoding method and device
CN114005126A (en) Table reconstruction method and device, computer equipment and readable storage medium
CN107016318B (en) A kind of bar code decoding method and device
CN111814673A (en) Method, device and equipment for correcting text detection bounding box and storage medium
CN110222547B (en) Bar code identification method and device
CN110135288B (en) Method and device for quickly checking electronic certificate
CN114049540A (en) Method, device, equipment and medium for detecting marked image based on artificial intelligence
CN112287936A (en) Optical character recognition test method and device, readable storage medium and terminal equipment
CN106991348A (en) A kind of bar code decoding method and device
CN104217189A (en) Self-learning identification method of barcode used for test strip
CN111353558A (en) Error detection method and device for identification code and terminal
CN110895849A (en) Method and device for cutting and positioning crown word number, computer equipment and storage medium
CN101833645A (en) Bar code decoding method based on code word combination
CN112434700A (en) License plate recognition method, device, equipment and storage medium
CN106991347B (en) The localization method and device of identifier word symbol in a kind of bar code
CN109299628B (en) Bar code decoding method and device
CN114943241B (en) Method for repairing bar code image, electronic equipment and storage medium
CN111275693A (en) Counting method and counting device for objects in image and readable storage medium
CN113190277A (en) Equipment identification method, equipment identification device and terminal equipment
US11328194B2 (en) Generation and recognition of barcode
CN112288066B (en) Graphic code coding and identifying method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: C10, No. 1199 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Zhejiang Huarui Technology Co.,Ltd.

Address before: C10, No. 1199 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: ZHEJIANG HUARAY TECHNOLOGY Co.,Ltd.