CN107451505A - The angle correction method of express delivery single bar code - Google Patents
The angle correction method of express delivery single bar code Download PDFInfo
- Publication number
- CN107451505A CN107451505A CN201710586651.7A CN201710586651A CN107451505A CN 107451505 A CN107451505 A CN 107451505A CN 201710586651 A CN201710586651 A CN 201710586651A CN 107451505 A CN107451505 A CN 107451505A
- Authority
- CN
- China
- Prior art keywords
- bar code
- express delivery
- target image
- single bar
- delivery single
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
- G06K7/1404—Methods for optical code recognition
- G06K7/146—Methods for optical code recognition the method including quality enhancement steps
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
- G06K7/1404—Methods for optical code recognition
- G06K7/1408—Methods for optical code recognition the method being specifically adapted for the type of code
- G06K7/1413—1D bar codes
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Toxicology (AREA)
- Electromagnetism (AREA)
- Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a kind of angle correction method of express delivery single bar code, the ambient noise of express delivery single bar code is handled by using the shape facility of bar code, therefore the ambient noise of express delivery single bar code can be handled cleaner, so as to preferably reduce interference of the ambient noise to express delivery single bar code.In addition, the characteristics of being made up of using bar code one group of equal length and strip region parallel to each other, carries out angle correct, so as to improve the positional accuracy to express delivery single bar code by Hough transform or Radon conversion to express delivery single bar code.
Description
Technical field
The present invention relates to technical field of computer information processing, especially a kind of angle correct side of express delivery single bar code
Method.
Background technology
Due to bar codes technique have it is accurate, quick, conveniently, it is economical the characteristics of, therefore be easy to penetrate into automation pipe
The every field of reason, and also emerged in an endless stream on the algorithm of one-dimensional bar code recognition.However, with which kind of recognizer pair
Processing is identified in bar code, is not often to bar from optimal angle when user captures bar code image with identification device
Barcode image is captured, so as to which the situation for recognition failures occur can be caused, in order to improve the recognition accuracy to bar code, this
A little algorithms are required for carrying out the correction of angle.
Traditional method is first to carry out the barcode size or text field to the image captured with morphologic expansion and erosion algorithm
Positioning, then enters line tilt correction with the bar code to extraction.But because the background of express delivery list complicates more, use traditional side
When positioning is identified to express delivery single bar code in method, easily disturbed by express delivery list ambient noise complicated and changeable, so as to hold
Easily there is the problem of to express delivery single bar code position inaccurate.
The content of the invention
To solve the above problems, it is an object of the invention to provide a kind of angle correction method of express delivery single bar code, energy
It is enough that preferably the ambient noise of express delivery single bar code is handled, so as to preferably reduce ambient noise to express delivery wall scroll
The interference of shape code, so as to improve the positional accuracy to express delivery single bar code.
Technical scheme is used by the present invention solves its problem:
The angle correction method of express delivery single bar code, comprises the following steps:
A, input picture;
B, target image is opened;
C, binaryzation is carried out to target image, then to the length-width ratio of each connected domain in the target image after binaryzation
Calculated, denoising is carried out to target image according to result of calculation;
D, Radon or Hough transform are carried out to each connected domain;
E, ask for carrying out the maximum after Radon or Hough transform;
F, the row coordinate of maximum is obtained, the row coordinate correspond to the angle of inclination of target image;
G, rotation correction is carried out to target image according to angle of inclination.
Further, the input picture in step A, first according to file destination name, finds out this article inside file system
The file address of part, is exited if it can not find this document, and step B is performed if this document is found.
Further, denoising is carried out to target image according to result of calculation in step C, if result of calculation is less than what is given
Threshold value, then the connected domain corresponding to the result of calculation is deleted, so as to, background removal, be completed on the basis of bar code is retained
Denoising.
The beneficial effects of the invention are as follows:The angle correction method of express delivery single bar code, it is special by using the shape of bar code
Levy and the ambient noise of express delivery single bar code is handled, therefore the ambient noise of express delivery single bar code can be handled more
Totally, so as to preferably reducing interference of the ambient noise to express delivery single bar code;In addition, it is by one group of length using bar code
The characteristics of spending equal and parallel to each other strip region composition, by Hough transform or Radon conversion to express delivery single bar code
Angle correct is carried out, so as to improve the positional accuracy to express delivery single bar code.
Brief description of the drawings
The invention will be further described with example below in conjunction with the accompanying drawings.
Fig. 1 is the flow chart of the angle correction method of the present invention.
Embodiment
Reference picture 1, the angle correction method of express delivery single bar code of the invention, comprises the following steps:
A, input picture;
B, target image is opened;
C, binaryzation is carried out to target image, then to the length-width ratio of each connected domain in the target image after binaryzation
Calculated, denoising is carried out to target image according to result of calculation;
D, Radon or Hough transform are carried out to each connected domain;
E, ask for carrying out the maximum after Radon or Hough transform;
F, the row coordinate of maximum is obtained, the row coordinate correspond to the angle of inclination of target image;
G, rotation correction is carried out to target image according to angle of inclination.
The angle correction method of the express delivery single bar code of the present invention, by using the shape facility of bar code to express delivery wall scroll
The ambient noise of shape code is handled, therefore the ambient noise of express delivery single bar code can be handled cleaner, so as to
It is enough preferably to reduce interference of the ambient noise to express delivery single bar code.In addition, it is by one group of equal length and mutual using bar code
The characteristics of parallel strip region forms, angle school is carried out to express delivery single bar code by Hough transform or Radon conversion
Just, so as to improving the positional accuracy to express delivery single bar code.
Specifically, the input picture in step A, first according to file destination name, finds out this article inside file system
The file address of part, is exited if it can not find this document, and step B is performed if this document is found.
Specifically, when target image is opened in step B, the target image for being originally used for colour is converted to by formula below
Gray level image:
When be originally used for the target image of colour by successful conversion into gray level image after, follow-up place is being carried out to gray level image
Reason.
Specifically, the length-width ratio of each connected domain in target image is calculated in step C, first to target image
Binaryzation is carried out, then the length-width ratio of each connected domain is calculated.In the picture, minimum unit is pixel, each pixel
Surrounding has 8 adjacent pixels, and common syntople has 2 kinds:4 adjoinings and 8 adjoinings.4 adjoinings have 4 points, i.e., up and down 4 altogether
Individual point;The point one of 8 adjoinings shares 8, in addition to 4 points up and down, in addition to the point in diagonal positions.Each two abuts
Pixel be connect, therefore, the point to communicate with each other forms a region, and disconnected point forms different areas
Domain.The set that such a all points communicate with each other and formed, as connected domain.Binaryzation is being carried out to target image
During, the gray level of gray level image is set first as L, then its tonal range is [0, L-1], using OTSU algorithms the gray scale
Image is divided into prospect and background two parts, and the segmentation threshold split to gray level image is tried to achieve by following formula:
T=Max [w0(t)*(u0(t)-u)2+w1(t)*(u1(t)-u)2)]
Wherein, t is segmentation threshold, w0For background ratio, u0For background mean value, w1For prospect ratio, u1For prospect average, u
For the average of entire image.The value t of above formula is set to try to achieve maximum, the optimal threshold as split to the gray level image, from
And complete the binaryzation of image.After carrying out binaryzation to target image, many connected domains can be obtained, each connected domain not phase
Together, it is able to characterize the ambient noise on bar code and express delivery list as target image, therefore, utilizes each connected domain
Length-width ratio can carry out effective denoising as characteristic index to the ambient noise on express delivery list.
Wherein, denoising is carried out to target image according to result of calculation in step C, if result of calculation is less than given threshold
Value, then the connected domain corresponding to the result of calculation is deleted, so as to, background removal, be completed on the basis of bar code is retained
Make an uproar processing.Specifically, the connected domain of gray level image of the setting Jing Guo binaryzation is expressed as Hi, wherein 1<i<N;Set AiThe company of expression
Logical domain HiCorresponding length-width ratio;ValueiRepresent connected domain HiCorresponding pixel size;A is threshold value.If Ai<A, then Valuei=
0, that is, delete the connected domain;Otherwise Valuei=1, that is, retain the connected domain.
Specifically, in step D, because bar code is equal length and strip region parallel to each other, therefore energy after denoising
Remaining clean connected domain is accessed, then, Radon or Hough transform are carried out to these remaining connected domains.Specifically
Ground, so that Radon is converted as an example, the functional expression corresponding to connected domain is f (x, y), then f (x, y) Radon conversion is the function edge
The line integral of one group of straight line in the plane comprising the function, formula is:
Wherein, δ (x) is Dirac functions, whereinThe definition of the δ (t) is by bianry image f (x, y) edge
Straight line t=xcos θ+ysin θ and carry out integration and project, all set { R (θ, t), θ ∈ [0, π) } for projecting composition are just
It is Radon conversion.And because the Radon conversion of the connected domain of bar code is the function along one in the plane comprising the function
The line integral of group straight line, therefore a maximum can be correspond to after converting, therefore the maximum can be accurately tried to achieve in step F
Value, and in step G, the row coordinate of maximum is obtained according to the maximum tried to achieve, now, the row coordinate correspond to bar code
The angle of inclination of strip region, therefore, according to the angle of inclination, rotation correction can be carried out to the strip region of bar code, from
And realize the angle correct to express delivery single bar code.
Specifically, rotation correction is carried out to target image according to angle of inclination in step H, realized using following method:
Set (X0,Y0) be target image in a preimage vegetarian refreshments, (X2,Y2) it is preimage vegetarian refreshments (X0,Y0) by rotation
The result obtained after correction, first, by following formula to origin (X0,Y0) enter line translation:
Wherein, (X1,Y1) it is to preimage vegetarian refreshments (X by above formula0,Y0) transformation results entered obtained by line translation, W is mesh
The width of logo image, H are the height of target image;Then, according to the anglec of rotation θ tried to achieve in step G, the matrix of above formula is entered
Row matrix rotates, and the formula for carrying out matrix rotation is as follows:
Therefore, can be to the preimage vegetarian refreshments (X of target image according to the anglec of rotation θ tried to achieve in step G0,Y0) revolved
Transfer to another school just, so as to obtain it is corrected after check point (X2,Y2), so, adopt with the aforedescribed process to all in target image
Pixel carries out rotation correction, you can obtains the express delivery single bar code by angle correct adjustment.
Contrast traditional bar code correcting mode, angle correction method of the invention, using the length-width ratio of each connected domain
As characteristic index, preferably the ambient noise of express delivery single bar code can be removed, in addition, carrying out Radon by connected domain
Or required solution after Hough transform, the angle of inclination of express delivery single bar code can be preferably obtained, so as to effectively
The angle of inclination of express delivery single bar code is reasonably adjusted.
Above is the preferable implementation to the present invention is illustrated, but the invention is not limited in above-mentioned embodiment party
Formula, those skilled in the art can also make a variety of equivalent variations on the premise of without prejudice to spirit of the invention or replace
Change, these equivalent deformations or replacement are all contained in the application claim limited range.
Claims (3)
1. the angle correction method of express delivery single bar code, it is characterised in that:Comprise the following steps:
A, input picture;
B, target image is opened;
C, binaryzation is carried out to target image, then the length-width ratio of each connected domain in the target image after binaryzation carried out
Calculate, denoising is carried out to target image according to result of calculation;
D, Radon or Hough transform are carried out to each connected domain;
E, ask for carrying out the maximum after Radon or Hough transform;
F, the row coordinate of maximum is obtained, the row coordinate correspond to the angle of inclination of target image;
G, rotation correction is carried out to target image according to angle of inclination.
2. the angle correction method of express delivery single bar code according to claim 1, it is characterised in that:In the step A
Input picture, first according to file destination name, the file address of this document is found out inside file system, if can not find this
File is then exited, and step B is performed if this document is found.
3. the angle correction method of express delivery single bar code according to claim 1, it is characterised in that:Root in the step C
Denoising is carried out to target image according to result of calculation, it is if result of calculation is less than given threshold value, result of calculation institute is right
The connected domain answered is deleted, so as to, background removal, complete denoising on the basis of bar code is retained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710586651.7A CN107451505A (en) | 2017-07-18 | 2017-07-18 | The angle correction method of express delivery single bar code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710586651.7A CN107451505A (en) | 2017-07-18 | 2017-07-18 | The angle correction method of express delivery single bar code |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107451505A true CN107451505A (en) | 2017-12-08 |
Family
ID=60488902
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710586651.7A Pending CN107451505A (en) | 2017-07-18 | 2017-07-18 | The angle correction method of express delivery single bar code |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107451505A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109447067A (en) * | 2018-10-24 | 2019-03-08 | 北方民族大学 | A kind of bill angle detecting antidote and automatic ticket checking system |
CN116167394A (en) * | 2023-02-21 | 2023-05-26 | 深圳牛图科技有限公司 | Bar code recognition method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6708884B1 (en) * | 2002-06-25 | 2004-03-23 | The United States Of America As Represented By The Secretary Of The Army | Method and apparatus for rapid and precision detection of omnidirectional postnet barcode location |
CN102930268A (en) * | 2012-08-31 | 2013-02-13 | 西北工业大学 | Accurate positioning method for data matrix code under pollution and multi-view situation |
CN103294980A (en) * | 2013-06-18 | 2013-09-11 | 四川大学 | Micro-QR (Quick Response) code recognition method based on picture processing |
CN103793679A (en) * | 2014-03-05 | 2014-05-14 | 江苏物联网研究发展中心 | One-dimensional bar code recognition method based on DaVinci technology |
-
2017
- 2017-07-18 CN CN201710586651.7A patent/CN107451505A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6708884B1 (en) * | 2002-06-25 | 2004-03-23 | The United States Of America As Represented By The Secretary Of The Army | Method and apparatus for rapid and precision detection of omnidirectional postnet barcode location |
CN102930268A (en) * | 2012-08-31 | 2013-02-13 | 西北工业大学 | Accurate positioning method for data matrix code under pollution and multi-view situation |
CN103294980A (en) * | 2013-06-18 | 2013-09-11 | 四川大学 | Micro-QR (Quick Response) code recognition method based on picture processing |
CN103793679A (en) * | 2014-03-05 | 2014-05-14 | 江苏物联网研究发展中心 | One-dimensional bar code recognition method based on DaVinci technology |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109447067A (en) * | 2018-10-24 | 2019-03-08 | 北方民族大学 | A kind of bill angle detecting antidote and automatic ticket checking system |
CN109447067B (en) * | 2018-10-24 | 2021-07-20 | 北方民族大学 | Bill direction detection and correction method and automatic bill checking system |
CN116167394A (en) * | 2023-02-21 | 2023-05-26 | 深圳牛图科技有限公司 | Bar code recognition method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10095903B2 (en) | Block decoding method and system for two-dimensional code | |
CN109409366B (en) | Distorted image correction method and device based on angular point detection | |
CN110647795B (en) | Form identification method | |
CN110298282B (en) | Document image processing method, storage medium and computing device | |
CN106599028B (en) | Book content searching and matching method based on video image processing | |
CN103942797B (en) | Scene image text detection method and system based on histogram and super-pixels | |
CN104794421A (en) | QR (quick response) code positioning and recognizing methods | |
CN105844277B (en) | Label identification method and device | |
CN104424457A (en) | Method for identifying two-dimensional code under the condition of nonlinear distortion | |
CN108830133B (en) | Contract image picture identification method, electronic device and readable storage medium | |
CN111145124A (en) | Image tilt correction method and device | |
WO2021051527A1 (en) | Image segmentation-based text positioning method, apparatus and device, and storage medium | |
CN101315664A (en) | Text image preprocessing method for character recognition | |
CN113903024A (en) | Handwritten bill numerical value information identification method, system, medium and device | |
CN107451505A (en) | The angle correction method of express delivery single bar code | |
CN109741273A (en) | A kind of mobile phone photograph low-quality images automatically process and methods of marking | |
CN110610170B (en) | Document comparison method based on image accurate correction | |
CN106778766B (en) | Positioning point-based rotating number identification method and system | |
CN115222935A (en) | Image correction method, image correction device, electronic apparatus, scanning pen, and storage medium | |
CN109359652A (en) | A method of the fast automatic extraction rectangular scanning part from digital photograph | |
CN114998347B (en) | Semiconductor panel corner positioning method and device | |
CN110930358B (en) | Solar panel image processing method based on self-adaptive algorithm | |
CN107358138B (en) | Correction method of nonlinear distortion EAN bar code, mobile terminal and storage device | |
CN110059600B (en) | Single-line character recognition method based on pointing gesture | |
JP3378439B2 (en) | Form image creation device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171208 |
|
RJ01 | Rejection of invention patent application after publication |