CN107766770A - A kind of EAN13 codes coding/decoding method and device - Google Patents
A kind of EAN13 codes coding/decoding method and device Download PDFInfo
- Publication number
- CN107766770A CN107766770A CN201711055722.7A CN201711055722A CN107766770A CN 107766770 A CN107766770 A CN 107766770A CN 201711055722 A CN201711055722 A CN 201711055722A CN 107766770 A CN107766770 A CN 107766770A
- Authority
- CN
- China
- Prior art keywords
- information
- bar
- scan line
- ean13
- codes
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
- G06K7/1404—Methods for optical code recognition
- G06K7/1408—Methods for optical code recognition the method being specifically adapted for the type of code
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
- G06K7/1404—Methods for optical code recognition
- G06K7/146—Methods for optical code recognition the method including quality enhancement steps
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Electromagnetism (AREA)
- General Health & Medical Sciences (AREA)
- Toxicology (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The invention discloses a kind of EAN13 codes coding/decoding method and device, wherein method includes:EAN13 codes are scanned using multi-strip scanning line, judge whether the bar sky information in each scan line includes the complete bar code information of EAN13 codes;When the complete bar code information of bar sky packet code containing EAN13 at least in a scan line, the bar sky information in the scan line of the wherein one complete bar code information comprising EAN13 codes is decoded, obtains the decoded result of EAN13 codes;When the bar sky information in any bar scan line does not all include the complete bar code information of EAN13 codes, and during bar sky packet effective information containing left side or right side effective information at least in a scan line, the left side effective information or the right side effective information are decoded, obtain left side decoded result or right side decoded result;Left side decoded result and right side decoded result are spliced, obtain the decoded result of EAN13 codes.The present invention can be to decoding with defect or the EAN13 codes being stained, and that improves EAN13 codes is decoded into power.
Description
Technical field
The present invention relates to Bar Code field, and in particular to a kind of EAN13 codes coding/decoding method and device.
Background technology
Bar Code is an emerging identification technology, excellent because its identification is quick, accurate, reliable and cost is low etc.
Point, is widely used in every field.Bar code is made up of multiple " bar " and " sky " units arranged in parallel, the information of bar code
Expressed by the empty different in width of bar and position grouping, EAN13 codes are the conventional bar codes of one of which.
Referring to Fig. 1, it is the symbolic construction schematic diagram of EAN13 codes.EAN13 codes include left side clear area, starting character, a left side
Side information, central seperating character, right side information (including check character), full stop, right side blank area and confession people identify character, its
In, left side information is encoded using A/B sub-combinations, and right side information uses C subset codes.In character is identified for people, in addition to
Preamble, because left side information is encoded by two kinds of different subsets, therefore the coding rule selected of left side information have it is more
Sample, available for the incidence relation for establishing preamble and left side information, its incidence relation can be consulted by GB 12904-2008
Arrive, different preambles corresponds to different left side information coding alternation rules.In the prior art, it is complete usually through scanning
EAN13 codes, complete bar sky information is obtained, and overall decoding is carried out to complete bar sky information.
However, for various reasons, defect or situation about being stained often occurs in EAN13 codes, if passing through multi-strip scanning line pair
When EAN13 codes are scanned, any one scan line all can not intactly scan all empty information of the EAN13 codes, will
The EAN13 codes can not be successfully decoded out, cause decoding to fail.
The content of the invention
Technical problems to be solved of the embodiment of the present invention are to provide a kind of EAN13 codes coding/decoding method, can to defect or
The EAN13 codes being stained are decoded, and that improves EAN13 codes is decoded into power.
To achieve these goals, one aspect of the present invention provides a kind of EAN13 codes coding/decoding method, including:
EAN13 codes are scanned using multi-strip scanning line, judge whether is bar sky information in each scan line
Include the complete bar code information of the EAN13 codes;
When complete bar code information of the bar sky packet at least in a scan line containing the EAN13 codes,
Bar sky information in the scan line of the wherein one complete bar code information comprising the EAN13 codes is decoded, obtains institute
State the decoded result of EAN13 codes;
When the bar sky information described in any bar in scan line does not all include the complete bar code information of the EAN13 codes,
Judge whether the bar sky information in each scan line includes left side effective information or right side effective information;
When the bar sky packet effective information containing left side at least in a scan line, the left side is effectively believed
Breath is decoded, and obtains left side decoded result;
When the bar sky packet effective information containing right side at least in a scan line, the right side is effectively believed
Breath is decoded, and obtains right side decoded result;
The left side decoded result and the right side decoded result are spliced, obtain the decoding knot of the EAN13 codes
Fruit.
In a kind of optional embodiment, the bar sky information when described in any bar in scan line does not all include described
During the complete bar code information of EAN13 codes, judge whether the bar sky information in each scan line is effectively believed comprising left side
Breath or right side effective information, including:
When the bar sky information described in any bar in scan line does not all include the complete bar code information of the EAN13 codes,
Judge whether the bar sky information in each scan line includes the unilateral information module of the EAN13 codes;The unilateral letter
Breath module includes central seperating character, Boundary Recognition symbol and having between the central seperating character and Boundary Recognition symbol
Imitate information;The Boundary Recognition symbol is starting character or full stop;
When unilateral information module of the bar sky packet at least in a scan line containing the EAN13 codes, sentence
The type of coding of effective information in the disconnected unilateral information module;
When the type of coding of effective information in the unilateral information module is the type of coding of left side information, described in judgement
Left side effective information is included in unilateral information module;
When the type of coding of effective information in the unilateral information module is the type of coding of right side information, described in judgement
Right side effective information is included in unilateral information module.
In a kind of optional embodiment, the bar sky packet that ought be at least in a scan line contains left side
During effective information, the left side effective information is decoded, obtains left side decoded result, including:
When the bar sky packet effective information containing left side at least in a scan line, the left side is effectively believed
Cease into row decoding, obtain left side decoding result;
According to the type of coding alternation rule of the left side effective information, preamble is obtained;
The preamble and left side decoding result are spliced, obtain left side decoded result.
In a kind of optional embodiment, the effective information is positioned at the central seperating character and the Boundary Recognition
Complete bar sky information between symbol.
In a kind of optional embodiment, methods described also includes:
The decoded result of the EAN13 codes is verified;
When verifying successfully, the decoded result of the EAN13 codes is exported, terminates decoding.
In order to realize identical purpose, another aspect of the present invention provides a kind of EAN13 codes decoding apparatus, including:
First judge module, for being scanned using N bars scan line to EAN13 codes, judge each scan line
On bar sky information whether include the complete bar code information of the EAN13 codes;
First decoder module, for ought be at least in a scan line bar sky packet containing the EAN13 codes
During complete bar code information, to the empty letter of bar in the scan line of the wherein one complete bar code information comprising the EAN13 codes
Breath is decoded, and obtains the decoded result of the EAN13 codes;
Second judge module, for all not including the EAN13 codes when the bar sky information described in any bar in scan line
During complete bar code information, judge whether the bar sky information in each scan line has comprising left side effective information or right side
Imitate information;
Left side formation-decoding module, for ought be at least in a scan line bar sky packet effectively believe containing left side
During breath, the left side effective information is decoded, obtains left side decoded result;
Right side formation-decoding module, for ought be at least in a scan line bar sky packet effectively believe containing right side
During breath, the right side effective information is decoded, obtains right side decoded result;
Decoded result concatenation module, for splicing to the left side decoded result and the right side decoded result, obtain
To the decoded result of the EAN13 codes.
In a kind of optional embodiment, second judge module includes:
Unilateral information module judging unit, described in all not including when the bar sky information described in any bar in scan line
During the complete bar code information of EAN13 codes, judge whether the bar sky information in each scan line includes the EAN13 codes
Unilateral information module;The unilateral information module includes central seperating character, Boundary Recognition symbol and positioned at the middle separation
Effective information between symbol and Boundary Recognition symbol;The Boundary Recognition symbol is starting character or full stop;
Type of coding judging unit, for ought be at least in a scan line bar sky packet contain the EAN13
During the unilateral information module of code, the type of coding of effective information in the unilateral information module is judged;
Left side information identifying unit, for being left side information when the type of coding of effective information in the unilateral information module
Type of coding when, judge to include left side effective information in the unilateral information module;
Right side information identifying unit, for being right side information when the type of coding of effective information in the unilateral information module
Type of coding when, judge to include right side effective information in the unilateral information module.
In a kind of optional embodiment, the left side formation-decoding module includes:
Left side information decoding unit, for ought be at least in a scan line bar sky packet effectively believe containing left side
During breath, row decoding is entered to the left side effective information, obtains left side decoding result;
Preamble decoding unit, for the type of coding alternation rule according to the left side effective information, obtain preamble;
Left side information concatenation unit, for splicing to the preamble and left side decoding result, obtain left side
Decoded result.
In a kind of optional embodiment, the effective information is positioned at the central seperating character and the Boundary Recognition
Complete bar sky information between symbol.
In a kind of optional embodiment, described device also includes:
Correction verification module, for being verified to the decoded result of the EAN13 codes;
Output module, for when verifying successfully, exporting the decoded result of the EAN13 codes, terminate decoding.
Compared to prior art, the beneficial effect of the embodiment of the present invention is:The embodiments of the invention provide a kind of EAN13
Code coding/decoding method and device, wherein method include:EAN13 codes are scanned using N bars scan line, judge to sweep described in each
Retouch the complete bar code information whether the bar sky information on line includes the EAN13 codes;When at least in a scan line
Complete bar code information of the bar sky packet containing the EAN13 codes when, it is complete comprising the EAN13 codes to wherein one
Bar sky information in the scan line of bar code information is decoded, and obtains the decoded result of the EAN13 codes;When being swept described in any bar
When retouching complete bar code information of the bar sky information on line all not comprising the EAN13 codes, judge in each scan line
Bar sky information whether include left side effective information or right side effective information;When the empty letter of bar at least in a scan line
When breath includes left side effective information, the left side effective information is decoded, obtains left side decoded result;When at least one
During bar sky packet effective information containing right side in the scan line, the right side effective information is decoded, obtains right side
Decoded result;The left side decoded result and the right side decoded result are spliced, obtain the decoding knot of the EAN13 codes
Fruit.A kind of the EAN13 codes coding/decoding method and device of the embodiment of the present invention are by carrying out unilateral identification to incomplete EAN13 codes
And decoding, and when bilateral information respectively decodes decoded result, the decoded result of bilateral is spliced, realized to band
The decoding of EAN13 codes for having defect or being stained;It is complete that EAN13 codes can not be scanned in energy of embodiment of the present invention scan line in office
During whole bar code information, by the way that the EAN13 codes of one side are identified and decoded, and the decoded result by splicing bilateral obtains
The decoded result of EAN13 codes, that improves EAN13 codes is decoded into power.
Brief description of the drawings
In order to illustrate more clearly of technical scheme, the required accompanying drawing used in embodiment will be made below
Simply introduce, it should be apparent that, drawings in the following description are only some embodiments of the present invention, general for this area
For logical technical staff, on the premise of not paying creative work, other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is the symbolic construction schematic diagram of EAN13 codes in the prior art;
Fig. 2 is a kind of schematic flow sheet of EAN13 codes coding/decoding method provided in an embodiment of the present invention;
Fig. 3 is the idiographic flow schematic diagram of the step S3 in Fig. 2;
Fig. 4 is the idiographic flow schematic diagram of step S4 in Fig. 2;
Fig. 5 is a kind of decoding schematic diagram of the EAN13 codes coding/decoding method provided according to embodiments of the present invention;
Fig. 6 is a kind of structural representation of EAN13 codes decoding apparatus provided in an embodiment of the present invention;
Fig. 7 is the structural representation of the second judge module 3 in Fig. 6;
Fig. 8 is the structural representation of left side formation-decoding module 4 in Fig. 6.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of protection of the invention.
Referring to Fig. 2, it is a kind of schematic flow sheet of EAN13 codes coding/decoding method provided in an embodiment of the present invention.At this
In inventive embodiments, a kind of EAN13 codes coding/decoding method, including:
S1, using multi-strip scanning line EAN13 codes are scanned, judge that the bar sky information in each scan line is
The no complete bar code information for including the EAN13 codes;
S2, when complete bar code information of the bar sky packet at least in a scan line containing the EAN13 codes
When, the bar sky information in the scan line of the wherein one complete bar code information comprising the EAN13 codes is decoded, obtained
The decoded result of the EAN13 codes;
S3, when the bar sky information described in any bar in scan line all do not include the EAN13 codes complete bar code information
When, judge whether the bar sky information in each scan line includes left side effective information or right side effective information;
S4, when the bar sky packet effective information containing left side at least in a scan line, have to the left side
Effect information is decoded, and obtains left side decoded result;
S5, when the bar sky packet effective information containing right side at least in a scan line, have to the right side
Effect information is decoded, and obtains right side decoded result;
S6, the left side decoded result and the right side decoded result are spliced, obtain the decoding of the EAN13 codes
As a result.
In step sl, laser one-line scanning, laser multi-thread scanning, CCD one-line scannings and cmos imaging can be used
The method of scanning is scanned to the EAN13 codes.
The operation principle of the embodiment of the present invention is:When that can be scanned by multi-strip scanning line, the complete bar of EAN13 codes is empty to be believed
During breath, the complete bar sky information of the EAN13 codes directly to scanning decodes, and obtains the decoded result of the EAN13 codes;
It is effective to the left side in each scan line when failing to scan the complete bar sky information of EAN13 codes by multi-strip scanning line
Information or right side effective information are individually identified and decoded, and when decoding left side decoded result and right side decoded result,
Splicing left side decoded result and right side decoded result, obtain the decoded result of the EAN13 codes.
A kind of EAN13 codes coding/decoding method of the embodiment of the present invention, it is proposed that a kind of unilateral decoding simultaneously splices bilateral decoding knot
The decoding process of fruit, the complete bar sky information of EAN13 codes but at least two scan lines are not all included in any bar scan line
It is upper respectively comprising in the case of left side effective information and right side effective information, by left side effective information and right side effective information
Decoding obtains left side decoded result and right side decoded result respectively, and splices left side decoded result and right side decoded result obtains institute
The decoded result of EAN13 codes is stated, so as to which improve EAN13 codes is decoded into power.
In a kind of optional embodiment, methods described also includes:
S7, the decoded result to the EAN13 codes verify;
S8, when verifying successfully, export the decoded result of the EAN13 codes, terminate decoding.
Referring to Fig. 3, it is the idiographic flow schematic diagram of the step S3 in Fig. 2.The step S3 of this implementation includes:
S31, when the bar sky information described in any bar in scan line all do not include the EAN13 codes complete bar code information
When, judge whether the bar sky information in each scan line includes the unilateral information module of the EAN13 codes;The one side
Information module includes central seperating character, Boundary Recognition symbol and between the central seperating character and Boundary Recognition symbol
Effective information;The Boundary Recognition symbol is starting character or full stop;
S32, when unilateral information module of the bar sky packet at least in a scan line containing the EAN13 codes
When, judge the type of coding of effective information in the unilateral information module;
S33, when effective information in the unilateral information module type of coding be left side information type of coding when, judge
Left side effective information is included in the unilateral information module;
S34, when effective information in the unilateral information module type of coding be right side information type of coding when, judge
Right side effective information is included in the unilateral information module.
In embodiments of the present invention, central seperating character, Boundary Recognition symbol and positioned at the central seperating character with it is described
Effective information between Boundary Recognition symbol is identified as the unilateral information module of entirety, when recognizing in scan line
Bar sky information when having unilateral information module, then show bar sky packet effective information containing left side or the right side in the scan line
Effective information;Due to left side effective information from right side effective information using different type of codings, thus pass through identification again
The type of coding of the effective information between the central seperating character and Boundary Recognition symbol, can distinguish described has
Effect information is left side effective information or right side effective information.
Referring to Fig. 4, it is the idiographic flow schematic diagram of the step S4 in Fig. 2.The step S4 of this implementation includes:
S41, when the bar sky packet effective information containing left side at least in a scan line, have to the left side
Effect information enters row decoding, obtains left side decoding result;
S42, the type of coding alternation rule according to the left side effective information, obtain preamble;
S43, the preamble and left side decoding result are spliced, obtain left side decoded result.
When decoding the left side effective information, because the type of coding alternation rule of the left side effective information correspond to
Preamble, therefore, on the left of decoding during effective information, the preamble is solved and spliced with left side decoding result, is made
For left side decoded result, and applied in follow-up splicing decoding.
In a kind of optional embodiment, the effective information is positioned at the central seperating character and the Boundary Recognition
Complete bar sky information between symbol.
In order to facilitate understanding, wherein the one of a kind of EAN13 codes coding/decoding method of the embodiment of the present invention will be exemplified below
Kind embodiment:
Referring to Fig. 5, it is a kind of decoding schematic diagram of the EAN13 codes coding/decoding method provided according to embodiments of the present invention;
A kind of defect situation of EAN13 codes is illustrated in figure.A to E bars scan line is scanned to EAN13 codes, but any bar scan line
On all do not include the EAN13 codes complete bar sky information;Judge whether the bar sky information in each scan line includes again
During unilateral information module, judge to include unilateral information module a on A sweep line, unilateral information module e is included in E scan lines;And then
Judge the type of coding of effective information in the unilateral information module e in unilateral information module a and the E scan lines on A sweep line;Sentence
The type of coding for determining unilateral information module a effective information on A sweep line meets the type of coding of left side information, in E scan lines
The type of coding of unilateral information module e effective information meets the type of coding of right side information, therefore can determine that and wrapped on A sweep line
Effective information containing left side, right side effective information is included in E scan lines;Row decoding is entered to left side effective information, left side is obtained and decodes
As a result it is 876544, and preamble is obtained as 9 by the type of coding alternation rule of left side effective information, therefore obtains left side and solve
Code result is 9876544,;Right side effective information is decoded, it is 304901 to obtain right side decoded result;Left side is decoded and tied
Fruit and right side decoded result are spliced, and obtain 9876544304901, i.e., the decoded result of described EAN13 codes.Finally, it is right
The decoded result of EAN13 codes is verified, and the result of verification is 1, is consistent with check bit 1, therefore, exports the EAN13 codes
Decoded result.
In order to realize identical purpose, another aspect of the present invention provides a kind of EAN13 codes decoding apparatus.Referring to Fig. 6,
It is a kind of structural representation of EAN13 codes decoding apparatus provided in an embodiment of the present invention.A kind of EAN13 codes decoding apparatus
Including:
First judge module 1, for being scanned using N bars scan line to EAN13 codes, judge each scan line
On bar sky information whether include the complete bar code information of the EAN13 codes;
First decoder module 2, for ought be at least in a scan line bar sky packet containing the EAN13 codes
During complete bar code information, to the empty letter of bar in the scan line of the wherein one complete bar code information comprising the EAN13 codes
Breath is decoded, and obtains the decoded result of the EAN13 codes;
Second judge module 3, for all not including the EAN13 codes when the bar sky information described in any bar in scan line
During complete bar code information, judge whether the bar sky information in each scan line has comprising left side effective information or right side
Imitate information;
Left side formation-decoding module 4, for ought be at least in a scan line bar sky packet containing left side it is effective
During information, the left side effective information is decoded, obtains left side decoded result;
Right side formation-decoding module 5, for ought be at least in a scan line bar sky packet containing right side it is effective
During information, the right side effective information is decoded, obtains right side decoded result;
Decoded result concatenation module 6, for splicing to the left side decoded result and the right side decoded result, obtain
To the decoded result of the EAN13 codes.
In the first judge module 1, can use the multi-thread scanning of laser one-line scanning, laser, CCD one-line scannings and
Cmos imaging scanning is scanned to the EAN13 codes.
In a kind of optional embodiment, described device also includes:
Correction verification module 7, for being verified to the decoded result of the EAN13 codes;
Output module 8, for when verifying successfully, exporting the decoded result of the EAN13 codes, terminate decoding.
Referring to Fig. 7, it is the structural representation of second judge module 3 in Fig. 6.Described the second of this implementation is sentenced
Disconnected module 3 includes:
Unilateral information module judging unit 31, described in all not including when the bar sky information described in any bar in scan line
During the complete bar code information of EAN13 codes, judge whether the bar sky information in each scan line includes the EAN13 codes
Unilateral information module;The unilateral information module includes central seperating character, Boundary Recognition symbol and positioned at the middle separation
Effective information between symbol and Boundary Recognition symbol;The Boundary Recognition symbol is starting character or full stop;
Type of coding judging unit 32, for ought be at least in a scan line bar sky packet containing described
During the unilateral information module of EAN13 codes, the type of coding of effective information in the unilateral information module is judged;
Left side information identifying unit 33, believe for the type of coding when effective information in the unilateral information module for left side
During the type of coding of breath, judge to include left side effective information in the unilateral information module;
Right side information identifying unit 34, believe for the type of coding when effective information in the unilateral information module for right side
During the type of coding of breath, judge to include right side effective information in the unilateral information module.
Referring to Fig. 8, it is the structural representation of the left side formation-decoding module 4 in Fig. 6.The left side of this implementation
Side formation-decoding module 4 includes:
Left side information decoding unit 41, for ought be at least in a scan line bar sky packet containing left side it is effective
During information, row decoding is entered to the left side effective information, obtains left side decoding result;
Preamble decoding unit 42, for the type of coding alternation rule according to the left side effective information, obtain preposition
Code;
Left side information concatenation unit 43, for splicing to the preamble and left side decoding result, obtain a left side
Side decoded result.
In a kind of optional embodiment, the effective information is positioned at the central seperating character and the Boundary Recognition
Complete bar sky information between symbol.
Compared to prior art, the beneficial effect of the embodiment of the present invention is:The embodiments of the invention provide a kind of EAN13
Code coding/decoding method and device, wherein method include:EAN13 codes are scanned using N bars scan line, judge to sweep described in each
Retouch the complete bar code information whether the bar sky information on line includes the EAN13 codes;When at least in a scan line
Complete bar code information of the bar sky packet containing the EAN13 codes when, it is complete comprising the EAN13 codes to wherein one
Bar sky information in the scan line of bar code information is decoded, and obtains the decoded result of the EAN13 codes;When being swept described in any bar
When retouching complete bar code information of the bar sky information on line all not comprising the EAN13 codes, judge in each scan line
Bar sky information whether include left side effective information or right side effective information;When the empty letter of bar at least in a scan line
When breath includes left side effective information, the left side effective information is decoded, obtains left side decoded result;When at least one
During bar sky packet effective information containing right side in the scan line, the right side effective information is decoded, obtains right side
Decoded result;The left side decoded result and the right side decoded result are spliced, obtain the decoding knot of the EAN13 codes
Fruit.A kind of the EAN13 codes coding/decoding method and device of the embodiment of the present invention are by carrying out unilateral identification to incomplete EAN13 codes
And decoding, and when bilateral information respectively decodes decoded result, the decoded result of bilateral is spliced, realized to band
The decoding of EAN13 codes for having defect or being stained;It is complete that EAN13 codes can not be scanned in energy of embodiment of the present invention scan line in office
During whole bar code information, by the way that the EAN13 codes of one side are identified and decoded, and the decoded result by splicing bilateral obtains
The decoded result of EAN13 codes, that improves EAN13 codes is decoded into power.
The above disclosed power for being only a kind of preferred embodiment of the present invention, the present invention can not being limited with this certainly
Sharp scope, one of ordinary skill in the art will appreciate that realizing all or part of flow of above-described embodiment, and weighed according to the present invention
Profit requires made equivalent variations, still falls within and invents covered scope.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with
The hardware of correlation is instructed to complete by computer program, described program can be stored in a computer read/write memory medium
In, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
Claims (10)
- A kind of 1. EAN13 codes coding/decoding method, it is characterised in that including:EAN13 codes are scanned using multi-strip scanning line, judge whether the bar sky information in each scan line includes The complete bar code information of the EAN13 codes;When complete bar code information of the bar sky packet at least in a scan line containing the EAN13 codes, to it In a complete bar code information comprising the EAN13 codes scan line on bar sky information decoded, obtain described The decoded result of EAN13 codes;When the bar sky information described in any bar in scan line does not all include the complete bar code information of the EAN13 codes, judge Whether the bar sky information in each scan line includes left side effective information or right side effective information;When the bar sky packet effective information containing left side at least in a scan line, the left side effective information is entered Row decoding, obtain left side decoded result;When the bar sky packet effective information containing right side at least in a scan line, the right side effective information is entered Row decoding, obtain right side decoded result;The left side decoded result and the right side decoded result are spliced, obtain the decoded result of the EAN13 codes.
- 2. a kind of EAN13 codes coding/decoding method as claimed in claim 1, it is characterised in that described to work as scan line described in any bar On bar sky information all do not include the EAN13 codes complete bar code information when, judge the bar in each scan line Whether empty information includes left side effective information or right side effective information, including:When the bar sky information described in any bar in scan line does not all include the complete bar code information of the EAN13 codes, judge Whether the bar sky information in each scan line includes the unilateral information module of the EAN13 codes;The unilateral information mould Block includes central seperating character, Boundary Recognition symbol and effective letter between the central seperating character and Boundary Recognition symbol Breath;The Boundary Recognition symbol is starting character or full stop;When unilateral information module of the bar sky packet at least in a scan line containing the EAN13 codes, institute is judged State the type of coding of effective information in unilateral information module;When the type of coding of effective information in the unilateral information module is the type of coding of left side information, the one side is judged Left side effective information is included in information module;When the type of coding of effective information in the unilateral information module is the type of coding of right side information, the one side is judged Right side effective information is included in information module.
- 3. a kind of EAN13 codes coding/decoding method as claimed in claim 2, it is characterised in that described at least to be swept described in one When retouching the bar sky packet effective information containing left side on line, the left side effective information is decoded, obtains left side decoding knot Fruit, including:When the bar sky packet effective information containing left side at least in a scan line, the left side effective information is entered Row decoding, obtain left side decoding result;According to the type of coding alternation rule of the left side effective information, preamble is obtained;The preamble and left side decoding result are spliced, obtain left side decoded result.
- 4. a kind of EAN13 codes coding/decoding method as claimed in claim 2, it is characterised in that the effective information is positioned at described Complete bar sky information between central seperating character and Boundary Recognition symbol.
- 5. a kind of EAN13 codes coding/decoding method as claimed in claim 1, it is characterised in that methods described also includes:The decoded result of the EAN13 codes is verified;When verifying successfully, the decoded result of the EAN13 codes is exported, terminates decoding.
- A kind of 6. EAN13 codes decoding apparatus, it is characterised in that including:First judge module, for being scanned using N bars scan line to EAN13 codes, judge in each scan line Whether bar sky information includes the complete bar code information of the EAN13 codes;First decoder module, for ought be at least in a scan line bar sky packet containing the complete of the EAN13 codes Bar code information when, to wherein one comprising the EAN13 codes complete bar code information scan line on bar sky information enter Row decoding, obtains the decoded result of the EAN13 codes;Second judge module, for all not including the complete of the EAN13 codes when the bar sky information described in any bar in scan line Bar code information when, judge whether the bar sky information in each scan line is effectively believed comprising left side effective information or right side Breath;Left side formation-decoding module, for bar sky packet effective information containing left side that ought be at least in a scan line When, the left side effective information is decoded, obtains left side decoded result;Right side formation-decoding module, for bar sky packet effective information containing right side that ought be at least in a scan line When, the right side effective information is decoded, obtains right side decoded result;Decoded result concatenation module, for splicing to the left side decoded result and the right side decoded result, obtain institute State the decoded result of EAN13 codes.
- 7. a kind of EAN13 codes decoding apparatus as claimed in claim 6, it is characterised in that second judge module includes:Unilateral information module judging unit, for all not including the EAN13 when the bar sky information described in any bar in scan line During the complete bar code information of code, judge whether the bar sky information in each scan line includes the list of the EAN13 codes Side information module;The unilateral information module include central seperating character, Boundary Recognition symbol and positioned at the central seperating character with Effective information between the Boundary Recognition symbol;The Boundary Recognition symbol is starting character or full stop;Type of coding judging unit, for ought be at least in a scan line bar sky packet containing the EAN13 codes During unilateral information module, the type of coding of effective information in the unilateral information module is judged;Left side information identifying unit, for when the volume that the type of coding of effective information in the unilateral information module is left side information During code type, judge to include left side effective information in the unilateral information module;Right side information identifying unit, for when the volume that the type of coding of effective information in the unilateral information module is right side information During code type, judge to include right side effective information in the unilateral information module.
- A kind of 8. EAN13 codes decoding apparatus as claimed in claim 7, it is characterised in that the left side formation-decoding module bag Include:Left side information decoding unit, for bar sky packet effective information containing left side that ought be at least in a scan line When, row decoding is entered to the left side effective information, obtains left side decoding result;Preamble decoding unit, for the type of coding alternation rule according to the left side effective information, obtain preamble;Left side information concatenation unit, for splicing to the preamble and left side decoding result, obtain left side and decode As a result.
- 9. a kind of EAN13 codes decoding apparatus as claimed in claim 7, it is characterised in that the effective information is positioned at described Complete bar sky information between central seperating character and Boundary Recognition symbol.
- 10. a kind of EAN13 codes decoding apparatus as claimed in claim 6, it is characterised in that described device also includes:Correction verification module, for being verified to the decoded result of the EAN13 codes;Output module, for when verifying successfully, exporting the decoded result of the EAN13 codes, terminate decoding.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711055722.7A CN107766770A (en) | 2017-10-31 | 2017-10-31 | A kind of EAN13 codes coding/decoding method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711055722.7A CN107766770A (en) | 2017-10-31 | 2017-10-31 | A kind of EAN13 codes coding/decoding method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107766770A true CN107766770A (en) | 2018-03-06 |
Family
ID=61272586
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711055722.7A Pending CN107766770A (en) | 2017-10-31 | 2017-10-31 | A kind of EAN13 codes coding/decoding method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107766770A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111797646A (en) * | 2020-07-08 | 2020-10-20 | 北京京东振世信息技术有限公司 | Bar code identification method and terminal |
CN112955896A (en) * | 2018-10-31 | 2021-06-11 | 三星电子株式会社 | Method and electronic device for reading bar code |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060163357A1 (en) * | 2002-10-31 | 2006-07-27 | Incolab Inc. | Two-dimensional code having superior decoding property which is possible to control the level of error correcting codes, and method for encoding and decoding the same |
CN101840497A (en) * | 2010-06-01 | 2010-09-22 | 福建新大陆电脑股份有限公司 | RSS barcode decoding method |
CN101882205A (en) * | 2010-06-01 | 2010-11-10 | 福建新大陆电脑股份有限公司 | Bar code image scanning method |
CN102629312A (en) * | 2012-01-10 | 2012-08-08 | 广州优库电子有限公司 | Omnidirectional multiple line laser bar code reading device and method thereof |
CN105975888A (en) * | 2016-05-04 | 2016-09-28 | 上海皇和信息科技有限公司 | Method of decoding defective one-dimensional barcode |
CN106203216A (en) * | 2016-06-30 | 2016-12-07 | 杭州晟元数据安全技术股份有限公司 | A kind of high-performance bar code decoding method |
CN106570438A (en) * | 2016-10-20 | 2017-04-19 | 上海皇和信息科技有限公司 | One-dimensional barcode decoding method based on bar vacancy unit amplification |
-
2017
- 2017-10-31 CN CN201711055722.7A patent/CN107766770A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060163357A1 (en) * | 2002-10-31 | 2006-07-27 | Incolab Inc. | Two-dimensional code having superior decoding property which is possible to control the level of error correcting codes, and method for encoding and decoding the same |
CN101840497A (en) * | 2010-06-01 | 2010-09-22 | 福建新大陆电脑股份有限公司 | RSS barcode decoding method |
CN101882205A (en) * | 2010-06-01 | 2010-11-10 | 福建新大陆电脑股份有限公司 | Bar code image scanning method |
CN102629312A (en) * | 2012-01-10 | 2012-08-08 | 广州优库电子有限公司 | Omnidirectional multiple line laser bar code reading device and method thereof |
CN105975888A (en) * | 2016-05-04 | 2016-09-28 | 上海皇和信息科技有限公司 | Method of decoding defective one-dimensional barcode |
CN106203216A (en) * | 2016-06-30 | 2016-12-07 | 杭州晟元数据安全技术股份有限公司 | A kind of high-performance bar code decoding method |
CN106570438A (en) * | 2016-10-20 | 2017-04-19 | 上海皇和信息科技有限公司 | One-dimensional barcode decoding method based on bar vacancy unit amplification |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112955896A (en) * | 2018-10-31 | 2021-06-11 | 三星电子株式会社 | Method and electronic device for reading bar code |
CN111797646A (en) * | 2020-07-08 | 2020-10-20 | 北京京东振世信息技术有限公司 | Bar code identification method and terminal |
CN111797646B (en) * | 2020-07-08 | 2021-06-29 | 北京京东振世信息技术有限公司 | Bar code identification method and terminal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11182659B2 (en) | Generating and decoding two-dimensional code | |
CN102799850B (en) | A kind of barcode recognition method and device | |
CN102136058B (en) | Bar code image identification method | |
US20190102649A1 (en) | Methods for optical character recognition (ocr) | |
CN105787340B (en) | Picture validation code implementation method based on text adhesion and vision compensation | |
CN103336938B (en) | A kind of recognition methods based on one-dimensional bar code image | |
CN101198961A (en) | Apparatus and process for two-stage decoding of high-density optical symbols | |
CN109670491A (en) | Identify method, apparatus, equipment and the storage medium of facial image | |
CN107766770A (en) | A kind of EAN13 codes coding/decoding method and device | |
CN111079641B (en) | Answer content identification method, related device and readable storage medium | |
CN110647956A (en) | Invoice information extraction method combined with two-dimensional code recognition | |
CN106446732A (en) | Barcode identification method, device and equipment | |
US6102295A (en) | Method and apparatus for decoding symbols by declaring erasures of element characteristics | |
CN113240431A (en) | Payment verification method and system based on three primary colors of picture pixels | |
CN105787403A (en) | Barcode reading method and device of high-pixel image | |
JPS58223876A (en) | Bar code recognizer | |
CN117094342A (en) | Image bar code detection method, device, equipment and storage medium | |
CN110135407A (en) | Sample mask method and computer storage medium | |
CN111738031B (en) | One-dimensional bar code identification method | |
CN105187443B (en) | A kind of system and method for test WEB identifying codes | |
KR100308415B1 (en) | Bar code reading device, bar code reading method and computer readable medium | |
CN101882201B (en) | Barcode decoding chip and method | |
CN113255668B (en) | Text recognition method and device, electronic equipment and storage medium | |
JP2020160961A (en) | Two-dimensional code reading device, computer program, and two-dimensional code | |
CN101882206B (en) | Decoding chip of RSS (Really Simple Syndication) bar code |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180306 |