[go: up one dir, main page]

CN105868667B - Bar code decoding method - Google Patents

Bar code decoding method Download PDF

Info

Publication number
CN105868667B
CN105868667B CN201610183387.8A CN201610183387A CN105868667B CN 105868667 B CN105868667 B CN 105868667B CN 201610183387 A CN201610183387 A CN 201610183387A CN 105868667 B CN105868667 B CN 105868667B
Authority
CN
China
Prior art keywords
bar code
point
distance
target
gray
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
CN201610183387.8A
Other languages
Chinese (zh)
Other versions
CN105868667A (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.)
Qisda Suzhou Co Ltd
Qisda Corp
Original Assignee
Qisda Suzhou Co Ltd
Qisda Corp
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 Qisda Suzhou Co Ltd, Qisda Corp filed Critical Qisda Suzhou Co Ltd
Priority to CN201610183387.8A priority Critical patent/CN105868667B/en
Publication of CN105868667A publication Critical patent/CN105868667A/en
Application granted granted Critical
Publication of CN105868667B publication Critical patent/CN105868667B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10821Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum further details of bar or optical code scanning devices

Landscapes

  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

The present invention provides a kind of bar code decoding method, comprising:The target image of target barcode is captured with bar code reader;In sets target scan line on target image;The relativeness between at least two characteristic points in the gray-scale distribution of target scanning lines is analyzed according to coding rule to obtain at least one fixed reference feature parameter;When at least one fixed reference feature parameter is consistent with least one first predetermined characteristic parameter, judge the current distance between bar code reader and target barcode to be relatively remote;When judge at present distance as it is relatively remote when the gray-scale distribution of target scanning lines is divided into by least one secret note and informal voucher area with predetermined grey decision-making;Grayscale section is set according to predetermined grey decision-making, at least one wave crest and trough point in grayscale section is found out from the gray-scale distribution of target scanning lines;When wave crest point is located in secret note area, the informal voucher of corresponding wave crest point is inserted into secret note area;When trough point is located in informal voucher area, the secret note of corresponding trough point is inserted into informal voucher area.

Description

Bar code decoding method
Technical field
The present invention is espespecially a kind of effectively to lift the bar code decoding side for being decoded into power on a kind of bar code decoding method Method.
Background technology
Bar code (barcode) is the multiple secret notes and blank for not waiting width, is arranged according to certain coding rule, to Express the figure identification member of one group of information.Bar code can mark the producing country of article, manufacturing firm, trade name, the date of manufacture, The information such as book classification number, mail start-stop place, classification, date, thus in commodity circulation, taking care of books, postal management, bank Many fields such as system, which are obtained for, to be widely applied.
When reading bar code with bar code reader, the depth of field, Image Sensor pixel and optical lens characteristic etc. all can shadows Ring the bar code black and white element of the distinguishable minimum widith of bar code reader.It is read when bar code reader is more remote apart from bar code Bar code density is higher and thinner.At this time, the barcode image that bar code reader captures will be fuzzyyer.Particularly can not zoom The bar code reader barcode image that easily occurs to capture have fuzzy problem, and then cause decoding capability to reduce.
The content of the invention
It is an object of the present invention to providing a kind of can effectively be lifted to be decoded into the bar code decoding method of power, to solve The above problem.
In order to achieve the above object, the present invention provides a kind of bar code decoding method, comprises the steps of:
The target image of target barcode is captured with bar code reader;
In sets target scan line on the target image;
The relativeness between at least two characteristic points in the gray-scale distribution of the target scanning lines is analyzed according to coding rule, To obtain at least one fixed reference feature parameter;
When at least one fixed reference feature parameter is consistent with least one first predetermined characteristic parameter, the bar code reading is judged Take the current distance between machine and the target barcode relatively remote for one;
When judging that the current distance is relatively remote for this, with predetermined grey decision-making by the gray-scale distribution of the target scanning lines It is divided at least one secret note area and at least one informal voucher area;
According to the predetermined grey decision-making setting grayscale section, and found out from the gray-scale distribution of the target scanning lines positioned at the grayscale At least one wave crest point and at least one trough point in section;
When wave crest point is located at least one secret note area, the corresponding wave crest point is inserted at least one secret note area An informal voucher;And
When trough point is located at least one informal voucher area, the corresponding trough point is inserted at least one informal voucher area A secret note.
Preferably, additionally comprise the following steps:
Increase by an interpolated point between every two neighbor pixel for the gray-scale distribution of the target scanning lines;
When the wave crest point is located at least one secret note area, with the wave crest point and adjacent with the wave crest point this is interior Insert width of the width of point as the informal voucher;And
When the trough point is located at least one informal voucher area, with the trough point and adjacent with the trough point this is interior Insert width of the width of point as the secret note.
Preferably, additionally comprise the following steps:It is predetermined using the average gray-scale value of the gray-scale distribution of the target scanning lines as this Grey decision-making.
Preferably, additionally comprise the following steps:
When at least one fixed reference feature parameter is consistent with least one second predetermined characteristic parameter, the bar code reading is judged It is relatively middle distance to take the current distance between machine and the target barcode;And
When judge the current distance for this relatively in apart from when, the grayscale according to the predetermined grey decision-making to the target scanning lines Distribution carries out binaryzation.
Preferably, additionally comprise the following steps:
When at least one fixed reference feature parameter is consistent with least one 3rd predetermined characteristic parameter, the bar code reading is judged It is relative proximity distance to take the current distance between machine and the target barcode;
When judge the current distance for the relative proximity apart from when, which is filtered with it is downsampled;And
Binaryzation is carried out to the gray-scale distribution of the target scanning lines according to the predetermined grey decision-making.
Preferably, additionally comprise the following steps:
Multiple sample images of a sample bar code are captured under multiple preset distances with the bar code reader, each of which is pre- Set a distance is belonging respectively to one of relatively remote, the relatively middle distance and relative proximity distance;
In setting a sample scan line on each sample image;And
The phase between at least two characteristic points in the gray-scale distribution of each scan sample line is analyzed according to the coding rule To relation, to obtain corresponding to relatively remote at least one first predetermined characteristic parameter, correspond to the relatively middle distance At least one 3rd predetermined characteristic parameter of at least one second predetermined characteristic parameter and the corresponding relative proximity distance.
Preferably, the relativeness between at least two characteristic point is pixel distance, grayscale difference value or its combination.
Preferably, at least two characteristic point is two adjacent wave peak dots and trough point, two adjacent wave peak dots, two adjacent wave paddy Point or its combination.
Preferably, when at least one fixed reference feature parameter and N number of phase at least one first predetermined characteristic parameter When according with, and being consistent with M at least one second predetermined characteristic parameter, which additionally comprises the following steps:
When N is more than M, judge that the current distance is relatively remote for this;And
When N is less than or equal to M, judge the current distance for the relatively middle distance;
Wherein, N and M is all positive integer.
Preferably, when at least one fixed reference feature parameter and N number of phase at least one second predetermined characteristic parameter When according with, and being consistent with M at least one 3rd predetermined characteristic parameter, which additionally comprises the following steps:
When N is more than M, judge the current distance for the relatively middle distance;And
When N is less than or equal to M, judge the current distance for the relative proximity distance;
Wherein, N and M is all positive integer.
Compared with prior art, bar code decoding method provided by the invention, when the present invention judges bar code reader and target The current distance of bar intersymbol for it is relatively remote when, the present invention be first by the gray-scale distribution of target scanning lines be divided into secret note area and Informal voucher area, corresponding informal voucher is inserted into secret note area further according to the wave crest point in grayscale section and/or according in grayscale section Trough point is inserted into corresponding secret note in informal voucher area, effectively to reduce the distribution of the secret note of target barcode and informal voucher.Thereby, you can When current distance between bar code reader and target barcode is relatively remote, the successfully decoded of target barcode is effectively lifted Rate.
Brief description of the drawings
Fig. 1 is the flow chart that the bar code decoding method of the present invention establishes the table of comparisons of barcode image feature and relative distance;
Fig. 2 is bar code reader and the schematic diagram of sample bar code;
Fig. 3 be the preset distance of bar code reader and sample strip intersymbol be relatively in apart from when the gray-scale distribution that obtains show It is intended to;
Fig. 4 is showing for the gray-scale distribution that is obtained when the preset distance of bar code reader and sample strip intersymbol is relatively remote It is intended to;
Fig. 5 be the preset distance of bar code reader and sample strip intersymbol be relative proximity apart from when the gray-scale distribution that obtains show It is intended to;
Fig. 6 A to Fig. 6 C are the flow chart according to the bar code decoding method of one embodiment of the invention;
Fig. 7 is the schematic diagram of target barcode;
Fig. 8 is the schematic diagram of the gray-scale distribution of the target scanning lines on target image, wherein the grayscale of target scanning lines point Cloth is divided into secret note area and informal voucher area;
Fig. 9 is the signal that wave crest point and trough point in grayscale section are found out from the gray-scale distribution of target scanning lines Figure;
Figure 10 is to increase the schematic diagram of interpolated point between every two neighbor pixel for the gray-scale distributions of target scanning lines;
Figure 11 is the informal voucher that corresponding wave crest point is inserted into secret note area, and the secret note of corresponding trough point is inserted into informal voucher area Schematic diagram.
Embodiment
To make to have further understanding to the purpose of the present invention, construction, feature and its function, hereby coordinate embodiment detailed It is described as follows.
Please refer to Fig.1 to Fig. 5, the bar code decoding method that Fig. 1 is the present invention establishes barcode image feature and relative distance The flow chart of the table of comparisons, Fig. 2 are bar code reader 10 and the schematic diagram of sample bar code 12, and Fig. 3 is bar code reader 10 and sample Preset distance between bar code 12 in relatively apart from when the schematic diagram of gray-scale distribution that obtains, Fig. 4 is bar code reader 10 and sample Preset distance between this bar code 12 for it is relatively remote when the schematic diagram of gray-scale distribution that obtains, Fig. 5 for bar code reader 10 with Preset distance between sample bar code 12 for relative proximity apart from when the schematic diagram of gray-scale distribution that obtains.
The present invention is that the image feature of sample bar code 12 is obtained by bar code reader (barcode reader) 10, then is estimated Bar code reader 10 and the relative distance of sample bar code 12 are surveyed, to provide the reading of the bar code of no proximity sensor or zoom capabilities The relative distance information that machine is needed in decoding, and then effectively lifted and be decoded into power.Therefore, before being decoded to bar code, The bar code decoding method of the present invention need to first establish the table of comparisons of barcode image feature and relative distance.
First, step S10 is performed, there is provided a sample bar code 12.In this embodiment, the coding of sample bar code 12 meets spy Fixed coding rule.As shown in Fig. 2, the coding of sample bar code 12 may conform to the coding rule of Code 39, therefore, in decoding sample After this bar code 12, you can obtain " the coding of * 3A* ".Due to can all have fixed starting before and after sample bar code 12 with terminating word First " * ", therefore, the present invention can utilize this special section, establish the table of comparisons of barcode image feature and relative distance.Need to illustrate , the coding of sample bar code 12 also can select other coding rules according to the actual requirements, not with the coding rule of Code 39 It is limited.
Then, step S12 is performed, captures multiple samples of sample bar code 12 under multiple preset distances with bar code reader 10 This image, each of which preset distance are belonging respectively to one of relatively remote, relatively middle distance and relative proximity distance.
Then, step S14 is performed, in setting scan sample line 14 on each sample image.Scan sample line 14 can be set A horizontal line being set on the sample image of sample bar code 12, as shown in Figure 2.
Then, step S16 is performed, is analyzed according to coding rule in the gray-scale distribution of each scan sample line 14 at least Relativeness between two characteristic points, to obtain corresponding relatively remote at least one first predetermined characteristic parameter, corresponding phase At least one second predetermined characteristic parameter of centering distance and at least one 3rd predetermined characteristic parameter of corresponding relative proximity distance.
In this embodiment, Fig. 3 be the preset distance between bar code reader 10 and sample bar code 12 be relatively in apart from when The gray-scale distribution of acquirement, Fig. 4 are that the preset distance between bar code reader 10 and sample bar code 12 obtains when relatively remote Gray-scale distribution, and Fig. 5 be preset distance between bar code reader 10 and sample bar code 12 be relative proximity apart from when the grayscale that obtains Distribution, wherein triangle and wave crest point and trough point that square is respectively gray-scale distribution.
The desirable two adjacent wave peak dot A as shown in Figures 3 to 5 of the present invention and trough point B, two adjacent wave peak dot C, E and Two adjacent wave valley point D and wave crest point E is analyzed as three groups of characteristic points.It should be noted that the present invention can be answered according to actual By the use of selection two adjacent peaks and trough, two adjacent peaks, two adjacent wave paddy or its combine as characteristic point and analyzed, not with Embodiment shown in Fig. 3 to Fig. 5 is limited.
For example, it is defined as when can be 7 centimeters by the preset distance between bar code reader 10 and sample bar code 12 opposite Middle distance, and the gray-scale distribution shown in Fig. 3 is obtained with this relatively middle distance, wherein two adjacent wave peak dot A and trough point B is at a distance of 5 A pixel distance, two adjacent wave peak dot C, E, 5 pixel distances, and the grayscale difference of two adjacent wave valley point D and wave crest point E apart It is worth for 35.In addition, it is defined as opposite long distance when can be 13 centimeters by the preset distance between bar code reader 10 and sample bar code 12 From, and with this relatively remote gray-scale distribution obtained shown in Fig. 4, wherein two adjacent wave peak dot A and trough point B is at a distance of 3 pictures Plain distance, two adjacent wave peak dot C, E are at a distance of 1 pixel distance, and the grayscale difference value of two adjacent wave valley point D and wave crest point E is 7.Furthermore relative proximity distance is defined as when can be 4 centimeters by the preset distance between bar code reader 10 and sample bar code 12, and with This relative proximity distance obtains the gray-scale distribution shown in Fig. 5, wherein two adjacent wave peak dot A and trough point B be at a distance of 8 pixel distances, Two adjacent wave peak dot C, E are at a distance of 7 pixel distances, and the grayscale difference value of two adjacent wave valley point D and wave crest point E is 14.Need It is bright, according to practical application pixel distance, grayscale difference value or its combination between two characteristic points can be selected to be used as two characteristic points Between relativeness, be not limited with the above embodiments.
Multiple sample images of sample bar code 12 are being captured under multiple and different preset distances with bar code reader 10, and After analysis as above being carried out to the gray-scale distribution of the scan sample line 14 of each sample image, you can establish as shown in table 1 below Barcode image feature and relative distance the table of comparisons.
Table 1
Fig. 6 A to Figure 11 are referred to, Fig. 6 A to Fig. 6 C are the flow according to the bar code decoding method of one embodiment of the invention Figure, Fig. 7 are the schematic diagram of target barcode 32;Fig. 8 is the schematic diagram of the gray-scale distribution of target scanning lines 34, wherein target scanning lines 34 gray-scale distribution is divided into secret note area BA and informal voucher area SA;Fig. 9 is to find out to be located at from the gray-scale distribution of target scanning lines 34 The schematic diagram of wave crest point P1-P5 and trough point V1-V4 in the GTHmax-GTHmin of grayscale section;Figure 10 is to be swept for target Retouch the gray-scale distribution of line 34 increases the schematic diagram of interpolated point between every two neighbor pixel;Figure 11 is to be inserted into secret note area BA The informal voucher S1-S5 of corresponding wave crest point P1-P5, and the schematic diagram for the secret note B1 for corresponding to trough point V1 is inserted into informal voucher area SA.
After the table of comparisons of barcode image feature as listed in Table 1 and relative distance is established, you can according to table 1 to Fig. 7 Shown target barcode 32 is decoded.It should be noted that since table 1 is established according to the coding rule of Code 39, because This, target barcode 32 also needs the coding rule for meeting Code 39.In other words, the coding rule of target barcode 32 need to meet to Establish the coding rule of table 1.
First, step S30 is performed, the target image of target barcode 32 is captured with bar code reader 10.
Then, step S32 is performed, in sets target scan line 34 on target image, as shown in Figure 7.
Then, step S34 is performed, in the gray-scale distribution that target scanning lines 34 are analyzed according to the coding rule of target barcode 32 At least two characteristic points between relativeness, to obtain at least one fixed reference feature parameter.Since table 1 is with Fig. 3 to Fig. 5 institutes The two adjacent wave peak dot A shown are with trough point B, two adjacent wave peak dot C, E and two adjacent wave valley point D and wave crest point E as three groups Characteristic point and establish, therefore, the present invention can be according to two adjacent wave peak dot A in the gray-scale distributions of target scanning lines 34 and trough point B, the relativeness (as shown in Figure 8) of two adjacent wave peak dot C, E and two adjacent wave valley point D and wave crest point E, obtains three references Characteristic parameter, that is, the pixel distance of two adjacent wave peak dot A and trough point B, the pixel distance of two adjacent wave peak dot C, E, with two The grayscale difference value of adjacent wave valley point D and wave crest point E.
Then, the fixed reference feature parameter and table 1 obtained according to step S34 is judged between bar code reader 10 and target barcode 32 Current distance why.When the fixed reference feature parameter that step S34 is obtained is consistent with the first predetermined characteristic parameter in table 1, hold Row step S36, judges the current distance between bar code reader 10 and target barcode 32 to be relatively remote.
When judging the current distance between bar code reader 10 and target barcode 32 to be relatively remote, step S38 is performed, Binaryzation is carried out to the gray-scale distribution of target scanning lines 34 with predetermined grey decision-making PG, the gray-scale distribution of target scanning lines 34 is drawn It is divided at least one secret note area BA and at least one informal voucher area SA.As shown in figure 8, predetermined grey decision-making PG is by target scanning lines 34 Gray-scale distribution be divided into an a secret note area BA and informal voucher area SA.It should be noted that the reading knot according to different bar codes The quantity of fruit, secret note area BA or informal voucher area SA also can be multiple, be not limited with one., can be with targeted scans in this embodiment The average gray-scale value of the gray-scale distribution of line 34 is not limited as predetermined grey decision-making PG.Predetermined grey decision-making PG also can basis Practical application and have different settings.
Then, step S40 is performed, a grayscale section GTHmax-GTHmin is set according to predetermined grey decision-making PG, and from target The gray-scale distribution of scan line 34 finds out at least one wave crest point P1-P5 in the GTHmax-GTHmin of grayscale section and extremely A few trough point V1-V4.In this embodiment, an estimated rate can be taken (for example, positive and negative according to predetermined grey decision-making PG up and down 25%) grayscale section GTHmax-GTHmin is obtained.As shown in figure 9, there are five wave crest point P1-P5 and four trough points V1-V4 In the GTHmax-GTHmin of grayscale section.It should be noted that according to the reading result of different bar codes and setting for different grayscale sections Fixed, the quantity of wave crest point or trough point in the GTHmax-GTHmin of grayscale section can be one or more, not with shown in Fig. 9 Embodiment be limited.
Next, it is determined that whether wave crest point P1-P5 is located in secret note area BA, and judge whether trough point V1-V4 is located at informal voucher In area SA.Then, step S42 is performed when wave crest point is located in secret note area BA, and corresponding wave crest point is inserted into secret note area BA One informal voucher;When trough point is located in informal voucher area SA, a secret note of corresponding trough point is inserted into informal voucher area SA.
In this embodiment, the present invention can first be directed to the gray-scale distribution of target scanning lines 34 between every two neighbor pixel Increase by an interpolated point.Therefore, 32 pixels increase that the gray-scale distribution of target scanning lines 34 can be as shown in Figure 9 is shown in Figure 10 63 pixels.Assuming that the grey decision-making of two neighbor pixels is x [n] and x [n+1], and the grey decision-making of interpolated point is x [n+ 0.5], then the grey decision-making of interpolated point can be calculated by following equation one.
Formula one:X [n+0.5]=(x [n+1]-x [n])/2+x [n].
When wave crest point is located in secret note area BA, the present invention can be with wave crest point and the width of the interpolated point adjacent with wave crest point Spend the width as informal voucher.When trough point is located at informal voucher area SA, the present invention can be with trough point and the interpolation adjacent with trough point Width of the width of point as secret note.
As shown in figure 11, wave crest point P1-P5 is all located in secret note area BA.Therefore, the present invention can with wave crest point P1 and with Width of the width of the latter interpolated point IP1 adjacent wave crest point P1 as informal voucher S1, with wave crest point P2 and with wave crest point P2 Width of the width of adjacent the latter interpolated point IP2 as informal voucher S2, with wave crest point P3 and it is adjacent with wave crest point P3 after Width of the width of one interpolated point IP3 as informal voucher S3, with wave crest point P4 and the latter interpolation adjacent with wave crest point P4 Width of the width of point IP4 as informal voucher S4, and with the wave crest point P5's and the latter interpolated point IP5 adjacent with wave crest point P5 Width of the width as informal voucher S5, and then the informal voucher S1-S5 for corresponding to wave crest point P1-P5 is inserted into secret note area BA.It should be noted It is that the present invention also can be using the width of wave crest point and the previous interpolated point adjacent with wave crest point as the width of informal voucher, depending on reality Depending on the application of border.
As shown in figure 11, only a trough point V1 is located in informal voucher area SA.Therefore, the present invention can with trough point V1 and Width of the width of the latter interpolated point IV1 adjacent with trough point V1 as secret note B1, and then the insertion pair in informal voucher area SA Answer the secret note B1 of trough point V1.It should be noted that the present invention also can be with trough point and the previous interpolation adjacent with trough point Width of the width of point as secret note, depending on practical application.
After informal voucher S1-S5 is inserted into secret note area BA and is inserted into secret note B1 in informal voucher area SA, you can to target barcode 32 are decoded, and then are effectively lifted and be decoded into power.
When the fixed reference feature parameter that step S34 is obtained is consistent with the second predetermined characteristic parameter in table 1, step is performed S44, judges the current distance between bar code reader 10 and target barcode 32 for relatively middle distance.When judge bar code reader 10 with Current distance between target barcode 32 in relatively apart from when, step S46 is performed, according to predetermined grey decision-making PG to target scanning lines 34 gray-scale distribution carries out binaryzation, you can target barcode 32 is decoded.
When the fixed reference feature parameter that step S34 is obtained is consistent with the 3rd predetermined characteristic parameter in table 1, step is performed S48, judges the current distance between bar code reader 10 and target barcode 32 for relative proximity distance.When judge bar code reader 10 with Current distance between target barcode 32 for relative proximity apart from when, perform step S50, target image be filtered with taking downwards Sample.In this embodiment, the present invention is taken a little using 2 points or multiple spot takes the mode of any to do all pixels to contract Subtract downsampled (Down-Sampling) of pixel, to reject tediously long unnecessary pixel (for example, giving up target scanning lines 34 even number point takes a bit every 3 points), allow the subsequent arithmetic reaction time to accelerate.Then, moving average filter is recycled The mode filtering noise information point of (moving average filters).Assuming that the grey decision-making of the pixel of target scanning lines 34 is x [n], the grey decision-making of the pixel exported after filtering is y [n], then can carry out moving average filtering with following equation two.
Formula two:Y [n]=(x [n-2]+x [n-1]+x [n]+x [n+1]+x [n+2])/5.
Then, step S52 is performed, binaryzation is carried out to the gray-scale distribution of target scanning lines 34 according to predetermined grey decision-making PG, Target barcode 32 can be decoded.
In this embodiment, 1 system of table with three the first predetermined characteristic parameters, three the second predetermined characteristic parameters with three the Three predetermined characteristic parameters come illustrate the present invention technical characterstic.However, the quantity of the predetermined characteristic parameter of the present invention is not with three It is a to be limited.In addition, the fixed reference feature parameter that step S34 is obtained is joined with the first predetermined characteristic parameter in table 1, the second predetermined characteristic Number or the 3rd predetermined characteristic parameter are possible to not exclusively be consistent.When fixed reference feature parameter with it is N number of in the first predetermined characteristic parameter When being consistent, and being consistent with M in the second predetermined characteristic parameter, bar code decoding method of the invention can judge bar in the following manner Current distance between code reading machine 10 and target barcode 32 is relatively remote or relatively middle distance, and wherein N and M is all just whole Number.When N is more than M, judge that distance is relatively remote at present;When N is less than or equal to M, judge that distance is in relatively at present Distance.Similarly, when fixed reference feature parameter is consistent with N number of in the second predetermined characteristic parameter, and with the 3rd predetermined characteristic parameter M when being consistent, bar code decoding method of the invention can also be judged between bar code reader 10 and target barcode 32 with aforesaid way Current distance be relatively middle distance or relative proximity distance.
It should be noted that the control logic of bar code decoding method of the invention can be realized with Software for Design.This software can In bar code reader or other it is provided with performing in the electronic device of barcode reading function.Certainly, each portion in control logic Divide or function can all be realized by the combination of software, hardware or software and hardware.In addition, the control of the bar code decoding method of the present invention Data that logic can be stored in computer-readable storage medium and embody, wherein stored by computer-readable storage medium The data system of representative instruction can be performed by electronic device to produce control command, and then perform corresponding function.
In conclusion bar code decoding method provided by the invention, when the present invention is judged between bar code reader and target barcode Current distance for it is relatively remote when, the present invention is that the gray-scale distribution of target scanning lines first is divided into secret note area and informal voucher Area, corresponding informal voucher and/or the trough in grayscale section are inserted into further according to the wave crest point in grayscale section in secret note area Point is inserted into corresponding secret note in informal voucher area, effectively to reduce the distribution of the secret note of target barcode and informal voucher.Thereby, you can in bar When current distance between code reading machine and target barcode is relatively remote, effectively lift target barcode is decoded into power.This Outside, when the present invention judge between bar code reader and target barcode at present apart from in relatively apart from when, the present invention can be according to pre- Determine grey decision-making and binaryzation is carried out to the gray-scale distribution of target scanning lines, to be decoded to target barcode.Furthermore when the present invention sentences Disconnected current distance between bar code reader and target barcode for relative proximity apart from when, the present invention first can be filtered target image With downsampled, binaryzation is carried out to the gray-scale distribution of target scanning lines further according to predetermined grey decision-making, to be carried out to target barcode Decoding.
The present invention is described by above-mentioned related embodiment, but above-described embodiment is only the example for implementing the present invention. It must be noted that the embodiment disclosed is not limiting as the scope of the present invention.On the contrary, do not depart from the present invention spirit and In the range of made change and retouch, belong to the present invention scope of patent protection.

Claims (10)

1. a kind of bar code decoding method, it is characterised in that comprise the steps of:
The target image of target barcode is captured with bar code reader;
In sets target scan line on the target image;
The relativeness between at least two characteristic points in the gray-scale distribution of the target scanning lines is analyzed according to coding rule, with To at least one fixed reference feature parameter;
When at least one fixed reference feature parameter is consistent completely with least one first predetermined characteristic parameter, the bar code reading is determined It is relatively remote to take the current distance between machine and the target barcode;
When the definite current distance is relatively remote for this, the gray-scale distribution of the target scanning lines is divided with predetermined grey decision-making For at least one secret note area and at least one informal voucher area;
According to the predetermined grey decision-making setting grayscale section, and found out from the gray-scale distribution of the target scanning lines positioned at the grayscale section In at least one wave crest point and at least one trough point;
When wave crest point is located at least one secret note area, the one of the corresponding wave crest point is inserted at least one secret note area Informal voucher;And
When trough point is located at least one informal voucher area, the one of the corresponding trough point is inserted at least one informal voucher area Secret note.
2. bar code decoding method as claimed in claim 1, it is characterised in that additionally comprise the following steps:
Increase by an interpolated point between every two neighbor pixel for the gray-scale distribution of the target scanning lines;
When the wave crest point is located at least one secret note area, with the wave crest point and the interpolated point adjacent with the wave crest point Width of the width as the informal voucher;And
When the trough point is located at least one informal voucher area, with the trough point and the interpolated point adjacent with the trough point Width of the width as the secret note.
3. bar code decoding method as claimed in claim 1, it is characterised in that additionally comprise the following steps:
The predetermined grey decision-making is used as using the average gray-scale value of the gray-scale distribution of the target scanning lines.
4. bar code decoding method as claimed in claim 1, it is characterised in that additionally comprise the following steps:
When at least one fixed reference feature parameter is consistent completely with least one second predetermined characteristic parameter, the bar code reading is determined It is relatively middle distance to take the current distance between machine and the target barcode;And
When the definite current distance for this relatively in apart from when, the gray-scale distribution according to the predetermined grey decision-making to the target scanning lines Carry out binaryzation.
5. bar code decoding method as claimed in claim 4, it is characterised in that additionally comprise the following steps:
When at least one fixed reference feature parameter is consistent completely with least one 3rd predetermined characteristic parameter, the bar code reading is determined It is relative proximity distance to take the current distance between machine and the target barcode;
When the definite current distance for the relative proximity apart from when, which is filtered with it is downsampled;And
Binaryzation is carried out to the gray-scale distribution of the target scanning lines according to the predetermined grey decision-making.
6. bar code decoding method as claimed in claim 5, it is characterised in that additionally comprise the following steps:
Multiple sample images of a sample bar code, the pre- spacing of each of which are captured under multiple preset distances with the bar code reader From one of being belonging respectively to a distance from this is relatively remote, this is relatively middle with relative proximity distance;
In setting a sample scan line on each sample image;And
The opposite pass between at least two characteristic points in the gray-scale distribution of each scan sample line is analyzed according to the coding rule System, with obtain corresponding to this relatively at a distance at least one first predetermined characteristic parameter, the corresponding relatively middle distance this extremely Lack at least one 3rd predetermined characteristic parameter of a second predetermined characteristic parameter with the corresponding relative proximity distance.
7. the bar code decoding method as described in claim 1 or 6, it is characterised in that the opposite pass between at least two characteristic point It is for pixel distance, grayscale difference value or its combination.
8. the bar code decoding method as described in claim 1 or 6, it is characterised in that at least two characteristic point is two adjacent waves Peak dot and trough point, two adjacent wave peak dots, two adjacent wave valley points or its combine.
9. bar code decoding method as claimed in claim 4, it is characterised in that when at least one fixed reference feature parameter and this extremely N number of in a few first predetermined characteristic parameter is consistent, and is consistent with M at least one second predetermined characteristic parameter When, which additionally comprises the following steps:
When N is more than M, determine that the current distance is relatively remote for this;And
When N is less than or equal to M, it is the relatively middle distance to determine the current distance;
Wherein, N and M is all positive integer.
10. bar code decoding method as claimed in claim 5, it is characterised in that when at least one fixed reference feature parameter is with being somebody's turn to do N number of at least one second predetermined characteristic parameter is consistent, and is consistent with M at least one 3rd predetermined characteristic parameter When, which additionally comprises the following steps:
When N is more than M, it is the relatively middle distance to determine the current distance;And
When N is less than or equal to M, it is the relative proximity distance to determine the current distance;
Wherein, N and M is all positive integer.
CN201610183387.8A 2016-03-28 2016-03-28 Bar code decoding method Active CN105868667B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610183387.8A CN105868667B (en) 2016-03-28 2016-03-28 Bar code decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610183387.8A CN105868667B (en) 2016-03-28 2016-03-28 Bar code decoding method

Publications (2)

Publication Number Publication Date
CN105868667A CN105868667A (en) 2016-08-17
CN105868667B true CN105868667B (en) 2018-04-17

Family

ID=56625048

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610183387.8A Active CN105868667B (en) 2016-03-28 2016-03-28 Bar code decoding method

Country Status (1)

Country Link
CN (1) CN105868667B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120339040A (en) * 2025-06-19 2025-07-18 杭州汇萃智能科技有限公司 Barcode recognition method, system and medium based on segmented peak and adaptive threshold adjustment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103065176A (en) * 2012-12-10 2013-04-24 苏州佳世达电通有限公司 Method for generating image by one-dimensional bar code and system
CN103870948A (en) * 2014-03-20 2014-06-18 苏州佳世达电通有限公司 Intelligent goods shelf, intelligent warehousing system and intelligent warehousing system control method
CN104200189A (en) * 2014-08-27 2014-12-10 苏州佳世达电通有限公司 Barcode scanning device and processing method thereof
CN105095816A (en) * 2015-06-30 2015-11-25 苏州佳世达电通有限公司 Scanning device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103065176A (en) * 2012-12-10 2013-04-24 苏州佳世达电通有限公司 Method for generating image by one-dimensional bar code and system
CN103870948A (en) * 2014-03-20 2014-06-18 苏州佳世达电通有限公司 Intelligent goods shelf, intelligent warehousing system and intelligent warehousing system control method
CN104200189A (en) * 2014-08-27 2014-12-10 苏州佳世达电通有限公司 Barcode scanning device and processing method thereof
CN105095816A (en) * 2015-06-30 2015-11-25 苏州佳世达电通有限公司 Scanning device

Also Published As

Publication number Publication date
CN105868667A (en) 2016-08-17

Similar Documents

Publication Publication Date Title
JP4180497B2 (en) Code type discrimination method and code boundary detection method
KR20070081410A (en) 2D code detection system and 2D code detection program
US8120665B2 (en) Image processing method and apparatus, digital camera, and recording medium recording image processing program
EP0825547B1 (en) Two-dimensional code reader
AU2006227490B2 (en) Apparatus and process for two-stage decoding of high-density optical symbols
EP1591944A1 (en) 2D rectangular code symbol scanning device and 2D rectangular code symbol scanning method
US7949187B2 (en) Character string recognition method and device
US20050194445A1 (en) Method and apparatus for recognizing code
CN101248454A (en) Image processing method and image processor, digital camera equipment, and recording medium with image processing program stored thereon
US7350710B2 (en) Two-dimensional code extracting method
KR20120132314A (en) Image processing apparatus, image processing method, and computer readable medium
US20010036317A1 (en) Apparatus and method for detecting a pattern
US8467608B2 (en) Method and apparatus for character string recognition
KR20120130684A (en) Image processing apparatus, image processing method, and computer readable medium
CN111767752B (en) Two-dimensional code identification method and device
US20060210164A1 (en) Image processing device
US9076225B2 (en) Image processing device, an image processing method and a program to be used to implement the image processing
CN105868667B (en) Bar code decoding method
CN116152834A (en) Multi-code decoding method and system based on gradient algorithm
CN102782705A (en) Resolution adjustment of an image that includes text undergoing an OCR process
CN114140620B (en) A method for detecting straight line contour of an object
TWI595426B (en) Barcode decoding method
WO2004095357A1 (en) A synchronous two-dimensional barcode system with all-around informaton, and reading method thereof
JP2008102952A (en) Code boundary detection method
JP2005184787A (en) Image processing method and image processing apparatus

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