CN112364876B - Efficient bar code binarization method and system - Google Patents

Efficient bar code binarization method and system Download PDF

Info

Publication number
CN112364876B
CN112364876B CN202011337507.8A CN202011337507A CN112364876B CN 112364876 B CN112364876 B CN 112364876B CN 202011337507 A CN202011337507 A CN 202011337507A CN 112364876 B CN112364876 B CN 112364876B
Authority
CN
China
Prior art keywords
binarization
sampling
bar code
unit
module
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
CN202011337507.8A
Other languages
Chinese (zh)
Other versions
CN112364876A (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.)
Beijing Unigroup Tsingteng Microsystems Co Ltd
Original Assignee
Beijing Unigroup Tsingteng Microsystems 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 Beijing Unigroup Tsingteng Microsystems Co Ltd filed Critical Beijing Unigroup Tsingteng Microsystems Co Ltd
Priority to CN202011337507.8A priority Critical patent/CN112364876B/en
Publication of CN112364876A publication Critical patent/CN112364876A/en
Application granted granted Critical
Publication of CN112364876B publication Critical patent/CN112364876B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The invention provides a high-efficiency bar code binarization method and a system. The method is used for constructing a sampling image based on a sampling grid, and the binarization of sampling points is completed through a secondary verification method. The method comprises the following steps: constructing a sampling grid, wherein the sampling grid covers the center of the minimum module of the corresponding bar code; generating a sampling graph by adopting an interpolation method according to the sampling grid position; performing binarization on the sampling graph by adopting a first binarization method; performing binarization on the sampled image using a second binarization method; judging whether each sampling point is identical based on the first and second binarization results, if so, storing the binarization result of the sampling point, and if not, marking the sampling point as a suspicious point; and re-executing binarization on the suspicious sampling points according to a third binarization method, and storing the binarization result. The invention also provides a high-efficiency bar code binarization system. The high-efficiency bar code binarization method and the high-efficiency bar code binarization system provided by the invention can rapidly solve the problem of inaccurate bar code binarization with fuzzy, low contrast and low precision, and have better robustness.

Description

Efficient bar code binarization method and system
Technical Field
The invention relates to the technical field of electronic science, in particular to a bar code binarization method and a bar code binarization system.
Background
The advent of bar code technology has greatly facilitated the rapid development of industrial society. Whether production and transportation, logistics storage, product part tracking and the like, the bar code recognition technology remarkably improves the completion efficiency of each task.
The bar code recognition technology is early, but research in the field in China starts later, and although progress is made, a certain gap is still kept compared with the foreign bar code recognition technology. In practical application, the barcode recognition environment is more complex and changeable, so that low-quality barcode images with fuzzy, low contrast, low precision and the like are more easily acquired, the low-quality images can seriously influence the barcode binarization effect, and the accuracy of the barcode binarization is a key for determining the performance of a barcode recognition algorithm.
Therefore, in view of the above problems, there is a need for an efficient and stable binarization method to improve the barcode recognition efficiency.
Disclosure of Invention
Aiming at the problem that the current fuzzy, low-contrast and low-precision bar code binarization is inaccurate, the invention provides a bar code binarization method and a bar code binarization system, which can ensure that bar code binarization is efficiently and accurately completed.
One of the present invention is realized as follows: an efficient bar code binarization method, which constructs a sampling image based on a sampling grid and completes sample point binarization by a secondary verification method, comprises the following steps:
Step1, constructing a sampling grid;
step 2, generating a sampling graph by adopting an interpolation method according to the grid positions;
Step 3, performing binarization on the sampling graph by adopting a first binarization method;
Step 4, performing binarization on the sampled image by adopting a second binarization method;
Step 5, judging whether two binarization results of each sampling point in the step 4 and the step 5 are the same or not, if the judgment result is yes, storing the binarization result of the sampling point, and if the judgment result is no, marking the sampling point as a suspicious point;
And 6, re-executing binarization on the suspicious points according to a third binarization method, and storing the binarization result.
Further, in the step 1, the sampling grid needs to cover the center point of the minimum module of the corresponding bar code.
Further, in the step 2, the interpolation method may be nearest neighbor interpolation, bilinear interpolation, weighted average, and other interpolation methods.
Further, the binarization method can map the sampled image into a pair of black-and-white binary images;
Further, in the steps 5 and 6, the first, second and third binarization methods are different from each other, and the three binarization methods may be completed based on different principles or may be completed based on different manners. The third binarization method is higher in precision than the first and second binarization methods, and the execution efficiency of the first and second binarization methods is obviously better than that of the third binarization method;
further, the two binarization methods adopt different design ideas, such as global binarization and local binarization methods;
further, the two binarization modes adopt the same principle, but the modes are different, and can be that image binarization is completed on a row-by-row basis and image binarization is completed on a column-by-column basis.
The second invention is realized in the following way: an efficient bar code binarization system, comprising: the device comprises a sampling grid construction unit, a gray value sampling unit, a first binarization unit, a second binarization unit, a binarization result comparison unit, a suspicious binarization result screening unit, a third binarization unit, a correct binarization result screening unit and a binary map storage unit.
The sampling grid construction unit is used for constructing a sampling grid according to the bar code symbol positions;
The gray value sampling unit is used for completing the gray value sampling of the bar code minimum module by any interpolation method according to the sampling grid position;
A first binarization unit that performs a first binarization process on the sampling matrix;
a second binarization unit for performing a second binarization process on the sampling matrix;
The binarization result comparison unit is used for comparing the output results of the first binarization unit and the second binarization unit, wherein the same marks are 1, and the different marks are 0;
The suspicious binarization screening unit screens out sampling points marked with 0 and marks the sampling points as suspicious binarization sampling points;
A binarization unit III, which carries out third binarization processing on the suspicious binarization sampling points;
the correct binarization screening unit screens out sampling points marked as 1 and marks the sampling points as correct binarization sampling points;
and the binary image storage unit is used for storing the correct binary sampling point sampling result and the binary result of the suspicious binary sampling point after the third binarization is performed.
Further, the sampling grid needs to cover the center position of the minimum module of the corresponding bar code;
further, the gray value sampling unit completes the gray value sampling of the bar code minimum module by any interpolation method according to the sampling grid position, and a gray sampling matrix is constructed;
the bar code binarization method and the bar code binarization system comprehensively consider the balance of time and performance, and the adopted first and second binarization methods have high execution efficiency and ensure that most sampling points have correct binarization results. And (3) screening out suspicious binarized sampling points through comparison of two kinds of binary results, and further finishing binarization processing on the suspicious sampling points by adopting a third binarization method with high accuracy, thereby finishing binarization of the whole sampling matrix. The invention improves the system operation efficiency on the premise of ensuring the binarization accuracy, and solves the problem that the accuracy and the efficiency cannot be considered to a certain extent.
[ Description of the drawings ]
FIG. 1 is a flow chart of the bar code binarization method of the present invention.
Fig. 2 is a schematic diagram of the bar code binarization system according to the present invention.
Figure 3 illustrates an alternative binarization method embodying the present invention.
Fig. 4 illustrates an alternative method for binarizing a suspicious spot according to embodiments of the present invention.
[ Detailed description ] of the invention
For the features and technical content of the present invention, please refer to the following detailed description and the accompanying drawings, which are provided for reference and illustration only, and are not meant to limit the present invention.
Referring to fig. 1, a flowchart of the bar code binarization method of the present invention is shown, and the specific steps of the bar code binarization method are as follows:
In step S100, sampling grids are constructed, and each independent grid can precisely cover the center point of the bar code module.
Step S200, extracting the gray value of the sampling point of the bar code module on the sampling grid according to the interpolation algorithm to obtain a sampling image.
Step S300, performing a binarization operation on the sampled image to obtain a binarized image a.
Step S400, another binarization operation is performed on the sampled image to obtain a binarized image B.
Step S500, initializing i=0, comparing whether the binarized attributes of the ith module in a/B are the same, if yes, executing S700, if no, executing S600.
Step S600, re-executing binarization for the i-th module.
Step S700, the binary attribute of the ith module is stored, i is increased by 1.
Step S800, judging whether the ith module is the last unprocessed module in the sampling chart, if yes, executing step S900, and if no, executing step S500.
Step S900: and after traversing all the sampling modules, finishing bar code binarization.
Referring to fig. 2, a schematic structural diagram of the bar code binarization system of the present invention is shown, and the system structure includes the following units:
And the sampling grid construction unit 100 establishes a sampling grid according to the bar code symbol positions, and the sampling grid needs to cover the center position of the corresponding bar code minimum module.
And the gray value sampling unit 200 completes the gray value sampling of the bar code minimum module by any interpolation method according to the sampling grid positions.
The binarization unit 300 performs a first binarization process on the sampling matrix.
The binarization unit 400 performs a second binarization process on the sampling matrix.
The binarization result comparing unit 500 performs a comparison operation on the output results of the first and second binarization units, and is labeled 1 for the same reason and 0 for the different reason.
The suspicious binarization filtering unit 600 filters out sampling points marked as 0, and marks the sampling points as suspicious binarization sampling points.
And a third binarization unit 700 for performing third binarization processing on the suspicious binarization sampling point.
The correct binarization filtering unit 800 filters out sampling points marked with 1 and marks the sampling points as correct binarization sampling points.
The binary map storage unit 900 stores the correct binarized sampling point sampling result and the binary result of the suspicious binarized sampling point on which the third binarization is performed.
Referring to fig. 3, an alternative binarization method embodying the present invention is shown. The first binarization method is to traverse the sampled image line by line, perform waveform analysis operation on each one-dimensional data, and determine the binary attribute of the current module according to the peak-trough attribute of each module. Due to image noise, gray value fluctuation caused by factors such as image local gray non-uniformity seriously affects the binarization result of the sampling image, and the reliability of the binarization result is reduced. According to the present invention, a second binarization method, i.e., traversing the sampled image column by column again, can be performed and a waveform analysis operation can be performed. After binarization of the row-column direction based on waveform analysis, if the two binarization results are different, determining the suspicious binarization module.
Referring to fig. 4, an optional method for determining the binarization of suspicious points according to the embodiment of the present invention is shown. Due to image noise, local gray scale of an image is uneven, the binary attribute of the module cannot be determined by a single threshold value, and the binary attribute of the module is highly dependent on local neighborhood gray scale value distribution.
As shown in fig. 4, 3 examples of judging suspicious module binary attributes are enumerated.
As shown in fig. 4 (a), the vertical analysis display center module is "white" in attribute, the horizontal analysis display center module is in the gray transition area, but the gray value of the center module is similar to the gray value of the left module, and the left module is obviously "white", so that the module can be judged to be "white".
As shown in fig. 4 (b), the vertical analysis display center module is "black" in attribute, the horizontal analysis display center module is in the gray transition area, but the gray value of the center module is similar to the gray value of the left module, and the left module is obviously "black", so that the module can be judged to be "black".
As shown in fig. 4 (c), the vertical analysis display center module attribute is "white", and the horizontal analysis display center module attribute is "white", so that the module attribute can be judged as "white".
The above description is merely a preferred embodiment of the present invention, and those skilled in the art may make various modifications and alterations thereto without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. An efficient bar code binarization method, which constructs a sampling image based on a sampling grid and completes sampling point binarization by adopting a secondary verification theory, comprises the following steps:
Step1, constructing a sampling grid;
step 2, generating a sampling graph by adopting an interpolation method according to the grid positions;
step 3, performing binarization on the sampled image by adopting a first binarization method;
Step 4, performing binarization on the sampled image by adopting a second binarization method;
step 5, judging whether the binarization results of each sampling point in the step 4 and the step 5 are the same, if the judgment result is yes, storing the binarization result of the sampling point, and if the judgment result is no, marking the sampling point as a suspicious point;
step 6, re-executing binarization on the suspicious points according to a third binarization method, and storing a binarization result;
the binary attribute of the module depends on the local neighborhood gray value distribution determination, and the binary attribute comprises the following steps: determining the attribute of the center module by combining the gray value of the left module positioned at the left side of the center module under the condition that the horizontal analysis display center module is positioned in a gray transition area;
The first, second and third binarization methods are different from each other, and the three binarization methods can be completed based on different principles or different modes; the third binarization method is higher in precision than the first and second binarization methods, and the execution efficiency of the first and second binarization methods is obviously better than that of the third binarization method.
2. The method of claim 1, wherein the sampling grid is arranged to cover a center point of a corresponding barcode minima module.
3. An efficient bar code binarization method according to claim 1, wherein the interpolation method is selected from nearest neighbor interpolation, bilinear interpolation, weighted average and other interpolation methods.
4. An efficient bar code binarization method according to claim 1, wherein the binarization method maps the sampled image into a black and white binary image.
5. The method of claim 1, wherein the first and second binarization methods are different design ideas, and are global binarization and local binarization.
6. The method of claim 1, wherein the first and second binarization methods use the same principle but in different ways, and can be performing image binarization on a line-by-line basis and performing image binarization on a line-by-line basis.
7. An efficient bar code binarization system, comprising: the device comprises a sampling grid construction unit, a gray value sampling unit, a first binarization unit, a second binarization unit, a binarization result comparison unit, a suspicious binarization result screening unit, a third binarization unit, a correct binarization result screening unit and a binary map storage unit;
The sampling grid construction unit is used for constructing a sampling grid according to the bar code symbol positions;
The gray value sampling unit is used for completing the gray value sampling of the bar code minimum module by any interpolation method according to the sampling grid position;
A first binarization unit that performs a first binarization process on the sampling matrix;
a second binarization unit for performing a second binarization process on the sampling matrix;
The binarization result comparison unit is used for comparing the output results of the first binarization unit and the second binarization unit, wherein the same marks are 1, and the different marks are 0;
The suspicious binarization screening unit screens out sampling points marked with 0 and marks the sampling points as suspicious binarization sampling points;
A binarization unit III, which carries out third binarization processing on the suspicious binarization sampling points;
the correct binarization screening unit screens out sampling points marked as 1 and marks the sampling points as correct binarization sampling points;
the binary image storage unit stores the correct binary sampling point sampling result and the binary result of the suspicious binary sampling point after the third binarization is executed;
the binary attribute of the module depends on the local neighborhood gray value distribution determination, and the binary attribute comprises the following steps: determining the attribute of the center module by combining the gray value of the left module positioned at the left side of the center module under the condition that the horizontal analysis display center module is positioned in a gray transition area;
The first, second and third binarization methods are different from each other, and the three binarization methods can be completed based on different principles or different modes; the third binarization method is higher in precision than the first and second binarization methods, and the execution efficiency of the first and second binarization methods is obviously better than that of the third binarization method.
8. The efficient bar code binarization system of claim 7, wherein the sampling grid is overlaid to a center position of a corresponding bar code minima module.
9. The efficient bar code binarization system according to claim 7, wherein the gray value sampling unit performs bar code minimum module gray value sampling by any interpolation method according to the sampling grid position, and constructs a gray sampling matrix.
CN202011337507.8A 2020-11-25 2020-11-25 Efficient bar code binarization method and system Active CN112364876B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011337507.8A CN112364876B (en) 2020-11-25 2020-11-25 Efficient bar code binarization method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011337507.8A CN112364876B (en) 2020-11-25 2020-11-25 Efficient bar code binarization method and system

Publications (2)

Publication Number Publication Date
CN112364876A CN112364876A (en) 2021-02-12
CN112364876B true CN112364876B (en) 2024-05-14

Family

ID=74533258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011337507.8A Active CN112364876B (en) 2020-11-25 2020-11-25 Efficient bar code binarization method and system

Country Status (1)

Country Link
CN (1) CN112364876B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR19990034030A (en) * 1997-10-28 1999-05-15 윤종용 One-dimensional local adaptive image binarization apparatus and method
CN101727582A (en) * 2008-10-22 2010-06-09 富士通株式会社 Method and device for binarizing document images and document image processor
CN101789081A (en) * 2009-01-22 2010-07-28 佳能株式会社 Binaryzation method for blurry document image and equipment thereof
CN101840499A (en) * 2010-06-01 2010-09-22 福建新大陆电脑股份有限公司 Bar code decoding method and binarization method thereof
CN103839031A (en) * 2014-02-27 2014-06-04 杭州晟元芯片技术有限公司 Special embedded type two-dimensional code recognition method
WO2018081929A1 (en) * 2016-11-01 2018-05-11 深圳大学 Hyperspectral remote sensing image feature extraction and classification method and system thereof
CN108460389A (en) * 2017-02-20 2018-08-28 阿里巴巴集团控股有限公司 A kind of the type prediction method, apparatus and electronic equipment of identification objects in images
CN108960222A (en) * 2017-05-26 2018-12-07 深圳怡化电脑股份有限公司 Image binaryzation method, device, equipment and storage medium
CN109273000A (en) * 2018-10-11 2019-01-25 河南工学院 A kind of audio recognition method
CN110263610A (en) * 2019-02-28 2019-09-20 重庆大学 A kind of degeneration file and picture binary coding method and system based on deep learning
RU2718571C1 (en) * 2019-10-25 2020-04-08 Общество С Ограниченной Ответственностью "Конструкторское Бюро "Дорс" (Ооо "Кб "Дорс") Method for binarisation of images of symbols on a banknote based on histogram of length of boundaries

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR19990034030A (en) * 1997-10-28 1999-05-15 윤종용 One-dimensional local adaptive image binarization apparatus and method
CN101727582A (en) * 2008-10-22 2010-06-09 富士通株式会社 Method and device for binarizing document images and document image processor
CN101789081A (en) * 2009-01-22 2010-07-28 佳能株式会社 Binaryzation method for blurry document image and equipment thereof
CN101840499A (en) * 2010-06-01 2010-09-22 福建新大陆电脑股份有限公司 Bar code decoding method and binarization method thereof
CN103839031A (en) * 2014-02-27 2014-06-04 杭州晟元芯片技术有限公司 Special embedded type two-dimensional code recognition method
WO2018081929A1 (en) * 2016-11-01 2018-05-11 深圳大学 Hyperspectral remote sensing image feature extraction and classification method and system thereof
CN108460389A (en) * 2017-02-20 2018-08-28 阿里巴巴集团控股有限公司 A kind of the type prediction method, apparatus and electronic equipment of identification objects in images
CN108960222A (en) * 2017-05-26 2018-12-07 深圳怡化电脑股份有限公司 Image binaryzation method, device, equipment and storage medium
CN109273000A (en) * 2018-10-11 2019-01-25 河南工学院 A kind of audio recognition method
CN110263610A (en) * 2019-02-28 2019-09-20 重庆大学 A kind of degeneration file and picture binary coding method and system based on deep learning
RU2718571C1 (en) * 2019-10-25 2020-04-08 Общество С Ограниченной Ответственностью "Конструкторское Бюро "Дорс" (Ооо "Кб "Дорс") Method for binarisation of images of symbols on a banknote based on histogram of length of boundaries

Also Published As

Publication number Publication date
CN112364876A (en) 2021-02-12

Similar Documents

Publication Publication Date Title
CN108961235B (en) Defective insulator identification method based on YOLOv3 network and particle filter algorithm
JP5229050B2 (en) Document area extraction apparatus, method, and program from image
CN112183511A (en) Method, system, storage medium and equipment for deriving table from image
CN110647795A (en) Form recognition method
CN111582000B (en) Bar code positioning method, bar code positioning device and related equipment
CN113989604B (en) Tire DOT information identification method based on end-to-end deep learning
CN110738030A (en) Table reconstruction method and device, electronic equipment and storage medium
CN111626145A (en) Simple and effective incomplete form identification and page-crossing splicing method
CN114863129A (en) Instrument numerical analysis method, device, equipment and storage medium
CN112364876B (en) Efficient bar code binarization method and system
CN101840499A (en) Bar code decoding method and binarization method thereof
CN111832497B (en) Text detection post-processing method based on geometric features
JPH10307889A (en) Character recognition method, its device and recording medium recording character recognition program
CN114140336B (en) Infrared image-based dead pixel processing method and device
CN114511851B (en) Hairspring algae cell statistical method based on microscope image
CN113255679B (en) Text detection method, device, medium and electronic equipment
CN115690431A (en) Bar code image binarization method and device, storage medium and computer equipment
CN113392455B (en) House pattern scale detection method and device based on deep learning and electronic equipment
CN115953578A (en) Method and device for evaluating inference result of fracture semantic segmentation model
CN115082944A (en) Intelligent identification and segmentation method, system and terminal for table
CN111435086B (en) Navigation method and device based on splicing map
JP4194309B2 (en) Document direction estimation method and document direction estimation program
CN114202665A (en) Image similarity determining method and device, equipment and storage medium
JPH09185726A (en) Ruled line removing method
CN117115665B (en) Static influence parameter analysis method based on pavement crack analysis method

Legal Events

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