CN106203216A - A kind of high-performance bar code decoding method - Google Patents

A kind of high-performance bar code decoding method Download PDF

Info

Publication number
CN106203216A
CN106203216A CN201610530247.3A CN201610530247A CN106203216A CN 106203216 A CN106203216 A CN 106203216A CN 201610530247 A CN201610530247 A CN 201610530247A CN 106203216 A CN106203216 A CN 106203216A
Authority
CN
China
Prior art keywords
scan line
bar code
decoding
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.)
Granted
Application number
CN201610530247.3A
Other languages
Chinese (zh)
Other versions
CN106203216B (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.)
Hangzhou Synodata Security Technology Co Ltd
Original Assignee
Hangzhou Synodata Security Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Synodata Security Technology Co Ltd filed Critical Hangzhou Synodata Security Technology Co Ltd
Priority to CN201610530247.3A priority Critical patent/CN106203216B/en
Publication of CN106203216A publication Critical patent/CN106203216A/en
Application granted granted Critical
Publication of CN106203216B publication Critical patent/CN106203216B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Abstract

The present invention relates to a kind of high-performance bar code decoding method, by first judging barcode types, determine scanning, decoding parametric according to barcode types, then use scanning, identify, while combination, scanned the method step i.e. decoded;Compared with prior art, method provided by the present invention can successfully manage in practical situation any one scan line the most not can completely scan the empty image of all bars of this bar code image cannot the problem of successfully decoded, improve decoding rate.Meanwhile, this high-performance bar code decoding method also has high-performance, also has, for noisy image, the decoding capability that energy is strong.

Description

A kind of high-performance bar code decoding method
Technical field
The invention belongs to Bar Code field, be specifically related to a kind of high-performance bar code decoding method.
Background technology
Bar Code is the emerging technology grown up on information technology and Fundamentals of Computer Technology, due to It identifies quickly, accurate, reliable and low cost and other advantages, is widely used in every field;Bar code is by arranged in parallel multiple " bar " and " empty " unit forms, and the information of bar code is expressed by the different in width combination that bar is empty;Processing in Barcode Recognizing System can be divided into Line scanning and Surface scan.Line run-down obtains the image of a scan line, and Surface scan once obtains several scan lines;In reality In application, due to various situations such as abrasion, print defect, light interference, the bar code image actually got can be caused to deposit At various disturbed conditions.The most any one scan line the most not can completely scans all bars sky of this bar code image, thus Cause the situation of None-identified.
Chinese patent literature (application number: 201010188937.8) discloses bar code image scanning method, this invention In search out and bar code progressively scanned behind the direction of bar code, border, decode line by line;But any one scan line all can not The image that the complete all bars scanning this bar code image are empty just cannot successfully decoded.
Chinese patent literature (application number: 201010188937.8) discloses bar code image scanning method, Ke Yiyou There is situation about being stained to bar code image in practical situation in effect, improves decoding rate;But it is only from the angle of image Distinguishing insult area and without insult area, its Rule of judgment may lose efficacy under given conditions, and not explanation How can combine without insult area.
For above-mentioned technical problem, therefore need to improve.
Summary of the invention
The present invention be in order to overcome above-mentioned of the prior art how will be without insult area combination and any one scan line The most not can completely scan the empty image of all bars of this bar code image cannot the defect of successfully decoded, it is provided that a kind of high-performance Bar code decoding method.
In order to reach object above, the technical solution adopted in the present invention is: a kind of high-performance bar code decoding method includes Following steps:
(1) first judge the type of bar code, according to the type of bar code, then according to certain intervals scanning barcode, obtain A0, A1, A2 ..., n bar scan line altogether;
(2) according to the bar sky ratio of every scan line, the bar sky ratio of known various bar code starting character is contrasted, it is judged that this scan line can It can be any bar code;For there being the scan line being stained, it is more likely that can not judge barcode types;
(3) add up the possible barcode types that all scan lines calculate, select the most barcode types of occurrence number as this The barcode types of decoding;Record scan line Ax being judged as this barcode types, as sweep starting point simultaneously;
(4) according to the barcode types calculated, scanning limit, limit decodes, and obtains the elementary cell of each code word, i.e. empty by several long narrow tables Composition;
(5) scan line Ax, finds 1 code word backward, is decoded according to barcode types;
(6) statistical decoder result, selects the decoded result that occurrence number is most, as the decoded result of this code word;It is stored in decoding In result;And scan line Ay that minute book codeword decoding is correct;
(7) according to the bar empty position of this code word in scan line Ay, other scan line not calculated is searched for, if also having it Its scan line decoding is correct, this scan line is added in Ay;
(8) scan line Ax being emptied, scan line Ay is stored in Ax, returns in step (5), solves next code word, the like, Until not having code word to solve, or there is codeword decoding failure;
(9) decoded result calculates verification according to barcode types, it may be judged whether successfully decoded.
The invention has the beneficial effects as follows: compared with prior art, method provided by the present invention can successfully manage reality The image that in situation, any one scan line the most not can completely scans all bars of this bar code image empty cannot successfully decoded Problem, improve decoding rate.Meanwhile, this high-performance bar code decoding method also has high-performance, also has for noisy image The decoding capability that energy is strong.
Accompanying drawing explanation
Fig. 1 is embodiment of the present invention flow chart.
Fig. 2 is that the embodiment of the present invention has the Code128 code schematic diagram being stained.
Fig. 3 is that embodiment of the present invention Code128 code type judges schematic diagram.
Fig. 4 is embodiment of the present invention Code128 code StartC starting character schematic diagram.
Fig. 5 is that embodiment of the present invention Code128 code StartC starting character judges type schematic diagram.
Fig. 6 is first code word schematic diagram of embodiment of the present invention Code128 code solution.
Fig. 7 is second code word schematic diagram of embodiment of the present invention Code128 code solution.
Fig. 8 is that embodiment of the present invention Code128 code solves the 3rd code word schematic diagram.
Fig. 9 is that embodiment of the present invention Code128 code has decoded word schematic diagram.
Figure 10 is that the embodiment of the present invention has the Code93 code schematic diagram being stained.
Figure 11 is embodiment of the present invention Code93 code StartC starting character schematic diagram.
Detailed description of the invention
The present invention is described in detail with embodiment below in conjunction with the accompanying drawings.
The present invention, by while scanning, identifies, while combination, has scanned the method i.e. decoded, has had effect The image any one scan line the most not can completely in practical situation scanning all bars of this bar code image empty cannot solve Code successfully problem, the problem that simultaneously can solve how will to combine without insult area, improves decoding rate, for noisy figure As also there being the decoding capability that energy is strong.
The invention provides embodiment: as it is shown in figure 1, first judge barcode types, determine scanning according to barcode types, solve Code parameter, comprises the following steps:
(1) type of bar code is first judged, for there being the scan line being stained, it is more likely that can not judge barcode types;As shown in Figure 2 Be stained serious Code128 code, as shown in Figure 10 be stained serious Code93 code schematic diagram.
According to the type of bar code, then according to certain intervals scanning barcode, as it is shown on figure 3, Code128 code interval is arranged Become 8 row, obtain A0, A1, A2 ..., 8 scan lines altogether;
(2) according to the bar sky ratio of Code128 every the scan line of code shown in Fig. 3, the bar of known various bar code starting character is contrasted Empty ratio, it is judged that what bar code is this scan line be probably;As shown in Figure 4: in Code128 bar code, StartC starting character is 33 skies, Wherein bar sky ratio is: 211232;As shown in figure 11: Code93 bar code starting character is 33 skies, and wherein bar sky ratio is: 111141;Find StartC starting character in Code128 bar code, carry out the judgement of Code128 code type as shown in Figure 5;
(3) add up the possible barcode types that all scan lines calculate, select the most barcode types of occurrence number as this The barcode types of decoding;Record scan line Ax being judged as this barcode types, as sweep starting point simultaneously;
(4) according to the barcode types calculated, scanning limit, limit decodes, obtains the elementary cell of each code word, such as: Code128 is by 3 The empty composition of bar 3, Code93 is made up of 33 skies.
(5) scan line Ax, finds 1 code word (Code128 code is 33 skies) as shown in Figure 6, backward according to barcode types It is decoded;
(6) statistical decoder result, selects the decoded result that occurrence number is most, as the decoded result of this code word;It is stored in decoding In result;And scan line Ay that minute book codeword decoding is correct;
(7) according to the bar empty position of this code word in scan line Ay, other scan line not calculated is searched for, if also having it Its scan line decoding is correct, this scan line is added in Ay;
(8) scan line Ax being emptied, scan line Ay is stored in Ax, returns in step (5), solves next code word, such as Fig. 7-9 institute Show, the like, until not having code word to solve, or there is codeword decoding failure;In Code128 code decoding process, can be certainly Dynamic will calculate correct region, and merge;
(9) decoded result calculates verification according to barcode types, it may be judged whether successfully decoded.
The present invention, by first judging barcode types, determines scanning, decoding parametric according to barcode types, then uses Scanning, identifies, while combination, has scanned the method step i.e. decoded, has improved decoding ranges, improves decoding speed Degree, has high-performance, also has, for noisy image, the decoding capability that energy is strong.
Described above to the disclosed embodiments, makes professional and technical personnel in the field be capable of or uses the present invention. Multiple amendment to these embodiments will be apparent from for those skilled in the art, as defined herein General Principle can realize without departing from the spirit or scope of the present invention in other embodiments;Therefore, the present invention It is not intended to be limited to the embodiments shown herein, and is to fit to and principles disclosed herein and features of novelty phase one The widest scope caused.

Claims (1)

1. a high-performance bar code decoding method, it is characterised in that: described a kind of high-performance bar code decoding method includes following step Rapid:
(1) first judge the type of bar code, according to the type of bar code, then according to certain intervals scanning barcode, obtain A0, A1, A2 ..., n bar scan line altogether;
(2) according to the bar sky ratio of every scan line, the bar sky ratio of known various bar code starting character is contrasted, it is judged that this scan line can It can be any bar code;
(3) add up the possible barcode types that all scan lines calculate, select the most barcode types of occurrence number as this The barcode types of decoding;Record scan line Ax being judged as this barcode types, as sweep starting point simultaneously;
(4) according to the barcode types calculated, scanning limit, limit decodes, obtains the elementary cell of each code word;
(5) scan line Ax, finds 1 code word backward, is decoded according to barcode types;
(6) statistical decoder result, selects the decoded result that occurrence number is most, as the decoded result of this code word;It is stored in decoding In result;And scan line Ay that minute book codeword decoding is correct;
(7) according to the bar empty position of this code word in scan line Ay, other scan line not calculated is searched for, if also having it Its scan line decoding is correct, this scan line is added in Ay;
(8) scan line Ax being emptied, scan line Ay is stored in Ax, returns in step (5), solves next code word, the like, Until not having code word to solve, or there is codeword decoding failure;
(9) decoded result calculates verification according to barcode types, it may be judged whether successfully decoded.
CN201610530247.3A 2016-06-30 2016-06-30 A kind of bar code decoding method Active CN106203216B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610530247.3A CN106203216B (en) 2016-06-30 2016-06-30 A kind of bar code decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610530247.3A CN106203216B (en) 2016-06-30 2016-06-30 A kind of bar code decoding method

Publications (2)

Publication Number Publication Date
CN106203216A true CN106203216A (en) 2016-12-07
CN106203216B CN106203216B (en) 2018-11-09

Family

ID=57472400

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610530247.3A Active CN106203216B (en) 2016-06-30 2016-06-30 A kind of bar code decoding method

Country Status (1)

Country Link
CN (1) CN106203216B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016318A (en) * 2017-03-21 2017-08-04 浙江华睿科技有限公司 A kind of bar code decoding method and device
CN107016317A (en) * 2017-03-02 2017-08-04 浙江华睿科技有限公司 A kind of bar code decoding method and device
CN107766770A (en) * 2017-10-31 2018-03-06 广东旭龙物联科技股份有限公司 A kind of EAN13 codes coding/decoding method and device
CN108090390A (en) * 2017-12-28 2018-05-29 广州尚臣电子有限公司 A kind of bar code stitching algorithm
CN111008540A (en) * 2019-11-29 2020-04-14 联想(北京)有限公司 Bar code identification method and equipment and computer storage medium
CN111488748A (en) * 2019-01-25 2020-08-04 顺丰科技有限公司 Logistics scanning system and method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201294002Y (en) * 2008-08-12 2009-08-19 东莞文胜鼎电子科技有限公司 Bar-code scanning system based on ZigBee wireless transmission
CN101840496B (en) * 2010-06-01 2012-12-12 福建新大陆电脑股份有限公司 One-dimensional barcode decoding chip
US8523076B2 (en) * 2012-01-10 2013-09-03 Metrologic Instruments, Inc. Omnidirectional laser scanning bar code symbol reader generating a laser scanning pattern with a highly non-uniform scan density with respect to line orientation
CN102880850B (en) * 2012-09-19 2015-08-19 腾讯科技(深圳)有限公司 A kind of method of Quick Response Code batch scanning and scanning device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201294002Y (en) * 2008-08-12 2009-08-19 东莞文胜鼎电子科技有限公司 Bar-code scanning system based on ZigBee wireless transmission
CN101840496B (en) * 2010-06-01 2012-12-12 福建新大陆电脑股份有限公司 One-dimensional barcode decoding chip
US8523076B2 (en) * 2012-01-10 2013-09-03 Metrologic Instruments, Inc. Omnidirectional laser scanning bar code symbol reader generating a laser scanning pattern with a highly non-uniform scan density with respect to line orientation
CN102880850B (en) * 2012-09-19 2015-08-19 腾讯科技(深圳)有限公司 A kind of method of Quick Response Code batch scanning and scanning device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016317A (en) * 2017-03-02 2017-08-04 浙江华睿科技有限公司 A kind of bar code decoding method and device
CN107016317B (en) * 2017-03-02 2019-12-24 浙江华睿科技有限公司 Bar code decoding method and device
CN107016318A (en) * 2017-03-21 2017-08-04 浙江华睿科技有限公司 A kind of bar code decoding method and device
CN107016318B (en) * 2017-03-21 2019-09-17 浙江华睿科技有限公司 A kind of bar code decoding method and device
CN107766770A (en) * 2017-10-31 2018-03-06 广东旭龙物联科技股份有限公司 A kind of EAN13 codes coding/decoding method and device
CN108090390A (en) * 2017-12-28 2018-05-29 广州尚臣电子有限公司 A kind of bar code stitching algorithm
CN111488748A (en) * 2019-01-25 2020-08-04 顺丰科技有限公司 Logistics scanning system and method
CN111008540A (en) * 2019-11-29 2020-04-14 联想(北京)有限公司 Bar code identification method and equipment and computer storage medium

Also Published As

Publication number Publication date
CN106203216B (en) 2018-11-09

Similar Documents

Publication Publication Date Title
CN106203216A (en) A kind of high-performance bar code decoding method
US10325129B2 (en) Method and apparatus for ordering code candidates in image for decoding attempts
CN103034831B (en) Method and system for identifying linear bar code
CN104732183A (en) One-dimensional barcode identification method based on image sampling line grey scale information analysis
CN110084236B (en) Image correction method and device
EP2393036B1 (en) Barcode decoding chip
US7422153B2 (en) Decoding with data from multiple scans
EP1836646B1 (en) Bar code scanner decoding
CN101226631A (en) Super-resolution image reconstruction method and apparatus
JP2010170539A5 (en)
CN103793679A (en) One-dimensional bar code recognition method based on DaVinci technology
CN103034830B (en) Bar code decoding method and device
US9600700B1 (en) Portable electronic device and operation method thereof
CN103034833B (en) Bar code positioning method and bar code detection device
CN103020634A (en) Segmentation method and device for recognizing identifying codes
JP5819925B2 (en) Code reading device and code reading program
CN113435436A (en) Scene character recognition method based on linear constraint correction network
US7587088B2 (en) Method and apparatus for image processing
CN100454327C (en) Identification method for data matrix code
WO1996009597A1 (en) Method and apparatus for detecting and adaptively decoding bar code symbols in continuous images
CN103778398A (en) Image fuzziness estimation method
CN110097065A (en) A kind of line detection method and terminal based on FreeMan chain code
JP2009123096A (en) Optical information reader
US20070221734A1 (en) System and method for bar code detection
Liyanage Efficient decoding of blurred, pitched, and scratched barcode images

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant