CN108961262B - Bar code positioning method in complex scene - Google Patents

Bar code positioning method in complex scene Download PDF

Info

Publication number
CN108961262B
CN108961262B CN201810476195.5A CN201810476195A CN108961262B CN 108961262 B CN108961262 B CN 108961262B CN 201810476195 A CN201810476195 A CN 201810476195A CN 108961262 B CN108961262 B CN 108961262B
Authority
CN
China
Prior art keywords
bar code
sub
gradient
image
region
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
CN201810476195.5A
Other languages
Chinese (zh)
Other versions
CN108961262A (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.)
Nanjing Huichuan Image Vision Technology Co ltd
Nanjing Huichuan Industrial Visual Technology Development Co ltd
Original Assignee
Nanjing Huichuan Image Vision Technology Co ltd
Nanjing Huichuan Industrial Visual Technology Development 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 Nanjing Huichuan Image Vision Technology Co ltd, Nanjing Huichuan Industrial Visual Technology Development Co ltd filed Critical Nanjing Huichuan Image Vision Technology Co ltd
Priority to CN201810476195.5A priority Critical patent/CN108961262B/en
Publication of CN108961262A publication Critical patent/CN108961262A/en
Application granted granted Critical
Publication of CN108961262B publication Critical patent/CN108961262B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/243Aligning, centring, orientation detection or correction of the image by compensating for image skew or non-uniform image deformations

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Image Analysis (AREA)

Abstract

A barcode positioning method under a complex scene comprises the steps of firstly, dividing an image into a plurality of sub-regions, extracting HOG (histogram of gradient directions) features of each sub-region, and classifying by using a trained boost classifier; carrying out Hough transform on the classified sub-regions to obtain the rotation angle of the bar code, and carrying out rotation correction on the image; and obtaining the accurate bounding box of the bar code by gradient detection and Hough line segment detection on the corrected image. The invention has good detection effect on the bar codes of all rotation angles and the conditions of distortion, uneven illumination, partial shielding and the like. In addition, the method does not need any prior information or artificial marking during detection; meanwhile, the accurate bounding box of the bar code can be detected, an accurate bar code area is provided for the next decoding operation, the area and the cost of searching during decoding are reduced, and the decoding precision is improved.

Description

Bar code positioning method under complex scene
Technical Field
The invention belongs to the technical field of machine vision, relates to a barcode identification technology, and discloses a barcode positioning method based on machine learning and Hough transformation under a complex scene.
Background
The bar code is a graphic identifier which arranges a series of black and white bars with different widths according to a certain coding rule, contains most information of an article and is most widely applied in the logistics and retail industries. The traditional bar code identification technology is a photoelectric bar code identification technology, and special photoelectric scanning, detecting and decoding equipment is needed; with the development of image processing technology and the appearance of two-dimensional codes, image-based barcode identification technology comes along, and particularly, the development of the image barcode identification technology is promoted by the wide application of intelligent mobile equipment.
At present, many image-based barcode recognition tools, such as ZXing and Zbar, have appeared, and these tools often use a line-by-line scanning method to perform barcode positioning and decoding, and have high accuracy and efficiency in a simple background or when a barcode region is artificially aligned, while in a complex image scene, the performance is poor under the conditions of excessive background, uneven illumination, partial overexposure, barcode distortion, and the like. Therefore, it is necessary to filter out the complex background in the image before decoding, and to locate the exact position of the barcode.
Current barcode technologies can be divided into four categories: morphological operation based, image scan based, bottom-hat filtering, and distance transform. Generally, due to the use of corrosion and expansion, a positioning method based on morphological operation is difficult to achieve a good positioning effect by using uniform parameters for bar codes with large size and interval difference; the method based on image scanning has higher accuracy in the scene with simple background, but has strong positioning effect and efficiency in the complex scene; the positioning accuracy of the single bottom-hat filtering operation and distance transformation method in a complex scene is not high. Combining these simple positioning methods often results in a better positioning effect, but will greatly increase the detection time. With the development of deep neural networks in recent years, learners apply the deep neural networks to barcode positioning, and from experimental data, relatively high accuracy is indeed obtained, but the requirements on hardware are high, and the requirements on hardware are difficult to achieve by general mobile equipment.
Reference documents:
[1] wang Shouhai, shen Yue application analysis of barcode technology [ J ]. China market, 2015 (45): 59-61.
WANG Shouhai,SHEN Yue.Application analysis of barcode techniques[J].Chinese Market,2015(45):59-61.
[2] Wang Yajing, dou Zhenhai study of barcode identification techniques [ J ] packaging engineering, 2008,29 (8): 240-241.
WANG Yajing,DOU Zhenhai.Investigation of barcode recognition technology[J].Packaging Engineering,2008,29(8):240-241.
[3]Zebra Crossing.[Online].Available:http://code.google.com/p/zxing/
[4]Zbar.[Online].Available:http://zbar.sourceforge.net/
[5]Katona M,Nyul L G.A Novel Method for Accurate and Efficient Barcode Detection with Morphological Operations[C]//Eighth International Conference on Signal Image Technology and Internet Based Systems.IEEE Computer Society,2012:307-314.
[6] Wang Xialing, lv Yue, wen Ying bar code automatic location and identification in complex backgrounds and non-uniform lighting environment [ J ]. Proceedings of intelligent systems, 2010,5 (1): 35-40.
WANG Lingxia,LV Yue,WENG Yin.Automatic location and recognition of barcodes on objects with complex background and non-uniform lighting[J].CAAI Transactions on Intelligent Systems,2010,5(1):35-40.
[7]Bodnar P,Nyul L G.Improving Barcode Detection with Combination of Simple Detectors[M].2012.
[8]Zamberletti A,Gallo I,Albertini S.Robust Angle Invariant 1D Barcode Detection[C]//Iapr Asian Conference on Pattern Recognition.IEEE Computer Society,2013:160-164.
[9]Creusot C,Munawar A.Real-Time Barcode Detection in the Wild[C]//IEEE Winter Conference on Applications of Computer Vision.IEEE Computer Society,2015:239-245.
Disclosure of Invention
The invention aims to solve the problems that: with the popularization of intelligent mobile equipment and the development of image processing technology, image-based barcode identification technology is widely applied, and the current barcode positioning technology is difficult to adapt to complex image scenes; and the technology with higher positioning accuracy has large calculation amount, and the requirement of real-time property is difficult to achieve. In summary, the existing method is difficult to achieve compatibility of high real-time performance and high accuracy.
The technical scheme of the invention is as follows: a barcode positioning method under a complex scene comprises the steps of firstly dividing an image into a plurality of sub-regions, extracting HOG (histogram of gradient directions) features of each sub-region, and classifying the sub-regions by using a boost classifier into barcode regions and non-barcode regions; carrying out Hough transform on the classified sub-regions to obtain a rotation angle of the bar code, and carrying out rotation correction on the image to enable the bar code to be vertical in the image; and obtaining an accurate bounding box of the bar code by gradient detection and Hough line segment detection on the corrected image, and finishing the positioning of the bar code.
Further, the invention comprises the following steps:
1) Dividing a picture I to be detected into a plurality of m × n sub-regions, extracting HOG characteristics c (I, j) of each sub-region (I, j), classifying each sub-region by using a boost classifier, and judging whether the sub-region is a bar code region;
2) Carrying out Hough transformation on the barcode region obtained in the step 1) to obtain a barcode angle theta b
Obtaining an edge picture I after Canny edge detection of the picture I to be detected e Carrying out Hough transform on each edge belonging to the bar code area to obtain a two-dimensional accumulation matrix A H In a two-dimensional accumulation matrix A H The accumulated value of each column represents the number of points on a straight line with the same slope, and the theta value corresponding to the column with the most points is the rotation angle theta of the bar code b
3) And roughly positioning the bar code by using Hough line segment detection, and finely adjusting the bounding box of the bar code according to the result of gradient detection.
The HOG feature extraction specifically comprises:
in each sub-region, each w cell *h cell Each pixel constitutes a cell unit
Figure BDA0001664547220000031
Each cell unit forms a block, window scanning is carried out by taking stride pixels as step length, a gradient direction histogram of each scanning window is counted, the group number of the histogram is nbins, and therefore the dimension of the HOG characteristic c (i, j) is as follows:
Figure BDA0001664547220000032
the specific method for classifying the subareas by using the boost classifier comprises the following steps:
taking the sub-region HOG characteristic c (i, j) as the input of a boost classifier to obtain the output:
Figure BDA0001664547220000033
the boost classifier is used for screening out a bar code area in an original image I, training the boost classifier by using partial data in a given bar code data set as a given training set, and for a picture I in the given training set t And calculating a plurality of training pairs (in, out), wherein in is the HOG characteristic vector of the sub-region, the value of out is 1 or 0, when the sub-region is the bar code region, the value is 1, and the sub-region is called as a positive sample, otherwise, the value is 0, and the sub-region is called as a negative sample.
The specific method for performing rotation correction on the image and calculating the gradient is as follows:
rotating the picture I to be measured by theta b The angle is set so that the bar code is vertical in the image, at the moment, the gradient of the bar code area in the vertical direction is maximum, the gradient of the bar code area in the horizontal direction is minimum, and the vertical gradient G of the bar code is calculated by using a Sobel operator y And a gradient G in the horizontal direction x Final gradient G = G y -G x Thereby obtaining a gradient map G.
The specific method for accurately positioning the bar code is as follows:
obtaining a gradient image G from the corrected image through gradient detection, performing open operation on the gradient image G, removing isolated interference points, and obtaining an image F g Meanwhile, in the gradient graph G, the line segments are detected by using a Hough line segment detection algorithm, and only all line segments with the inclination angle not more than 5 degrees, namely the line segments which are basically horizontal, are reserved; drawing the line segments in a black picture to obtain a line segment characteristic diagram F l Define feature picture F = F g +F l Respectively projecting the characteristic picture F in the horizontal direction and the vertical direction, determining a rectangular area where the bar code is located according to the size of the projection to obtain a bounding box, and rotating the bounding box by-theta after obtaining the bar code area b ,θ b And obtaining the area of the bar code in the original image by the rotation angle of the bar code.
The invention provides a one-dimensional code detection positioning method based on machine learning and Hough transform, which comprises the steps of firstly dividing an image into a plurality of sub-regions, extracting gradient direction Histogram (HOG) characteristics of each sub-region, and classifying by using a trained boost classifier; carrying out Hough transform on the classified sub-regions to obtain the rotation angle of the bar code, and carrying out rotation correction on the image; and obtaining the accurate bounding box of the bar code by gradient detection and Hough line segment detection on the corrected image. The invention has good detection effect on the bar codes of all rotation angles and the conditions of distortion, uneven illumination, partial shielding and the like.
The invention provides a method for detecting the inclination angle of a bar code by using a boost classifier and Hough transformation for the first time, the method can be compatible with the bar code of each rotation angle and the conditions of distortion, uneven illumination, partial shielding and the like, and no prior information and artificial marking are needed during detection; meanwhile, the invention can detect the accurate bounding box of the bar code by combining the gradient detection algorithm and the Hough line detection algorithm, provides an accurate bar code region for the next decoding operation, reduces the searching region and the cost during decoding, and improves the decoding precision.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
FIG. 2 is a diagram showing the intermediate effect of the method of the present invention.
FIG. 3 is a comparison graph of detection rate and detection time of the method of the present invention at different sub-area widths and heights.
FIG. 4 is a diagram of barcode positioning results according to an embodiment of the present invention.
FIG. 5 is a comparison of the results of the present invention method with other prior art methods.
Detailed Description
The invention provides a new barcode positioning method, which can be used for quickly and accurately positioning a barcode region in a complex image scene. The invention mainly comprises two parts of bar code angle calculation and bar code positioning.
As shown in fig. 1, in the barcode angle calculation part, the image is firstly divided into a plurality of sub-regions, then according to the gradient direction Histogram (HOG) characteristics of the sub-regions, a Boosted classifier is used to screen out regions possibly containing barcodes, and the rotation angle of the barcodes is calculated through hough transform; in the bar code positioning part, a gradient image capable of highlighting the bar code area is obtained through the gradient difference between the horizontal direction and the vertical direction of the bar code area after rotation, the detected line segment in the horizontal direction in the image is combined with the gradient image, and the accurate bounding box of the bar code is obtained through a projection method. The specific implementation mode is as follows:
1. calculating the bar code angle:
the bar code is composed of a series of parallel black and white bars with different widths, has very obvious characteristics, is described by adopting HOG characteristics, and is classified by using a boost classifier. Implementation of the Boosted classifier is described in [10] Viola P, jones M.Rapid Object Detection using a Boosted case of Simple features [ C ]// Computer Vision and Pattern Recognition,2001.CVPR 2001.proceedings of the 2001IEEE Computer Society Conference on. IEEE, 2003I-511-I-518vol.1.
Because the bar code can be regarded as a series of parallel line segments, and each line segment has the same inclination angle, the invention adopts Hough transform to detect. Hough transform is a very effective method for detecting the shape of the boundary of a discontinuity, and fitting of a straight line or a curve is performed by transforming the image coordinate space into a parameter space. A straight line in an image can be represented as
ρ=xcosθ+ysinθ (3)
Wherein rho is more than or equal to 0 and represents the vertical distance from the straight line to the origin, and theta belongs to [0,2 pi ] and represents the included angle between the straight line and the x axis. Any point (x) in the image coordinate space i ,y i ) Can be represented by a sine curve in polar coordinate parameter space (rho, theta), i.e. Hough space, two points (x) collinear in image coordinate space i ,y i ) And (x) j ,y i ) Two curves mapped into polar parameter space will intersect at a point (ρ) 00 ). In specific calculation, the parameter space is regarded as discrete, a two-dimensional accumulation matrix A (rho, theta) is established, and a point (x) in each image coordinate is subjected to i ,y i ) Substituting each discrete value of theta into the formula (3) to obtain a group (rho) ii ) And matrix element A (ρ) ii ) Adding 1, after the calculation is finished, the peak value of A (rho, theta) corresponds to (rho) 00 ) I.e. the linear equation parameter with the largest number of collinear points in the original image. Accordingly, the specific method for calculating the bar code angle is as follows:
1) And (3) dividing the sub-regions:
dividing a picture I to be detected into a plurality of m × n sub-regions, extracting HOG characteristics c (I, j) of each sub-region (I, j), and in each sub-region, every w cell *h cell Each pixel constitutes a cell (cell) per cell
Figure BDA0001664547220000051
The cell units form a block (block), window scanning is carried out by taking stride pixels as step length, the histogram of the gradient direction of each scanning window is counted, the group number of the histogram is nbins, and therefore the dimension of the HOG characteristic c (i, j) is as follows:
Figure BDA0001664547220000052
2) Classifying each sub-region using a Boosted classifier:
and c (i, j) is used as the input of the Boosted classifier to obtain the output:
Figure BDA0001664547220000053
/>
as shown in equation (2), the booted classifier is used to screen out barcode regions in the original image I, and train the barcode regions by using part of data in a given barcode data set as a given training set. A picture I in a given training set t Then, several training pairs (in, out) can be calculated, where in is the HOG feature vector of the sub-region, out takes a value of 1 or 0, and when the sub-region is the barcode region, it takes a value of 1 and is called a positive sample, otherwise it takes a value of 0 and is called a negative sample. To ensure the balance of positive and negative samples, for a training picture I t And reserving all barcode regions as positive samples, and randomly selecting a plurality of background regions as negative samples.
3) Calculating the bar code angle by using Hough transform, which specifically comprises the following steps:
obtaining an edge picture I after Canny edge detection of the picture I to be detected e To c therein t (i, j) =1 area, namely each edge in the area where the bar code is located, is subjected to Hough transformation to obtain a two-dimensional accumulation matrix A H . Accumulating matrix A in two dimensions H The accumulated value of each column represents the number of points on a straight line with the same slope, and the theta value corresponding to the column with the most points is the inclination angle theta of the bar code in the picture to be detected relative to the vertical direction b
2. Positioning a bar code:
according to the inclination angle theta of the bar code b The precise positioning of the bar code is carried out by utilizing gradient detection and Hough line segment detection, which comprises the following steps:
1) The image is rotation corrected and the gradient is calculated:
rotating the picture I to be measured by theta b The angle is such that the barcode is vertical in the image, i.e. the barcode line of the barcode is horizontal. At this time, the gradient of the bar code region in the vertical direction is the largest, and the gradient in the horizontal direction is the smallest. Respectively calculating the vertical direction gradient G of the bar code by using Sobel operator y And gradient G in the horizontal direction x Final gradient G = G y -G x Thereby obtaining a gradient map G.
2) And (3) accurately positioning the bar code by combining a gradient map and Hough line segment detection:
performing open operation on the gradient map G, and removing isolated interference points to obtain a map F g . Meanwhile, in the gradient map G, the hough line segment detection algorithm is used to detect line segments, and only all line segments with an inclination angle of not more than 5 °, i.e., substantially horizontal line segments, are retained. Drawing the line segments in a black picture to obtain a line segment feature diagram F l . Define feature picture F = F g +F l . And respectively projecting the characteristic picture F in the horizontal direction and the vertical direction, and determining a rectangular area where the bar code is located according to the size of the projection. After obtaining the bar code region, rotate it by-theta b And obtaining the area of the bar code in the original image.
Fig. 2 is an implementation effect diagram of each step of the present invention, and the barcode picture to be detected is derived from two public barcode data sets: arTe-Lab rotational Bar code dataset and Minster university Bar code dataset, supplied by Zamberletti et al. In fig. 2, respectively: (a) Subregion partition schematic diagram, (b) Canny detection edge diagram I e A bar code region schematic diagram detected by a boost classifier, and a two-dimensional accumulation matrix A obtained by Hough transformation H Projection thereof, (e) gradient map G, and (F) gradient map F subjected to opening operation g The projection of the characteristic picture F in the vertical and horizontal directions, and the bar code bounding box effect picture.
In the invention, the size of the divided sub-regions has great influence on the precision and the detection time of the subsequent detection, the smaller the sub-region is, the time for classifying each sub-region is reduced, however, the number of the sub-regions is increased, and the detection time is correspondingly increased. Fig. 3 shows the detection rate and detection time of the present invention on two data sets when different sub-area widths and heights are selected. By comprehensively considering the detection precision and the detection efficiency, the invention proposes to select the subregion with the width m of 96 and the height n of 32.
FIG. 4 is a result diagram of several embodiments of positioning by the method of the present invention, where barcodes are all located and marked by bounding boxes, and it can be seen that the method of the present invention can achieve accurate positioning of barcodes under the condition of complicated image scenes including excessive background, uneven illumination, partial overexposure, partial occlusion, barcode distortion, etc.
The accuracy calculation mode adopted by the invention is as follows:
Figure BDA0001664547220000061
where R represents the detected barcode region, G represents the true barcode region, and ∈ (t) represents a unit step function, so:
Figure BDA0001664547220000071
the detection rate can be expressed as the ratio of the number of pictures with the detection accuracy rate A (R, G) higher than 0.5 to the total number of test pictures
Figure BDA0001664547220000072
Fig. 5 is a graph comparing the detection rate of the barcode positioning method based on the multi-layer perceptron (MLP) proposed by Zamberletti et al, and the MLP method is as follows: [11] zamberletti A, gallo I, albertii S.Robust Angle Invariant 1D Barcode detection [ C ]// Iapr Asian Conference on Pattern recognition. IEEE Computer Society, 2013. It can be seen from fig. 5 that the invention has a higher detection rate compared to other barcode positioning methods. The test statistics of the two data sets show that when the threshold of the accuracy rate A (R, G) is selected to be 0.5, the detection rate of the method is as high as 0.93, which is far higher than 0.64 of the MLP method. Meanwhile, the detection time of the flat and uniform barcode picture is 92 milliseconds, and the detection requirement of real-time property can be completely met.

Claims (5)

1. A barcode positioning method under a complex scene is characterized in that an image is firstly divided into a plurality of sub-regions, HOG (histogram of gradient directions) features of each sub-region are extracted, and a Boosted classifier is used for classifying the sub-regions into barcode regions and non-barcode regions; carrying out Hough transform on the classified sub-regions to obtain a rotation angle of the bar code, and carrying out rotation correction on the image to enable the bar code to be vertical in the image; the method comprises the following steps of obtaining an accurate bounding box of a bar code by gradient detection and Hough line segment detection on a corrected image, and completing the positioning of the bar code:
1) Dividing a picture I to be detected into a plurality of m × n sub-regions, extracting HOG characteristics c (I, j) of each sub-region (I, j), classifying each sub-region by using a boost classifier, and judging whether the sub-region is a bar code region;
2) Carrying out Hough transformation on the bar code area obtained in the step 1) to obtain a bar code angle theta b
Obtaining an edge picture I after Canny edge detection of the picture I to be detected e Carrying out Hough transform on each edge belonging to the bar code area to obtain a two-dimensional accumulation matrix A H In a two-dimensional accumulation matrix A H The accumulated value of each row represents the point number on the straight line with the same slope, and the theta value corresponding to the row with the most point number is the rotation angle theta of the bar code b
3) By correcting the image for rotation, i.e. by rotation theta b And (4) obtaining an accurate bounding box of the bar code by gradient detection and Hough line segment detection on the corrected image, and completing the positioning of the bar code.
2. The barcode positioning method under the complex scene as claimed in claim 1, wherein the extracting of the HOG features specifically comprises:
in each sub-region, each w cell *h cell Each pixel constitutes a cell unit
Figure FDA0004029003900000011
Each cell unit forms a block, window scanning is carried out by taking stride pixels as step length, a gradient direction histogram of each scanning window is counted, the group number of the histogram is nbins, and therefore the dimension of the HOG characteristic c (i, j) is as follows:
Figure FDA0004029003900000012
3. the barcode positioning method under the complex scene as claimed in claim 1, wherein the specific method for classifying the subareas by using a boost classifier comprises:
taking the sub-region HOG characteristic c (i, j) as the input of a boost classifier to obtain the output:
Figure FDA0004029003900000013
the boost classifier is used for screening out a bar code area in an original image I, training the boost classifier by using partial data in a given bar code data set as a given training set, and for a picture I in the given training set t And calculating a plurality of training pairs (in, out), wherein in is the HOG characteristic vector of the sub-region, the value of out is 1 or 0, when the sub-region is the bar code region, the value is 1, and the sub-region is called as a positive sample, otherwise, the value is 0, and the sub-region is called as a negative sample.
4. The barcode positioning method in a complex scene as claimed in claim 1, wherein the specific method for performing rotation correction on the image and calculating the gradient is as follows:
rotating the picture I to be measured by theta b Angle of rotationAnd enabling the bar code to be vertical in the image, wherein the gradient of the bar code area in the vertical direction is maximum, the gradient of the bar code area in the horizontal direction is minimum, and the gradient G of the bar code in the vertical direction is calculated by using a Sobel operator respectively y And gradient G in the horizontal direction x Final gradient G = G y -G x Thereby obtaining a gradient map G.
5. The method for positioning the barcode under the complex scene as claimed in claim 1, wherein the specific method for positioning the barcode comprises:
obtaining a gradient image G from the corrected image through gradient detection, performing opening operation on the gradient image G, removing isolated interference points, and obtaining an image F g Meanwhile, in the gradient map G, a Hough line segment detection algorithm is used for detecting line segments, and only all line segments with the inclination angle not more than 5 degrees, namely the line segments which are basically horizontal, are reserved; drawing the line segments in a black picture to obtain a line segment characteristic diagram F l Defining feature picture F = F g +F l Respectively projecting the characteristic picture F in the horizontal direction and the vertical direction, determining a rectangular area where the bar code is located according to the size of the projection to obtain a bounding box, and rotating the bounding box by-theta after obtaining the bar code area b ,θ b And the rotation angle of the bar code is the area of the bar code in the original image.
CN201810476195.5A 2018-05-17 2018-05-17 Bar code positioning method in complex scene Active CN108961262B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810476195.5A CN108961262B (en) 2018-05-17 2018-05-17 Bar code positioning method in complex scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810476195.5A CN108961262B (en) 2018-05-17 2018-05-17 Bar code positioning method in complex scene

Publications (2)

Publication Number Publication Date
CN108961262A CN108961262A (en) 2018-12-07
CN108961262B true CN108961262B (en) 2023-04-18

Family

ID=64499854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810476195.5A Active CN108961262B (en) 2018-05-17 2018-05-17 Bar code positioning method in complex scene

Country Status (1)

Country Link
CN (1) CN108961262B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI742492B (en) * 2019-12-25 2021-10-11 偉詮電子股份有限公司 Barcode detection method and system
CN110210409B (en) * 2019-06-04 2021-04-20 南昌市微轲联信息技术有限公司 Method and system for detecting form frame lines in form document
CN111523342A (en) * 2020-04-26 2020-08-11 成都艾视特信息技术有限公司 Two-dimensional code detection and correction method in complex scene
CN113688649A (en) * 2021-08-16 2021-11-23 江苏博赛孚医疗科技有限公司 Quick QR code positioning method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4116597B2 (en) * 2004-07-13 2008-07-09 グローリー株式会社 Bar code recognition apparatus, bar code recognition method, and bar code recognition program.
CN104268498B (en) * 2014-09-29 2017-09-19 杭州华为数字技术有限公司 A kind of recognition methods of Quick Response Code and terminal

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
"Cascade object detection with deformable part models";Pedro F. Felzenszwalb et al.;《2010 IEEE Computer Society Conference on Computer Vision and Pattern Recognition》;全文 *
"Improving Barcode Detection with Combination of Simple Detectors";Péter Bodnár et al.;《2012 Eighth International Conference on Signal Image Technology and Internet Based Systems》;全文 *
"QR Code Detection Using Convolutional Neural Networks";Tzu-Han Chou et al.;《2015 International Conference on Advanced Robotics and Intelligent Systems (ARIS)》;全文 *

Also Published As

Publication number Publication date
CN108961262A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
Yuan et al. A robust and efficient approach to license plate detection
CN110414507B (en) License plate recognition method and device, computer equipment and storage medium
CN108961262B (en) Bar code positioning method in complex scene
US8611662B2 (en) Text detection using multi-layer connected components with histograms
Silva et al. A flexible approach for automatic license plate recognition in unconstrained scenarios
CN106934803B (en) method and device for detecting surface defects of electronic device
CN107909081B (en) Method for quickly acquiring and quickly calibrating image data set in deep learning
US8170368B2 (en) Correcting device and method for perspective transformed document images
CN109409355B (en) Novel transformer nameplate identification method and device
CN108986152B (en) Foreign matter detection method and device based on difference image
US10586321B2 (en) Automatic detection, counting, and measurement of lumber boards using a handheld device
CN109413411B (en) Black screen identification method and device of monitoring line and server
CN112329656B (en) Feature extraction method for human action key frame in video stream
CN110598566A (en) Image processing method, device, terminal and computer readable storage medium
CA3136674C (en) Methods and systems for crack detection using a fully convolutional network
CN114049499A (en) Target object detection method, apparatus and storage medium for continuous contour
CN111695373A (en) Zebra crossing positioning method, system, medium and device
Arulmozhi et al. Image refinement using skew angle detection and correction for Indian license plates
US11216905B2 (en) Automatic detection, counting, and measurement of lumber boards using a handheld device
CN110516731B (en) Visual odometer feature point detection method and system based on deep learning
Recky et al. Façade segmentation in a multi-view scenario
Kumar An efficient text extraction algorithm in complex images
CN111178359A (en) License plate number recognition method, device and equipment and computer storage medium
CN111797832A (en) Automatic generation method and system of image interesting region and image processing method
CN111583341B (en) Cloud deck camera shift detection 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