Movatterモバイル変換


[0]ホーム

URL:


CN107016318A - A kind of bar code decoding method and device - Google Patents

A kind of bar code decoding method and device
Download PDF

Info

Publication number
CN107016318A
CN107016318ACN201710170774.2ACN201710170774ACN107016318ACN 107016318 ACN107016318 ACN 107016318ACN 201710170774 ACN201710170774 ACN 201710170774ACN 107016318 ACN107016318 ACN 107016318A
Authority
CN
China
Prior art keywords
character
width
bar
ratio
decoded
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
CN201710170774.2A
Other languages
Chinese (zh)
Other versions
CN107016318B (en
Inventor
马诗洁
谢世斌
周璐
张兴明
李铭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Huaray Technology Co Ltd
Original Assignee
Zhejiang Huaray Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Huaray Technology Co LtdfiledCriticalZhejiang Huaray Technology Co Ltd
Priority to CN201710170774.2ApriorityCriticalpatent/CN107016318B/en
Publication of CN107016318ApublicationCriticalpatent/CN107016318A/en
Application grantedgrantedCritical
Publication of CN107016318BpublicationCriticalpatent/CN107016318B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention discloses a kind of bar code decoding method and device, to solve prior art bar code in ink overflow or overexposure, when the empty width of bar changes, the problem of decoding is inaccurate is likely to result in.This method includes:The first ratio of the empty width of bar of each mark character in bar code to be decoded is determined, mark character includes bebinning character and/or final character;Second ratio of the empty width of bar in the standard form of each mark character of the type of identification bar code to be decoded;The scaling determined according to the first ratio and the second ratio is adjusted to the bar width or empty width in each decoding character, and each decoding character after adjustment is decoded.Due in embodiments of the present invention, the empty width of bar is adjusted according to scaling, the empty width of bar after adjustment is more nearly the empty width of bar of standard, the empty change width of the bar of bar code caused by decrease bar code ink overflow or the situation of overexposure, decoding character after adjustment is decoded, decoding accuracy can be effectively improved.

Description

A kind of bar code decoding method and device
Technical field
The present invention relates to barcode technology field, more particularly to a kind of bar code decoding method and device.
Background technology
Barcode technology be grow up on computer technology and Information Technology Foundation a collection coding, printing, identification,The emerging technology of data acquisition and processing (DAP).Barcode technology is because its identification is quick, accurate, reliable and cost is low excellentPoint, is widely used in the fields such as business, taking care of books, storage, post and telecommunications, traffic and Industry Control, and certainly will be gradually emergingPlay great in " Internet of Things " application served.
In the bar code detection scheme of view-based access control model system, Bar code positioning and bar code decoding are broadly divided into.In bar code decoding mistakeHow Cheng Zhong, improve the accuracy of decoding, is always an important research topic.
Existing bar code decoding scheme mainly includes:1st, the template matching algorithm based on bar width:It is aerial by record stripThe number of contained pixel determines the empty width of bar, and the template of the width of determination and normal width match and determined pairThe code value answered.2nd, average distance method:The overall width of the bar code is drawn after the original position for orienting bar code, according to the total mould of bar codePlate length and overall width, obtain the pixel count of unit template, and then measure each empty width in bar code, by determinationWidth carries out matching with the template of normal width and determines corresponding code value.3rd, similar back gauge method:It is empty by calculating adjacent stripWidth sum, is matched to decode with the empty width sum of the adjacent strip of standard character template, if but result of calculation it is similar orWhen barcode encoding logic is not rigorous, then decoding may mistake.4th, by template matching algorithm of the method 1 based on bar width and sideThe similar back gauge method of method 3 is combined, and is decoded using similar back gauge method, the result phase drawn for similar back gauge methodLike or the not rigorous situation of barcode encoding logic, using bar width template matching algorithm carry out error compensation, solvedCode.
When being decoded using each above-mentioned method to bar code, the empty width of bar in the accuracy and bar code of decoding has directlyRelation, but because the other problemses such as printing, the empty width of bar may be inaccurate, such as in the case of ink overflow or overexposure, bar is emptyWidth will change, and it is possible that adjacent strip sky width sum is identical.Therefore existing bar code decoding side is usedMethod, it would be possible to cause the inaccurate of decoding.
The content of the invention
The present invention provides a kind of bar code decoding method and device, to solve in the prior art bar code in ink overflow or overexposure feelingsUnder condition, when the empty width of bar changes, the problem of decoding is inaccurate is likely to result in.
To reach above-mentioned purpose, the embodiment of the invention discloses a kind of bar code decoding method, methods described includes:
The first ratio of the bar width of each mark character and empty width in bar code to be decoded is determined, wherein, the markCharacter learning symbol includes bebinning character and/or final character;
According to the type of the bar code to be decoded, the standard form of each mark character of the bar code of the type is recognizedIn bar width and empty width the second ratio;
According to first ratio and second ratio, the pantograph ratio of each decoding character in bar code to be decoded is determinedExample;
The bar width or empty width in each decoding character are adjusted according to the scaling, to bar widthOr empty width be adjusted after each decoding character decoded.
Further, it is described according to first ratio when the mark character includes bebinning character and final characterWith second ratio, determining the scaling of each decoding character in bar code to be decoded includes:
According to the first ratio of bebinning character and second ratio, each decoding character in bar code to be decoded is determinedFirst sub- scaling;
According to the first ratio of final character and second ratio, each decoding character in bar code to be decoded is determinedSecond sub- scaling;
According to the described first sub- scaling and the second sub- scaling, determine each to decode in bar code to be decodedThe scaling of character.
Further, first ratio for determining the bar width of each mark character and empty width in bar code to be decodedIncluding:
According to the pixel being located in bar code to be decoded at least two horizontal scanning lines, recognize on every horizontal scanning lineThe bar width of each mark character and the first sub- ratio of empty width, according to the first sub- ratio on every horizontal scanning line withAnd the bar number of horizontal scanning line, determine the first ratio of the bar width of each mark character and empty width in the bar code to be decodedValue.
Further, it is described that the bar width or empty width in each decoding character are carried out according to the scalingAdjustment, each decoding character after being adjusted to bar width or empty width, which carries out decoding, to be included:
The empty width or bar width of each decoding character of identification, according to the scaling to empty width or the bar widthIt is adjusted;
Bar width and the unadjusted empty width after adjustment in each decoding character or the empty width after adjustment withUnadjusted bar width, it is determined that each decoding character after the corresponding each adjustment of decoding character, to the decoding after each adjustmentCharacter is decoded.
Further, it is determined that the type of the bar code to be decoded includes:
Recognize the empty width of the bar of bebinning character and/or final character of the bar code to be decoded;
It is empty wide according to the standard bar of the corresponding bebinning character of each type of bar code and/or final character pre-savedDegree, and the empty width of the bar recognized, determine the type of the bar code to be decoded.
The embodiment of the invention discloses a kind of bar code decoding device, described device includes:
Determining module, the first ratio for determining the bar width of each mark character and empty width in bar code to be decodedValue, wherein, the mark character includes bebinning character and/or final character;
Identification module, for the type according to the bar code to be decoded, recognizes each mark of the bar code of the typeSecond ratio of bar width and empty width in the standard form of character;
The determining module, is additionally operable to, according to first ratio and second ratio, determine in bar code to be decodedThe scaling of each decoding character;
Decoder module is adjusted, for each decoding in the bar code to be decoded according to the scaling and the typeThe width of character is adjusted to the bar width and empty width in each decoding character, to each decoding character after adjustmentDecoded.
Further, the determining module, specifically for the first ratio according to bebinning character and second ratio, reallyFirst sub- scaling of each decoding character in fixed bar code to be decoded;According to the first ratio of final character and described secondRatio, determines the second sub- scaling of each decoding character in bar code to be decoded;According to the described first sub- scaling andThe second sub- scaling, determines the scaling of each decoding character in bar code to be decoded.
Further, the determining module, specifically for according to being located at least two horizontal scanning lines in bar code to be decodedOn pixel, the bar width and the first sub- ratio of empty width of each mark character on every horizontal scanning line of identification;According toThe bar number of the first sub- ratio and horizontal scanning line on every horizontal scanning line, determines each to mark in the bar code to be decodedFirst ratio of the bar width of character learning symbol and empty width.
Further, the adjustment decoder module, specifically for the empty width or bar width of each decoding character of identification, rootEmpty width or the bar width is adjusted according to the scaling;The bar width after adjustment in each decoding characterWith empty width and the unadjusted bar width after unadjusted empty width or adjustment, each adjusted it is determined that each decoding character is correspondingDecoding character after whole, is decoded to the decoding character after each adjustment.
Further, the determining module, is additionally operable to recognize the bebinning character of the bar code to be decoded and/or terminates wordThe empty width of the bar of symbol;According to the corresponding bebinning character of each type of bar code and/or the standard bar of final character pre-savedEmpty width, and the empty width of the bar recognized, determine the type of the bar code to be decoded.
The embodiment of the invention discloses a kind of bar code decoding method and device, methods described includes:Determine bar to be decodedFirst ratio of the bar width of each mark character and empty width in code, wherein, the mark character include bebinning character and/orFinal character;According to the type of the bar code to be decoded, the master die of each mark character of the bar code of the type is recognizedSecond ratio of bar width and empty width in plate;According to first ratio and second ratio, bar to be decoded is determinedThe scaling of each decoding character in code;According to the scaling to the bar width or empty wide in each decoding characterDegree is adjusted, and each decoding character after being adjusted to bar width or empty width is decoded.Due in present invention implementationIn example, the first ratio of the bar width of bebinning character and/or final character in bar code to be decoded and empty width is determined, and according toThe second ratio and first ratio of the empty width of bar in the standard form of bebinning character and/or final character determine each solutionThe scaling of code character, is adjusted according to the scaling to the bar width or empty width in each decoding characterIt is whole, so that the bar width or empty width after adjustment are more nearly the corresponding bar width or empty width of standard, weaken bar code and overflowThe empty change width of bar caused by the situation of ink or overexposure in bar code, and then can to the decoding character progress decoding after adjustmentIt is effective to improve decoding accuracy.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existingThere is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are only thisSome embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be withOther accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of bar code decoding process schematic that the embodiment of the present invention 1 is provided;
Fig. 2 is a kind of bar code decoding process schematic provided in an embodiment of the present invention;
Fig. 3 A are a kind of bar code for occurring ink overflow situation provided in an embodiment of the present invention;
Fig. 3 B are a kind of bar code for occurring ink overflow situation provided in an embodiment of the present invention;
Fig. 4 is a kind of decoding apparatus structure chart that the embodiment of the present invention 1 is provided.
Embodiment
In order that bar code is in the case of ink overflow or overexposure, the accuracy of bar code decoding is improved, the embodiments of the invention provideA kind of bar code decoding method and device.
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, completeSite preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based onEmbodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not madeEmbodiment, belongs to the scope of protection of the invention.
Fig. 1 is a kind of bar code decoding process schematic that the embodiment of the present invention 1 is provided, and the process comprises the following steps:
S101:The first ratio of the bar width of each mark character and empty width in bar code to be decoded is determined, wherein, instituteStating mark character includes bebinning character and/or final character.
Bar code decoding method provided in an embodiment of the present invention can apply to electronic equipment, and the electronic equipment can be hand-heldIt is the bar code readers such as formula barcode reader, fixed barcode reader or mobile phone with bar code decoding function, flatThe terminal devices such as plate computer.The electronic equipment can recognize the position of each mark character in the bar code to be decoded,And the bar width in mark character and empty width can be identified.Electronic equipment at the position of each mark character of identification,The position of the mark character can be determined according to the identification information of each mark character, the identification information can be the markBar width and empty width in character learning symbol.Electronic equipment, can be according to the gray scale of pixel when recognizing bar width and empty widthThe coordinate of value and pixel is recognized.The process of the position of mark character in the identification bar code to be decoded belongs toPrior art, in embodiments of the present invention to the process without being described in detail.Bar in each mark character of identification is wideThe process of degree and empty width belongs to prior art, in embodiments of the present invention to the process without being described in detail.
The bar width and the empty width can be in the mark character the overall width of all and have timeThe empty width on bar width and predeterminated position on overall width or predeterminated position.When identify mark character in barAfter width and empty width, it is possible to determine the first ratio of the bar width and empty width.Bar on the predeterminated position is wideEmpty width on degree and predeterminated position, for example, can be that the mark character includes two bars and two skies, the default positionIt can be first bar and first sky to put, it is determined that the bar width and the first of empty width that identifier word is accorded with bar code to be decodedDuring ratio, then the width and the first ratio of first empty width of first bar in the mark character can be determinedValue, the mark character can also be bebinning character, can be final character or bebinning character and final character.
S102:According to the type of the bar code to be decoded, the mark of each mark character of the bar code of the type is recognizedSecond ratio of bar width and empty width in quasi-mode plate.
Electronic equipment is when bar code to be decoded is arrived in scanning, it may be determined that go out the type of the bar code to be decoded, every kind ofEach mark character of the bar code of type has bar width and empty width in its corresponding standard form, the standard form to be to determine's.Bar width and empty width in the standard form of determination, it is determined that each bar in the standard form of mark characterSecond ratio of width and empty width.The bar width and the empty width can be identified described in standard form in characterThe sky on bar width and predeterminated position on the overall width of all and the overall width or predeterminated position had time is wideDegree.The mark character can be bebinning character, can be final character or bebinning character and final character.
It is determined that when the first ratio and the second ratio, what the mark character that bar code to be decoded is used was used with standard formIt is identical to identify character, i.e., when the mark character that bar code to be decoded is used is bebinning character, and the standard form is usedMark character also be bebinning character, when the mark character that bar code to be decoded is used is final character, the standard formThe mark character used is also for final character.
The determination method of first ratio and second ratio is identical, and it is the overall width of all that can beWith the ratio of had time overall width or be the empty width on bar width and predeterminated position on predeterminated position ratioValue.
When the mark character is the bebinning character and final character, the first ratio of each mark character is being determinedValue and during the second ratio, judges the of the first ratio of bebinning character in bar code to be decoded and the bebinning character of standard formFirst ratio of the final character in the first difference of two ratios, and bar code to be decoded and the final character of standard formSecond difference of the second ratio, corresponding first ratio of mark character and the second ratio for taking difference minimum.
S103:According to first ratio and second ratio, each decoding character in bar code to be decoded is determinedScaling.
After the first ratio and the second ratio is determined, can according to first ratio and second ratio, it is determined thatThe scaling of each decoding character in bar code to be decoded, can be specifically using the business of the first ratio and the second ratio as3rd ratio or the business using the second ratio and the first ratio are as the 3rd ratio, and the 3rd ratio is to wait to solveThe scaling of each decoding character in the bar code of code.When the 3rd ratio is the business of the first ratio and the second ratio, such asReally described 3rd ratio is more than 1, then illustrates that the bar width in the bar code to be decoded becomes big, empty width diminishes, then described to treatThe bar code of decoding occurs in that ink overflow situation;If the 3rd ratio is less than 1, illustrate that the bar in the bar code to be decoded is wideDegree diminishes, and empty width becomes big, then the bar code occurs in that overexposure situation;If the 3rd ratio is equal to 1, illustrate described treatThe bar code of decoding is normal, ink overflow or the situation of overexposure does not occur.It is possible thereby to which class is released, when the 3rd ratio is secondDuring the business of ratio and the first ratio, the situation of change of bar width and empty width in the bar code to be decoded, it is believed that this areaTechnical staff can be according to embodiments of the present invention description, it is determined that corresponding embodiment, herein without being described in detail.
S104:The bar width or empty width in each decoding character are adjusted according to the scaling, it is rightEach decoding character after bar width or empty width are adjusted is decoded.
After the scaling is determined, it is possible to know the bar code to be decoded occur in that ink overflow situation orThe situation of overexposure is occurred in that, so that it is determined that the bar width and empty width that go out in the bar code to be decoded to decode character are to carry outAmplification adjustment or progress diminution adjustment, to make the bar width after adjustment or empty width be more nearly the corresponding bar of standard formWidth or empty width.So after the scaling is determined, can be according to the scaling to each decoded wordBar width or empty width in symbol are adjusted, and can be specifically, the empty width or bar width of each decoding character of identification, rootEmpty width or the bar width is adjusted according to the scaling.
Empty width or the bar width, which is adjusted, according to scaling can include a variety of methods, for example, when describedScaling is the business of the first ratio and the second ratio, when corresponding 3rd ratio of scaling is more than 1, is then illustrated to be decodedBar width in bar code becomes big, and empty width diminishes, then the bar code to be decoded occurs in that ink overflow situation, now can will described inArticle width divided by the 3rd ratio, so as to be reduced to the bar width in the bar code to be decoded, by the empty widthThe 3rd ratio is multiplied by be amplified the empty width in the bar code to be decoded.
After the bar width or empty width in each decoding character are adjusted, it is possible to each after adjustmentDecoding character decode.In decoding, template width matching process, or similar back gauge measuring method can be used,Or both combine, or other coding/decoding method.The process that each decoding character after described pair of adjustment is decodedBelong to prior art, in embodiments of the present invention to the process without repeating.
Due in embodiments of the present invention, determining the bar width of bebinning character and/or final character in bar code to be decodedWith the first ratio of empty width, and according to the second ratio of the empty width of bar in the standard form of bebinning character and/or final characterValue and first ratio determine the scaling of each decoding character, according to the scaling to each decoding characterIn bar width or empty width be adjusted so that the bar width or empty width after adjustment are more nearly the corresponding bar of standardThe empty change width of bar caused by the situation of width or empty width, decrease bar code ink overflow or overexposure in bar code, and then to adjustmentDecoding character afterwards, which carries out decoding, can effectively improve decoding accuracy.
Embodiment 2:
For the accuracy of the scaling that further improves determination, so as to further reach raising decoding accuracyEffect, on the basis of above-described embodiment, the present invention implement in, when it is described mark character include bebinning character and terminate wordFu Shi, it is described according to first ratio and second ratio, determine the scaling of each decoding character in bar code to be decodedRatio includes:
According to the first ratio of bebinning character and second ratio, each decoding character in bar code to be decoded is determinedFirst sub- scaling;
According to the first ratio of final character and second ratio, each decoding character in bar code to be decoded is determinedSecond sub- scaling;
According to the described first sub- scaling and the second sub- scaling, determine each to decode in bar code to be decodedThe scaling of character.
In embodiments of the present invention, when the mark character is bebinning character or final character, first ratio isBebinning character in the ratio of the bar width of each mark character and empty width, i.e., bar code to be decoded in the bar code to be decodedThere is final character in its corresponding first ratio, bar code to be decoded to have its corresponding first ratio.
First ratio of final character can in first ratio of bebinning character and bar code to be decoded in bar code to be decodedWith identical or difference.
Second ratio is the bar width and the ratio of empty width, i.e. banner word in the standard form of each mark characterThe standard form of symbol has its corresponding second ratio, and the standard form of final character has its corresponding second ratio.
When the mark character is bebinning character and final character, it is determined that each decoding character in bar code to be decodedCan be specifically first, according to the first ratio and second ratio of bebinning character, to determine bar to be decoded during scalingFirst sub- scaling of each decoding character in code, and the first ratio and second ratio according to final character, reallySecond sub- scaling of each decoding character in fixed bar code to be decoded, further according to the described first sub- scaling and described theTwo sub- scalings, determine the scaling of each decoding character in bar code to be decoded.Can be specifically that the first son contractsThe average value for putting ratio and the second sub- scaling is defined as the scaling, this determination scaling of averagingMethod, the scaling of determination can be made more accurate.
It is determined that can be according on any one horizontal scanning line when first sub- scaling and the second sub- scalingBar width and sky in the bar width of bebinning character to be decoded and empty first ratio of width and the standard form of bebinning characterSecond ratio of width determines a sub- scaling, wide according to the bar of the final character to be decoded on any one horizontal scanning lineSecond ratio of bar width and empty width in degree and empty first ratio of width and the standard form of final character determines secondSub- scaling.For the accuracy of the scaling that further improves determination, raising decoding accuracy is further reachedEffect, it is in embodiments of the present invention, described to determine the bar width of each mark character and empty width in bar code to be decodedFirst ratio includes:
According to the pixel being located in bar code to be decoded at least two horizontal scanning lines, recognize on every horizontal scanning lineThe bar width of each mark character and the first sub- ratio of empty width;
According to the bar number of the first sub- ratio and horizontal scanning line on every horizontal scanning line, determine described to be decodedFirst ratio of the bar width of each mark character and empty width in bar code.
In embodiments of the present invention, at least two horizontal scanning lines can be located at the optional position of bar code to be decodedOn, in order to further improve the accuracy of decoding, direction that can be by bar code to be decoded along bar code, according to default decileNumber, is divided into some equal portions, every cut-off rule constitutes a horizontal scanning line using cut-off rule by the bar code to be decoded.InstituteIt can carry out 3 deciles to state default decile number, then corresponding horizontal scanning line is 2 or carries out 2 deciles, then rightThe horizontal scanning line answered is 1.Decile number is more, and corresponding horizontal scanning line is more, and every horizontal scanning line is parallel.
When horizontal scanning line is at least two, according to the pixel being located in bar code to be decoded at least two horizontal scanning linesPoint, identifies the bar width and empty width in each mark character on every horizontal scanning line, and determine on the horizontal scanning lineEach mark character in bar width and empty width the first sub- ratio, compared according to the first son on every horizontal scanning lineThe bar number of value and horizontal scanning line, determine each mark character in the bar code to be decoded article width and empty width theOne ratio.Can be specifically that the first sub- ratio that correspondence on every horizontal scanning line is identified into character is added, then divided by instituteState the bar number of horizontal scanning line, will the mark character all first sub- ratios average value as the mark character first ratioValue.
For example, horizontal scanning line is 3, the sub- ratio of bebinning character first on this 3 horizontal scanning lines is respectively 1.0,1.2,1.1, the ratio of bebinning character first is (1.0+1.1+1.2)/3=1.1.
When scanning line number is more, the process for determining the first sub- ratio can also be arranged each first sub- ratioSequence, takes the on centrally located first sub- ratio as the first ratio.For example, horizontal scanning line is 5, this 5 horizontal scanning linesFirst sub- ratio of upper final character is respectively 1.0,1.2,1.1,1.0,1.3, and the first all sub- ratio is entered from small to largeRow is ordered as:1.0th, 1.0,1.1,1.2,1.3, the on centrally located first sub- ratio is taken as the first sub- ratio, then instituteThe first ratio for stating final character is 1.1.
When horizontal scanning line only has one, then the first sub- ratio of each mark character on the horizontal scanning line is regard as thisIdentify the first ratio of character.
When horizontal scanning line is at least two, when it is determined that each identifying the first ratio of character, identical can be usedMethod is determined, it would however also be possible to employ different methods is determined.
Each mark character has bebinning character in its first corresponding sub- ratio, i.e., bar code to be decoded to have its correspondenceThe first sub- ratio, final character has its corresponding first sub- ratio in bar code to be decoded.Treating on every horizontal scanning line solvesThe first of final character in bar code to be decoded in the bar code of code on the first sub- ratio and this horizontal scanning line of bebinning characterSub- ratio can be with identical or difference.
The first ratio determined above by a plurality of horizontal scanning line is more accurate.
Embodiment 3:
When the bar width and empty width in decoding character are adjusted, can be only adjustment bar width orEmpty width is only adjusted, in order that the bar width and empty width in each decoding character after adjustment are more accurate, is further reachedThe effect of the accuracy of decoding is improved, it is in embodiments of the present invention, described according to the contracting on the basis of the various embodiments described abovePut ratio to be adjusted the bar width or empty width in each decoding character, after being adjusted bar width or empty widthEach decoding character carry out decoding include:
The empty width or bar width of each decoding character of identification, according to the scaling to empty width or the bar widthIt is adjusted;
Bar width and the unadjusted empty width after adjustment in each decoding character or the empty width after adjustment withUnadjusted bar width, it is determined that each decoding character after the corresponding each adjustment of decoding character, to the decoding after each adjustmentCharacter is decoded.
In embodiments of the present invention, wide to the bar width or sky in each decoding character according to the scalingCan be the bar width or empty width of each decoding character of identification, according to the scaling to described every when degree is adjustedBar width or empty width in individual decoding character are adjusted, and according to the bar width after each adjustment decoded in character and notEmpty width and unadjusted bar width after the empty width of adjustment or adjustment, it is determined that each after the corresponding each adjustment of decoding characterDecoding character.
, specifically can be with it is determined that during decoding character after the corresponding adjustment of decoding character for each decoding character, if adjusted to the bar width in the decoding character, empty width not to be adjusted, then can be by the bar after adjustmentThe decoding character that width is constituted with unadjusted empty width decodes character after being defined as the adjustment of the decoding character.If to the solutionEmpty width in code character is adjusted, and bar width is not adjusted, then can be by the empty width after adjustment with not adjustingBar width constitute decoding character be defined as the adjustment of the decoding character after decode character.
After the bar width in decoding character or empty width are adjusted, it is possible to which the decoding character after adjustment is enteredRow is decoded.In decoding, template width matching process, or similar back gauge measuring method, or both knot can be usedClose, or other coding/decoding methods.The process that decoding character after described pair of adjustment is decoded belongs to prior art,To the process without repeating in the embodiment of the present invention.
Include when being adjusted according to the scaling to the bar width or empty width in each decoding character manyThe method of kind, for example, as the business that the scaling is the second ratio and the first ratio, corresponding 3rd ratio of scaling is more thanWhen 1, then illustrate that the bar width in bar code to be decoded diminishes, empty width becomes big, then the bar code to be decoded occurs in that overexposureSituation, now can multiply the 3rd ratio by described article of width, so as to be carried out to the bar width in the bar code to be decodedAmplify or by the empty width divided by the 3rd ratio, so as to enter to the empty width in the bar code to be decodedRow reduces.
For each decoding character in the bar code in be decoded, the mode of adjustment is consistent, for example, can be equal rootBar width is adjusted according to the scaling or empty width is adjusted all in accordance with the scaling.
Embodiment 4:
On the basis of the various embodiments described above, in embodiments of the present invention, the type bag of the bar code to be decoded is determinedInclude:
Recognize the empty width of the bar of bebinning character and/or final character of the bar code to be decoded;
It is empty wide according to the standard bar of the corresponding bebinning character of each type of bar code and/or final character pre-savedDegree, and the empty width of the bar recognized, determine the type of the bar code to be decoded.
In embodiments of the present invention, it is determined that the bar code to be decoded type when, can be according to bar to be decodedWhat the bebinning character of code was determined, the standard bar that the corresponding bebinning character of each type of bar code is preserved in electronic equipment is empty wideDegree, can be by the bar of identification when the empty width of the bar that electronic equipment recognizes the bebinning character of the bar code to be decodedThe empty width of the standard bar of empty width bebinning character corresponding with each type of bar code pre-saved is matched, by matching degreeCorresponding type when high, is defined as the type of the bar code to be decoded.
It is determined that the bar code to be decoded type when, can be according to the final character of bar code to be decoded determine, the empty width of standard bar of the corresponding final character of each type of bar code is preserved in electronic equipment, when electronic equipment identificationTo the final character of the bar code to be decoded bar empty width when, by the empty width of the bar of identification and can pre-saveThe empty width of standard bar of the corresponding final character of each type of bar code is matched, by matching degree it is high when corresponding type, reallyIt is set to the type of the bar code to be decoded.
It is determined that the bar code to be decoded type when, can be the final character according to bar code to be decoded and startingWhat character was determined, the standard bar that the corresponding bebinning character of each type of bar code and final character are preserved in electronic equipment is empty wideDegree, when electronic equipment recognize the bar code to be decoded bebinning character and final character bar empty width when, will can knowThe standard bar sky of the empty width of other bar bebinning character corresponding with each type of bar code pre-saved and final characterWidth is matched, by matching degree it is high when corresponding type, be defined as the type of the bar code to be decoded.
Wherein electronic equipment is in the empty width of bar for recognizing the bebinning character of the bar code to be decoded and/or final characterProcess belongs to prior art, in embodiments of the present invention without repeating.
Fig. 2 is a kind of bar code decoding process schematic provided in an embodiment of the present invention, and the process comprises the following steps:
S201:According to the pixel being located in bar code to be decoded at least two horizontal scanning lines, every row scanning is recognizedFirst sub- ratio of the bar width of each mark character on line and empty width;According to the first son on every horizontal scanning lineThe bar number of ratio and horizontal scanning line, determine in the bar code to be decoded each mark character article width and empty width theCharacter is identified described in one ratio includes bebinning character and/or final character.
S202:According to the type of the bar code to be decoded, the mark of each mark character of the bar code of the type is recognizedSecond ratio of bar width and empty width in quasi-mode plate.
S203:According to the first ratio of bebinning character and second ratio, determine each to decode in bar code to be decodedFirst sub- scaling of character;According to the first ratio of final character and second ratio, determine in bar code to be decodedSecond sub- scaling of each decoding character;According to the described first sub- scaling and the second sub- scaling, it is determined thatThe scaling of each decoding character in bar code to be decoded.
S204:The empty width or bar width of each decoding character of identification, according to the scaling to the empty width orBar width is adjusted;The bar width after adjustment in each decoding character and the sky after unadjusted empty width or adjustmentWidth and unadjusted bar width, it is determined that each decoding character after the corresponding each adjustment of decoding character, after each adjustmentDecoding character decoded.
Fig. 3 A are the bar code to be decoded provided in an embodiment of the present invention for occurring ink overflow situation, and the bar code to be decoded isThe bar width of the mark character of the code128 codes to be decoded of this in code128 codes, Fig. 3 A and the first ratio of empty width, thanSecond ratio of bar width and empty width in the standard form of the mark character of the code128 codes is big, to be decoded to thisBar code for code128 codes each decoding character in bar width and sky width be adjusted when, it is necessary to according to the first ratioThe scaling determined with the second ratio, the bar width decoded in character is turned down, empty width is tuned up.Adjustment mode can be usedAny one described in the various embodiments described above.
Fig. 3 B are the bar code to be decoded provided in an embodiment of the present invention for occurring ink overflow situation, and the bar code to be decoded isThe bar width of the mark character of the code128 codes to be decoded of this in code128 codes, Fig. 3 B and the first odds ratio institute of empty widthSecond ratio of bar width and empty width in the standard form for the mark character for stating code128 codes is small, to be decoded to thisWhen bar code is adjusted for the bar width in each decoding character of code128 codes and sky width, it is necessary to according to the first ratio andThe scaling that second ratio is determined, the bar width decoded in character is tuned up, empty width is turned down.Adjustment mode can use upperState any one described in each embodiment.
Fig. 4 is a kind of decoding apparatus structure chart that the embodiment of the present invention 1 is provided, and described device includes:
Determining module 41, the first ratio for determining the bar width of each mark character and empty width in bar code to be decodedValue, wherein, the mark character includes bebinning character and/or final character;
Identification module 42, for the type according to the bar code to be decoded, recognizes each mark of the bar code of the typeSecond ratio of bar width and empty width in the standard form of character learning symbol;
The determining module 41, is additionally operable to, according to first ratio and second ratio, determine bar code to be decodedIn each decoding character scaling;
Decoder module 43 is adjusted, for wide to the bar width or sky in each decoding character according to the scalingDegree is adjusted, and each decoding character after being adjusted to bar width or empty width is decoded.
The determining module 41, specifically for the first ratio according to bebinning character and second ratio, it is determined that waiting to solveFirst sub- scaling of each decoding character in the bar code of code;According to the first ratio of final character and second ratio,Determine the second sub- scaling of each decoding character in bar code to be decoded;According to the described first sub- scaling and describedTwo sub- scalings, determine the scaling of each decoding character in bar code to be decoded.
The determining module 41, specifically for according to the pixel being located in bar code to be decoded at least two horizontal scanning linesThe bar width of each mark character on point, every horizontal scanning line of identification and the first sub- ratio of empty width;According to described everyThe bar number of the first sub- ratio and horizontal scanning line on horizontal scanning line, determines each mark character in the bar code to be decodedFirst ratio of bar width and empty width.
The adjustment decoder module 43, specifically for the empty width or bar width of each decoding character of identification, according to describedScaling is adjusted to empty width or the bar width;The bar width after adjustment in each decoding character is not with adjustingEmpty width and unadjusted bar width after whole empty width or adjustment, it is determined that each after the corresponding each adjustment of decoding characterCharacter is decoded, the decoding character after each adjustment is decoded.
The determining module 41, is additionally operable to recognize the bebinning character and/or the bar of final character of the bar code to be decodedEmpty width;According to the empty width of the standard bar of the corresponding bebinning character of each type of bar code and/or final character pre-saved,And the empty width of the bar of identification, determine the type of the bar code to be decoded.
The embodiment of the invention discloses a kind of bar code decoding method and device, methods described includes:Determine bar to be decodedFirst ratio of the bar width of each mark character and empty width in code, wherein, the mark character include bebinning character and/orFinal character;According to the type of the bar code to be decoded, the master die of each mark character of the bar code of the type is recognizedSecond ratio of bar width and empty width in plate;According to first ratio and second ratio, bar to be decoded is determinedThe scaling of each decoding character in code;According to the scaling to the bar width or empty wide in each decoding characterDegree is adjusted, and each decoding character after being adjusted to bar width or empty width is decoded.Due in present invention implementationIn example, the first ratio of the bar width of bebinning character and/or final character in bar code to be decoded and empty width is determined, and according toThe second ratio and first ratio of the empty width of bar in the standard form of bebinning character and/or final character determine each solutionThe scaling of code character, is adjusted according to the scaling to the bar width or empty width in each decoding characterIt is whole, so that the bar width or empty width after adjustment are more nearly the corresponding bar width or empty width of standard, weaken bar code and overflowThe empty change width of bar caused by the situation of ink or overexposure in bar code, and then can to the decoding character progress decoding after adjustmentIt is effective to improve decoding accuracy.
For systems/devices embodiment, because it is substantially similar to embodiment of the method, so the comparison of description is simpleSingle, the relevent part can refer to the partial explaination of embodiments of method.
It should be noted that herein, such as first and second or the like relational terms are used merely to a realityBody or an operation make a distinction with another entity or another operation, and not necessarily require or imply these entitiesOr there is any this actual relation or order between operation.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer programProduct.Therefore, the application can use the reality of complete hardware embodiment, complete Application Example or connected applications and hardware aspectApply the form of example.Moreover, the application can be used in one or more computers for wherein including computer usable program codeThe computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)The form of product.
The application is the flow with reference to method, equipment (system) and computer program product according to the embodiment of the present applicationFigure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagramJourney and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be providedThe processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produceA raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for realThe device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spyDetermine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring toMake the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram orThe function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meterSeries of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer orThe instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram oneThe step of function of being specified in individual square frame or multiple square frames.
Although having been described for the preferred embodiment of the application, those skilled in the art once know basic creationProperty concept, then can make other change and modification to these embodiments.So, appended claims are intended to be construed to include excellentSelect embodiment and fall into having altered and changing for the application scope.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the application to the applicationGod and scope.So, if these modifications and variations of the application belong to the scope of the application claim and its equivalent technologiesWithin, then the application is also intended to comprising including these changes and modification.

Claims (10)

CN201710170774.2A2017-03-212017-03-21A kind of bar code decoding method and deviceActiveCN107016318B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201710170774.2ACN107016318B (en)2017-03-212017-03-21A kind of bar code decoding method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201710170774.2ACN107016318B (en)2017-03-212017-03-21A kind of bar code decoding method and device

Publications (2)

Publication NumberPublication Date
CN107016318Atrue CN107016318A (en)2017-08-04
CN107016318B CN107016318B (en)2019-09-17

Family

ID=59439825

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201710170774.2AActiveCN107016318B (en)2017-03-212017-03-21A kind of bar code decoding method and device

Country Status (1)

CountryLink
CN (1)CN107016318B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109388999A (en)*2017-08-112019-02-26杭州海康威视数字技术股份有限公司A kind of barcode recognition method and device
CN110874538A (en)*2018-08-292020-03-10杭州海康威视数字技术股份有限公司Method and device for evaluating decoding result of bar code and electronic equipment
CN112329495A (en)*2020-11-022021-02-05杭州海康威视数字技术股份有限公司Bar code identification method, device and system
CN112733564A (en)*2020-12-292021-04-30深圳市新锐科技有限公司One-dimensional code identification method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5850080A (en)*1995-08-031998-12-15Barcode Graphics Inc.Verification of barcodes
JP2003011433A (en)*2001-07-032003-01-15Kobayashi Kirokushi Co LtdMethod for printing bar code by thermal printer
CN101882205A (en)*2010-06-012010-11-10福建新大陆电脑股份有限公司Bar code image scanning method
CN101882202A (en)*2010-06-012010-11-10福建新大陆电脑股份有限公司Sign character extracting module and method
CN106203216A (en)*2016-06-302016-12-07杭州晟元数据安全技术股份有限公司A kind of high-performance bar code decoding method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5850080A (en)*1995-08-031998-12-15Barcode Graphics Inc.Verification of barcodes
JP2003011433A (en)*2001-07-032003-01-15Kobayashi Kirokushi Co LtdMethod for printing bar code by thermal printer
CN101882205A (en)*2010-06-012010-11-10福建新大陆电脑股份有限公司Bar code image scanning method
CN101882202A (en)*2010-06-012010-11-10福建新大陆电脑股份有限公司Sign character extracting module and method
CN106203216A (en)*2016-06-302016-12-07杭州晟元数据安全技术股份有限公司A kind of high-performance bar code decoding method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109388999A (en)*2017-08-112019-02-26杭州海康威视数字技术股份有限公司A kind of barcode recognition method and device
CN109388999B (en)*2017-08-112021-09-17杭州海康威视数字技术股份有限公司Bar code identification method and device
CN110874538A (en)*2018-08-292020-03-10杭州海康威视数字技术股份有限公司Method and device for evaluating decoding result of bar code and electronic equipment
CN110874538B (en)*2018-08-292023-06-02杭州海康威视数字技术股份有限公司Method and device for evaluating decoding result of bar code and electronic equipment
CN112329495A (en)*2020-11-022021-02-05杭州海康威视数字技术股份有限公司Bar code identification method, device and system
CN112329495B (en)*2020-11-022022-08-05杭州海康威视数字技术股份有限公司Bar code identification method, device and system
CN112733564A (en)*2020-12-292021-04-30深圳市新锐科技有限公司One-dimensional code identification method and device

Also Published As

Publication numberPublication date
CN107016318B (en)2019-09-17

Similar Documents

PublicationPublication DateTitle
CN107016318A (en)A kind of bar code decoding method and device
CN102129585B (en)Method and system for transmitting information, device for displaying bar code and device for reading bar code
CN101882205B (en)Bar code image scanning method
CN107862234A (en)A kind of recognition methods of color bar code, electronic equipment and storage medium
CN106991348A (en)A kind of bar code decoding method and device
CN102117266B (en)Method and device for processing character pitch
CN101908122A (en)Bar space margin processing module, bar code identifying device and method thereof
CN114241499A (en)Table picture identification method, device and equipment and readable storage medium
CN107909068A (en)A kind of big data image curve reverse resolution method and system
CN202929325U (en)Liquid crystal display panel manufacturing device and liquid crystal display panel
CN114358023A (en)Intelligent question-answer recall method and device, computer equipment and storage medium
CN112396048B (en)Picture information extraction method and device, computer equipment and storage medium
WO2018210077A1 (en)Method and apparatus for generating identification code
CN101882202B (en)Sign character extracting module and method
CN112329495B (en)Bar code identification method, device and system
CN107016317A (en)A kind of bar code decoding method and device
CN111079749B (en)End-to-end commodity price tag character recognition method and system with gesture correction
CN103679502A (en)Application recommendation method and system thereof
CN109657546B (en)Video behavior recognition method based on neural network and terminal equipment
CN101833645A (en)Bar code decoding method based on code word combination
CN101908133B (en)Method and device for decoding bar code
CN117058694A (en)Image text structured extraction method and device
CN106991347B (en)The localization method and device of identifier word symbol in a kind of bar code
CN201927028U (en)Code word decoding device based on confidence
CN101840500A (en)Device based on confidence for code word decoding and method

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
CP01Change in the name or title of a patent holder
CP01Change in the name or title of a patent holder

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

Patentee after:Zhejiang Huarui Technology Co.,Ltd.

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

Patentee before:ZHEJIANG HUARAY TECHNOLOGY Co.,Ltd.


[8]ページ先頭

©2009-2025 Movatter.jp