CN102663337B - Method for quick Data Matrix two-dimensional barcode identifying under simple condition background - Google Patents

Method for quick Data Matrix two-dimensional barcode identifying under simple condition background Download PDF

Info

Publication number
CN102663337B
CN102663337B CN201210069350.4A CN201210069350A CN102663337B CN 102663337 B CN102663337 B CN 102663337B CN 201210069350 A CN201210069350 A CN 201210069350A CN 102663337 B CN102663337 B CN 102663337B
Authority
CN
China
Prior art keywords
bar code
data matrix
region
image
mark
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
CN201210069350.4A
Other languages
Chinese (zh)
Other versions
CN102663337A (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.)
Jiangsu blue creative intelligent Polytron Technologies Inc
Original Assignee
Jiangnan University
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 Jiangnan University filed Critical Jiangnan University
Priority to CN201210069350.4A priority Critical patent/CN102663337B/en
Publication of CN102663337A publication Critical patent/CN102663337A/en
Application granted granted Critical
Publication of CN102663337B publication Critical patent/CN102663337B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention provides a method for quick Data Matrix two-dimensional barcode identifying under simple condition background. The method meets the demand for practical application of a barcode in industrial field, and differs from a traditional detecting method for Data Matrix positioning graphics, that is, expressing the L-shaped boundary of a barcode 2-D by a function with the distance of 1-D as the angle, thereby avoiding related problems of line detection; calculates a linear equation of the boundary and a rotation angle by the boundary function according to the boundary characteristic of the Data Matrix barcode, thereby avoiding the problems of large calculation quantity and time complexity in the traditional method; weakens the effect of fractured straight lines on barcode boundary positioning using a circle searching method, thereby solving the problems of inaccurate and incomplete barcode positioning; and determines an intersection of dashed-line sides by a simultaneous dashed-line side linear equation to achieve the purpose of accurate positioning of a barcode region. The method for quick Data Matrix two-dimensional barcode identifying under simple condition background, differing from the traditional barcode positioning idea, accurately locates the barcode only according tomarked curves of the boundary, thereby not only having small calculation quantity, but also improving the recognition efficiency of Data Matrix.

Description

Data Matrix two-dimensional bar code method for quickly identifying under simple operating mode background
Technical field
The present invention relates to a kind of two-dimensional bar code method for quickly identifying, especially the Data Matrix two-dimensional bar code method for quickly identifying under a kind of simple operating mode background, specifically under simple operating mode background by industrial camera to carry out picture shooting containing Data Matrix two-dimensional bar code article and in picture positioning strip code position identify the method for bar code content fast, belong to the technical field of Data Matrix two-dimensional bar code identification.
Background technology
Along with the intensification of bar code application, also, to the development that develops simultaneously of miniaturization, safe and reliable, multi-functional, economic and practical, remote, software and hardware, there is a lot of novel equipment in the equipment of bar-code identification.Bar code acquiring terminal is towards the future development of integrated multiple mechanics of communication and network technology integration apparatus, portability and multifunctional comprehensive at present; The generation equipment of bar code is towards short run and specificity development.Concrete manifestation has the multifunctional integrated mobile phone reading bar codes such as bar code communication based on CDMA, GPRS identification bar code and collection data sampling and processing, mutual, demonstration, certification.External a lot of companies, organically combine barcode technology and machine vision well, are applied in the measurement of commercial production streamline, quite high in the use popularity rate of the state such as America and Europe and Japan and Korea S machine vision.Within 2007, the global machine vision total market size is about 9,000,000,000 dollars, and increases rapidly with the speed of annual 10.9% left and right, will exceed 15,000,000,000 dollars by 2012.Machine vision technique development area the most ripe and that use amount is maximum mainly concentrates on America and Europe and Japan, and there are PPTVision, Siemens, NI, Banner, Cognex etc. in well-known manufacturer.
In actual application, machine vision is general little as an independent system, but occurs as a part for an automated system, with data acquisition, motion control, logic control and communication network incompatible its unique advantage that realizes that matches.
At present, barcode technology has been applied to a lot of field of China, has thousands of enterprises and Research Center to be engaged in the research of bar code aspect, application work.Wherein, Chinese letter co has been invented by Article Numbering Center of China, and GM code and CM code have been invented by Shenzhen Xi Gan company, and the commercial monopoly of Scientific And Technical company on two-dimensional bar code generation technique broken in the research of the two-dimensional bar code of these independent intellectual property rights.Although made significant headway aspect the recognition algorithm of the domestic generation in bar code and bar code, some companies carry out secondary development and application in conjunction with offshore company's product of the future and recognition technology, also independent research there is the recognizing apparatus of intellecture property, but compare with developed country, still have very large gap, the core recognition technology of applying in the world more two-dimensional bar code still rests in external science-and-technology enterprise hand.
The people such as Chen Yuanyuan propose to utilize perspective view that bar code region is positioned, extracted.First image is carried out to rim detection, again the image that passes through edge treated is carried out to the projection of horizontal direction and vertical direction, join together to determine the general location of bar code according to horizontal direction in perspective view and the larger region of vertical direction projection value, out by bar code extracted region finally.This method is edge very dense and the complexity in hypothesis bar code region, and meanwhile, other edges of regions point is fairly simple and gray scale is more smooth.This method is simple to background, bar code region is more applicable without the image ratio of too many interference pattern around, but image to complex background, effect can reduce greatly.
Certain methods is all carried out piecemeal by image at present, to every calculate Grad a little obtain image border, determine whether possible bar code region by direction and the quantity etc. of each marginal point, then Probability Area is communicated with to the region that bar code is extracted in the processing such as merging.The method is to utilize the textural characteristics of bar code itself to remove the pseudo-region of bar code.But the method is very crucial to the size of setting piece, and in the time that piece setting is too large, the region obtaining can be very large, and the object that comprises a part of bar code surrounding, the more difficult selection of carrying out potential region; When piece setting too hour, be difficult to embody the textural characteristics of bar code.
Wu Jiapeng etc. propose the Data Matrix two-dimensional bar code method for extracting region based on Gabor filtering and BP neural network, and it utilizes BP neural network that the image texture characteristic obtaining through Gabor filtering is installed pixel is classified, thereby extracts bar code region.In the time of background more complicated, this method can together extract the region similar to bar code region of gray scale in image, forms a large amount of pseudo-regions, produces higher false alarm rate.But adopt neural network to need a lot of training samples, and working time is long, is not too applicable to general daily identification needs.
2D bar code technology is a kind of brand-new information storage and Transfer Technology, is subject to paying close attention to of international community always.Because it can improve the collecting efficiency of information and the processing speed of data is widely used in information-based industry.At present, two-dimensional bar code is almost comparative maturity abroad, and domestic still in conceptual phase.Although the generation in bar code makes a lot of progress with recognition technical elements, still there is larger gap with external barcode technology level.
Restriction China development 2D bar code technology mainly contains three aspects: reason:
(1) although, the two-dimensional bar code of independent research broken the commercial monopoly of offshore company on two-dimensional bar code generation technique, the two-dimensional bar code range of application of independent research is very little, is not accepted by international standard.At present general two-dimensional bar code is all still the two-dimensional bar code with international standard in the world.
(2), at present conventional two-dimensional bar code recognition core technology is not grasped completely.The research of recognizer is not very thorough, is much the recognition software development kit of buying offshore company, does not form the recognition algorithm with independent intellectual property right.
(3), the recognizing apparatus of two-dimensional bar code is more expensive.Although more domestic enterprises also design the recognizing apparatus with generating two-dimension bar-code, its product is the secondary development based on Sybol company of U.S. product mostly, and price is also relatively high; The recognizing apparatus of independent research is difficult to again the effect that reaches satisfied in recognition effect.
Therefore the recognizing apparatus that, recognition technology, the cost of development of study two-dimensional bar code are low has very important realistic meaning and far-reaching significance to promoting 2D bar code technology in development, propelling China process of IT application of China.
Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, the method for quickly identifying of the Data Matrix two-dimensional bar code under a kind of simple operating mode background is provided, its method is simple, and calculated amount is few, improves recognition efficiency and accuracy of identification, quick and convenient, safe and reliable.
According to technical scheme provided by the invention, the Data Matrix two-dimensional bar code method for quickly identifying under a kind of simple operating mode background, described Data Matrix two-dimensional bar code method for quickly identifying comprises the steps:
A, collection include the gray level image of Data Matrix, and set up coordinate system taking the described gray level image upper left corner as initial point; Utilize Roberts edge detection operator to carry out rim detection to described gray level image, and utilize maximum variance between clusters (OTSU) to carry out binaryzation to the gray level image carrying out after rim detection;
B, adopt recursion marking method to carry out zone marker to image obtained above;
C, be rectangle according to Data Matrix bar code exterior contour, and image after utilizing region area to above-mentioned mark zone marker carries out preliminary screening, remove after interference region the preliminary image that comprises Data Matrix bar code region that obtains;
D, be " L " type straight line according to Data Matrix Bar code positioning image, carry out postsearch screening according to form factor and spherical property, screening obtains the image in Data Matrix bar code region;
E, the image that above-mentioned postsearch screening is obtained to Data Matrix bar code region carry out bar code border mark, and the labeling function curve obtaining is carried out to differentiate, obtain corresponding derivative curve; Determine the required anglec of rotation in Data Matrix bar code region according to derivative curve, Data Matrix bar code region being rotated to the square position of level according to the anglec of rotation.
Adopt gridding method to carry out data extraction to the above-mentioned Data Matrix bar code region that rotates to the square position of level.
Described step a comprises the steps:
When a1, employing Roberts edge detection operator carry out rim detection, two convolution kernels of Roberts edge detection operator are respectively G x → = 1 0 0 - 1 , G y → = 0 1 - 1 0 ; Adopt 1 norm gradient to weigh amplitude | G → ( x , y ) | = | G x → | + | G y → | ;
A2, image after above-mentioned rim detection is adopted to maximum variance between clusters Threshold segmentation, reject the less marginal point of part gradient, to delete background information, retain foreground target information.
Described step b comprises the steps:
B1, to the image after binaryzation from top to bottom, from left to right scan line by line, if search out and there is no marked some H in the time of scanning, distributes a new mark to described some H;
If the neighborhood of b2 point H has the same mark of recurrence frequency division of object pixel;
B3, interconnective pixel is all carried out to mark, the region of each connection adopts same mark mark, and different connected regions adopts different mark marks;
B4, repeat the step of above-mentioned b1~b3, to in image, unlabelled impact point being shifted to an earlier date and the impact point in the corresponding field of unmarked impact point being distributed to same mark mark according to recurrence, until in image all impact point all mark or searching less than unlabelled impact point.
In described step c, the respective area of marked region in calculation procedure b, and the region that calculates area and be less than 80 pixels is screened out to the preliminary image that comprises Data Matrix bar code region that obtains.
Described steps d comprises the steps:
D1, the image calculation form parameter F that preliminary acquisition is comprised to Data Matrix bar code region, to obtain some regions that are similar to rectangle;
D2, screening form parameter F be in the region of [4/ π, 7.2/ π], and calculate spherical property parameter S in region after screening;
D3, screen spherical property parameter S and exist region, to obtain the image in Data Matrix bar code region.
Described form parameter F is F=‖ B ‖ 2/ (4 π A), B is the girth in correspondence markings region, A is the area in correspondence markings region; Area A is f (x, y) is the pixel value of (x, y) in correspondence markings region, and J is the size of marked region horizontal direction, and K is the size of marked region vertical direction; Spherical property parameter S is S=r i/ r c, r i, r cthe corresponding incircle in expressive notation region, external radius of a circle respectively; The center of circle of described incircle and circumscribed circle is all positioned in the center of gravity of marked region.
Described step e comprises the steps:
The function that e1, employing distance are angle carries out mark to zone boundary, and labeling function is λ=Wsec θ; Wherein, W represents the distance of center of gravity to the distance on horizontal dotted line limit or center of gravity to solid horizontal line limit, straight line after θ represents to be connected between point on bar code solid line limit and center of gravity and the angle of horizontal direction, λ represents point on the bar code solid line limit Euclidean distance to center of gravity;
E2, to after the labeling function differentiate of described zone boundary, the point that searching derivative function is 0, and judge whether derivative function is at 0 is continuity point, to obtain the angle on two solid line limits in Data Matrix bar code, and obtain according to the angle on two solid line limits the angle that Data Matrix bar code region need to rotate.
Also comprise step e3, justify search along the solid line limit of Data Matrix bar code, to obtain the end points of Data Matrix bar code solid line, and according to the intersection point on Data Matrix bar code dotted line limit, Data Matrix bar code is accurately located.
Adopt the recursion marking method of 8 neighborhoods to carry out zone marker.
Advantage of the present invention: for bar code image under simple industrial environment, according to the feature of Data Matrix positioning pattern, adopt the difference in orthogonal directions to carry out rim detection as the Roberts operator of gradient principle, have very strong specific aim; After the image pre-service such as binaryzation, by 8 neighborhood recurrence methods, mark is carried out in the region in image, obtain behind a lot of zonules the feature that is then rectangle in conjunction with the profile of Data Matrix again, utilize region area, form parameter and spherical property to carry out region screening to region, obtain the approximate region of bar code, have good real-time." L " shape border of bar code 2-D is expressed with the function that the distance of 1-D is angle, in boundary function, seek out the straight-line equation on border and the angle of rotation according to Data Matrix bar code border characteristic; And weaken the impact of fracture straight line on bar code border location with justifying the method for searching for; Simultaneous dotted line limit straight-line equation is determined the intersection point on dotted line limit, reaches the accurately object of location of bar code region.This boundary marker algorithm is to be first applied on the location of bar code at present, has jumped out traditional Bar code positioning thinking, only according to the mark curve on border, bar code is accurately located, and not only calculated amount is little, has also improved the recognition efficiency of Data Matrix.
Brief description of the drawings
Fig. 1 is Data Matrix bar code image detection coordinates schematic diagram of the present invention.
Fig. 2 is bar code border mark schematic diagram of the present invention.
Fig. 3 is the schematic diagram of Data Matrix angle calculation of the present invention and the search of end points circle.
Fig. 4 is process flow diagram of the present invention.
Embodiment
Below in conjunction with concrete drawings and Examples, the invention will be further described.
The object of the invention is to rely on and " L " shape positioning pattern for the location of Data Matrix bar-code identification is in the past undue, and large, the consuming time shortcoming such as serious of straight-line detection calculated amount, proposes in embedded system, to realize two-dimensional bar code and fast, accurately knows method for distinguishing.
As shown in Figure 4: under simple operating mode background, Data Matrix two-dimensional bar code is known fast method for distinguishing and comprised the steps:
A, collection include the gray level image of Data Matrix, and set up coordinate system taking the described gray level image upper left corner as initial point; Utilize Roberts edge detection operator to carry out rim detection to described gray level image, and utilize maximum variance between clusters (OTSU) to carry out binaryzation to the gray level image carrying out after rim detection;
As shown in Figure 1: image-region to be identified of the present invention is rectangle OXZY, and taking O point as initial point, OX direction is X-axis, and OY direction is Y-axis, sets up coordinate system, and image pixel coordinate represents with this coordinate system, and bar code image is in this region; And regulation, aftermentioned image and point coordinate are all as the criterion with this coordinate system.Initial point O is the upper left corner of gray level image; The binaryzation of image, the gray-scale value of the pixel on image is set to 0 or 255 exactly, namely whole image is presented and significantly only has black and white visual effect.
Detailed process is:
A1, Roberts edge detection operator have good treatment effect to precipitous low noise image, and can meet simple and agility requirement, and Roberts edge detection operator utilizes local difference operator to find edge; While adopting Roberts edge detection operator to carry out rim detection, two convolution kernels of Roberts edge detection operator are respectively G x → = 1 0 0 - 1 , G y → = 0 1 - 1 0 ; Adopt 1 norm gradient to weigh amplitude | G → ( x , y ) | = | G x → | + | G y → | ;
A2, image after above-mentioned rim detection is adopted to maximum variance between clusters Threshold segmentation, reject the less marginal point of part gradient, to delete background information, retain foreground target information.
B, adopt recursion marking method to carry out zone marker to image obtained above;
Adopt 8 neighborhood recursion marking methods to carry out zone marker to image, can mark preferably continuum, reduce the part of fracture, particularly:
B1, to the image after binaryzation from top to bottom, from left to right scan line by line, if search out and there is no marked some H in the time of scanning, distributes a new mark to described some H;
If the neighborhood of b2 point H has the same mark of recurrence frequency division of object pixel;
B3, interconnective pixel is all carried out to mark, the region of each connection adopts same mark mark, and different connected regions adopts different mark marks;
B4, repeat the step of above-mentioned b1~b3, to in image, unlabelled impact point being shifted to an earlier date and the impact point in the corresponding field of unmarked impact point being distributed to same mark mark according to recurrence, until in image all impact point all mark or searching less than unlabelled impact point.
C, be rectangle according to Data Matrix bar code exterior contour, and image after utilizing region area to above-mentioned mark zone marker carries out preliminary screening, remove after interference region the preliminary image that comprises Data Matrix bar code region that obtains;
When adopting after 8 neighborhood recursion marking method marks, calculate the area of each marked region, because be two-value picture, area calculates the counting being just reduced to pixel in marked region; The minimum gauge of Data Matrix bar code is 10*10, a normal data module is 3 pixels, may not exclusively wait factor for ensureing that reliability and border are followed the tracks of, calculate according to 2 pixels of a data module, and the region that area is less than 80 pixels is screened out to the preliminary image that comprises Data Matrix bar code region that obtains.
D, be " L " type straight line according to Data Matrix Bar code positioning image, carry out postsearch screening according to form factor and spherical property, screening obtains the image in Data Matrix bar code region;
Because Data Matrix bar code has altogether 30 kinds of specifications, Data Matrix bar code seek the straight line that bit pattern is " L " shape, consider it is that edge pixel to Data Matrix bar code calculates, adopt form parameter F to screen, again due to Data Matrix bar code to seek bit pattern Aspect Ratio scope be [1,4], adopt spherical property parameter S to filter out bar code region in the region of mark; Because form parameter F calculates simply, fast operation, can preliminary screening go out target area, more accurately filters out bar code region by spherical property parameter S.
Be " L " type straight line according to Data Matrix Bar code positioning image, and the ratio value scope of positioning pattern in all versions of Data Matrix, the marked region after step c screening is carried out to postsearch screening according to form factor and spherical property again, particularly:
D1, the image calculation form parameter F that preliminary acquisition is comprised to Data Matrix bar code region, to obtain some regions that are similar to rectangle;
Described form parameter F is F=‖ B ‖ 2/ (4 π A), B is the girth in correspondence markings region, A is the area in correspondence markings region; Area A is f (x, y) is the pixel value of (x, y) in correspondence markings region, and J is the size of marked region horizontal direction, and K is the size of marked region vertical direction; When marked region is bowlder, form parameter F equals 1; And in the time that marked region is other shapes, form parameter F is greater than 1;
D2, screening form parameter F be in the region of [4/ π, 7.2/ π], and calculate spherical property parameter S in region after screening;
Spherical property parameter S is S=r i/ r c, r i, r cthe corresponding incircle in expressive notation region, external radius of a circle respectively; The center of circle of described incircle and circumscribed circle is all positioned in the center of gravity of marked region.No matter how how the center of circle is selected, and the value of spherical property parameter S, when marked region is bowlder, all reaches maximum (S=1); In the time that being other shapes, region has S < 1.Spherical property parameter S is relatively applicable to also having when the variation of the existing elongation of the variation aspect of target the variation of scrambling aspect, can reduce because of slight bar code distortion or cause the impacts of reason on bar code Primary Location such as bar code distortion due to shooting angle, improving the stability of bar code Primary Location.
D3, screen spherical property parameter S and exist region, to obtain the image in Data Matrix bar code region.
E, the image that above-mentioned postsearch screening is obtained to Data Matrix bar code region carry out bar code border mark, and the labeling function curve obtaining is carried out to differentiate, obtain corresponding derivative curve; Determine the required anglec of rotation in DataMatrix bar code region according to derivative curve, Data Matrix bar code region being rotated to the square position of level according to the anglec of rotation;
Described step e is specially:
The function that e1, employing distance are angle carries out mark to zone boundary, and labeling function is λ=Wsec θ; Wherein, W represents the distance of center of gravity to the distance on horizontal dotted line limit or center of gravity to solid horizontal line limit, straight line after θ represents to be connected between point on bar code solid line limit and center of gravity and the angle of horizontal direction, λ represents point on the bar code solid line limit Euclidean distance to center of gravity; As shown in Figure 2;
Because Data Matrix bar code region comprises two solid line limits, for the border feature of Data Matrix bar code, adopt apart from the function for angle mark is carried out in border.Labeling function requires first to obtain the center of gravity to obtaining Data Matrix bar code region in steps d, the function that the distance of then obtaining two solid line coboundary points and center of gravity is angle.
This mark is not subject to the impact of Data Matrix bar code region translation, but can be subject to the region rotation of Data Matrix bar code or scaling and convert; The impact that scaling causes is that the range value of mark can change, and this problem can solve by amplitude peak value is normalized to unit value, but the impact that utilizes this mark to be rotated obtains the border angle of bar code;
E2, to after the labeling function differentiate of described zone boundary, the point that searching derivative function is 0, and judge whether derivative function is at 0 is continuity point, to obtain the angle on two solid line limits in Data Matrix bar code, and obtain according to the angle on two solid line limits the angle that Data Matrix bar code region need to rotate;
Because there are two real limits in the sprocket bit of Data Matrix bar code, two other dotted line limit, carries out a differentiate, the derivative curve obtaining to the labeling function curve obtaining; After differentiate, solid line limit is continuous, be 0 point therefore find derivative in the function after differentiate, and then judge whether this point is that continuity point just can obtain the angle on 2 solid line limits, then the mean value of getting these two angles just can obtain that bar code need to rotate angle.When obtaining after the required anglec of rotation, acquisition Data Matrix bar code region can be rotated to the position of level pros, so that to reading of Data Matrix bar code region, and adopt gridding method to carry out data extraction to the above-mentioned DataMatrix bar code region that rotates to the square position of level.
Consider in the time of rim detection, while may there is the fracture of straight line and screen in region in the solid line limit of bar code screened fall, so the position of only asking for the end points on bar code solid line limit according to " L " shape boundary marker function is insecure.Thereby justify search along the direction on bar code solid line limit in edge detection graph, when guaranteeing solid line limit complete, reach the object of the accurate location to barcode position.Be in particular:
The generalized case of considering Fig. 3, there is certain angle in " L " shape border and transverse axis, and O (x sets up an office o, y o), M (x m, y m), N (x n, y n), P (x p, y p), wherein M, N, angle that P is corresponding are θ 1, θ 2, θ 3, correspond to ρ with the distance of an O 1, ρ 2, ρ 3.
By known focus point O (x o, y o) and | MO|=ρ 1, MO angle θ 1.Can obtain equation:
( x m - x o ) 2 + ( y m - y o ) 2 = &rho; 2 y m - y 0 = &rho; 1 sin &theta; 1
Separate the coordinate of invocation point M:
x m = x o + &rho; 1 cos &theta; 1 y m = y o + &rho; 1 sin &theta; 1
In like manner can obtain N (x n, y n), P (x p, y p):
x n = x o + &rho; 2 cos &theta; 2 y n = y o + &rho; 2 sin &theta; 2
x p = x o + &rho; 3 cos &theta; 3 y p = y o + &rho; 3 sin &theta; 3
The equation of straight line MP, PN is:
(x m-x p)y-(y m-y p)x+x my m-2x my p+x py p=0
(x n-x p)y-(y n-y p)x+x ny n-2x ny o+x py p=0
Because the minimum data template of Data Matrix is 3 pixels, thus build a r=3, the circle of the center of circle on straight line PM, and the line search that marches forward in one end of PM.When there is more than 5 frontier points in circle time, the center of circle just moves forward search along straight line PM taking diameter 2r as unit.In order to ensure not lose the line segment of fracture, in the time that in the scope of circle, non-boundary point or frontier point number are less than 5, stop search, taking final search to another end points Q (x of frontier point to the point of the intersection point of straight line MP as solid line limit PM q, y q), in like manner can obtain another end points S (x of solid line limit PN s, y s).
Can obtain the equation of straight line QR at the slope of Q point substitution straight line PN, can obtain the equation of RS at the slope of R point substitution straight line PM, the equation of straight line QR, RS is:
(x n-x p)y-(y n-y p)x-(x n-x p)y q+(y n-y p)x q=0
(x m-x p)y-(y m-y p)x-(x m-x p)y s+(y m-y p)x s=0
The above-mentioned straight line QR of simultaneous, RS equation can obtain dotted line limit intersection point R (x r, y r):
x r = ( x n - x p ) ( x m - x p ) ( y q - y s ) - ( y n - y p ) ( x m - x p ) x q + ( x n - x p ) ( y m - y p ) x s ( x n - x p ) ( y m - y p ) - ( y n - y p ) ( x m - x p ) y r = ( x n - x p ) ( y m - y p ) y q - ( y n - y p ) ( x m - x p ) y s - ( y n - y p ) ( y m - y p ) ( x q - x s ) ( x n - x p ) ( y m - y p ) - ( y n - y p ) ( x m - x p )
Specific implementation:
1., taking straight line PM as deferent, bar code region in radius r=3 search edge detection graph.In order to ensure operation, 2 dimension groups are set, one dimension is used for storing home position, and another Wesy stores the frontier point number in this circle.Carry out frontier point search according to the European disk of rounding of radius r=3 along straight line PM, and the frontier point number searching is deposited in row corresponding to the center of circle in two-dimensional array, till searching new round internal boundary points number always and not meeting the demands;
In the position in the center of circle 2., in the end meeting the demands, calculate each frontier point in circle and, to the intersection point position of straight line PM, get intersection point and be worth farthest another end points Q for this solid line limit of bar code at straight line PM, and record Q point coordinate;
3., adopt same method to obtain the end points S coordinate on another solid line limit of bar code;
4., the equation of simultaneous straight line RS, RQ, obtain intersection point R;
5., according to the position of P, Q, R, 4 definite bar codes of S, complete the accurate location in bar code region.
The present invention is directed to bar code image under simple industrial environment, according to the feature of Data Matrix positioning pattern, adopt the difference in orthogonal directions to carry out rim detection as the Roberts operator of gradient principle, have very strong specific aim; After the image pre-service such as binaryzation, by 8 neighborhood recurrence methods, mark is carried out in the region in image, obtain behind a lot of zonules the feature that is then rectangle in conjunction with the profile of Data Matrix again, utilize region area, form parameter and spherical property to carry out region screening to region, obtain the approximate region of bar code, have good real-time." L " shape border of bar code 2-D is expressed with the function that the distance of 1-D is angle, in boundary function, seek out the straight-line equation on border and the angle of rotation according to Data Matrix bar code border characteristic; And weaken the impact of fracture straight line on bar code border location with justifying the method for searching for; Simultaneous dotted line limit straight-line equation is determined the intersection point on dotted line limit, reaches the accurately object of location of bar code region.This boundary marker algorithm is to be first applied on the location of bar code at present, has jumped out traditional Bar code positioning thinking, only according to the mark curve on border, bar code is accurately located, and not only calculated amount is little, has also improved the recognition efficiency of Data Matrix.

Claims (9)

1. the Data Matrix two-dimensional bar code method for quickly identifying under simple operating mode background, is characterized in that, described Data Matrix two-dimensional bar code method for quickly identifying comprises the steps:
(a), collection includes the gray level image of Data Matrix, and sets up coordinate system taking the described gray level image upper left corner as initial point; Utilize Roberts edge detection operator to carry out rim detection to described gray level image, and utilize maximum variance between clusters (OTSU) to carry out binaryzation to the gray level image carrying out after rim detection;
(b), adopt recursion marking method to carry out zone marker to gray level image obtained above;
(c), be rectangle according to Data Matrix bar code exterior contour, and image after utilizing region area to above-mentioned zone mark carries out preliminary screening, removes after interference region the preliminary image that comprises Data Matrix bar code region that obtains;
(d), be " L " type straight line according to Data Matrix Bar code positioning image, carry out postsearch screening according to form factor and spherical property, screening obtains the image in Data Matrix bar code region;
(e), image that above-mentioned postsearch screening is obtained to Data Matrix bar code region carries out bar code border mark, and the labeling function curve obtaining carried out to differentiate, obtains corresponding derivative curve; Determine the required anglec of rotation in Data Matrix bar code region according to derivative curve, Data Matrix bar code region being rotated to the square position of level according to the anglec of rotation;
Described step (e) comprises the steps:
(e1), adopt distance mark to be carried out in zone boundary for the function of angle, labeling function is λ=Wsec θ; Wherein, W represents the distance of center of gravity to the distance on horizontal dotted line limit or center of gravity to solid horizontal line limit, straight line after θ represents to be connected between point on bar code solid line limit and center of gravity and the angle of horizontal direction, λ represents point on the bar code solid line limit Euclidean distance to center of gravity;
(e2), to after the labeling function differentiate of described zone boundary, the point that searching derivative function is 0, and judge whether derivative function is at 0 is continuity point, to obtain the angle on two solid line limits in Data Matrix bar code, and obtain according to the angle on two solid line limits the angle that Data Matrix bar code region need to rotate.
2. the Data Matrix two-dimensional bar code method for quickly identifying under simple operating mode background according to claim 1, is characterized in that: adopt gridding method to carry out data extraction to the above-mentioned Data Matrix bar code region that rotates to the square position of level.
3. the Data Matrix two-dimensional bar code method for quickly identifying under simple operating mode background according to claim 1, is characterized in that, described step (a) comprises the steps:
(a1), while adopting Roberts edge detection operator to carry out rim detection, two convolution kernels of Roberts edge detection operator are respectively G x &RightArrow; = 1 0 0 - 1 , G y &RightArrow; = 0 1 - 1 0 ; Adopt 1 norm gradient to weigh amplitude | G &RightArrow; ( x , y ) | = | G x &RightArrow; | + | G y &RightArrow; | ;
(a2), image after above-mentioned rim detection is adopted to maximum variance between clusters Threshold segmentation, reject the less marginal point of part gradient, to delete background information, retain foreground target information.
4. the Data Matrix two-dimensional bar code method for quickly identifying under simple operating mode background according to claim 1, is characterized in that, described step (b) comprises the steps:
(b1), to the image after binaryzation from top to bottom, from left to right scan line by line,, if search out and there is no marked some H in the time of scanning, distribute a new mark to described some H;
(b2) if the neighborhood of some H has the same mark of recurrence frequency division of object pixel;
(b3), interconnective pixel is all carried out to mark, the region of each connection adopts same mark mark, and different connected regions adopts different mark marks;
(b4), repeat the step of above-mentioned (b1)~(b3), to in image, unlabelled impact point being shifted to an earlier date and the impact point in the corresponding field of unmarked impact point being distributed to same mark mark according to recurrence, until in image all impact point all mark or searching less than unlabelled impact point.
5. the Data Matrix two-dimensional bar code method for quickly identifying under simple operating mode background according to claim 1, it is characterized in that: in described step (c), the respective area of marked region in calculation procedure (b), and the region that calculates area and be less than 80 pixels is screened out to the preliminary image that comprises Data Matrix bar code region that obtains.
6. the Data Matrix two-dimensional bar code method for quickly identifying under simple operating mode background according to claim 1, is characterized in that, described step (d) comprises the steps:
(d1), image calculation form parameter F that preliminary acquisition is comprised to Data Matrix bar code region, to obtain some regions that are similar to rectangle;
(d2), screening form parameter F is in the region of [4/ π, 7.2/ π], and calculates spherical property parameter S in region after screening;
(d3), screening spherical property parameter S exists region, to obtain the image in Data Matrix bar code region.
7. the Data Matrix two-dimensional bar code method for quickly identifying under simple operating mode background according to claim 6, is characterized in that: described form parameter F is F=||B|| 2/ (4 π A), B is the girth in correspondence markings region, A is the area in correspondence markings region; Area A is f (x, y) is the pixel value of (x, y) in correspondence markings region, and J is the size of marked region horizontal direction, and K is the size of marked region vertical direction; Spherical property parameter S is S=r i/ r c, r i, r cthe corresponding incircle in expressive notation region, external radius of a circle respectively; The center of circle of described incircle and circumscribed circle is all positioned in the center of gravity of marked region.
8. the Data Matrix two-dimensional bar code method for quickly identifying under simple operating mode background according to claim 1, it is characterized in that, also comprise step (e3), justify search along the solid line limit of Data Matrix bar code, to obtain the end points of Data Matrix bar code solid line, and according to the intersection point on Data Matrix bar code dotted line limit, Data Matrix bar code is accurately located.
9. according to the Data Matrix two-dimensional bar code method for quickly identifying under the simple operating mode background described in claim 1 or 4, it is characterized in that: adopt the recursion marking method of 8 neighborhoods to carry out zone marker.
CN201210069350.4A 2012-03-16 2012-03-16 Method for quick Data Matrix two-dimensional barcode identifying under simple condition background Active CN102663337B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210069350.4A CN102663337B (en) 2012-03-16 2012-03-16 Method for quick Data Matrix two-dimensional barcode identifying under simple condition background

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210069350.4A CN102663337B (en) 2012-03-16 2012-03-16 Method for quick Data Matrix two-dimensional barcode identifying under simple condition background

Publications (2)

Publication Number Publication Date
CN102663337A CN102663337A (en) 2012-09-12
CN102663337B true CN102663337B (en) 2014-07-23

Family

ID=46772822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210069350.4A Active CN102663337B (en) 2012-03-16 2012-03-16 Method for quick Data Matrix two-dimensional barcode identifying under simple condition background

Country Status (1)

Country Link
CN (1) CN102663337B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104057719A (en) * 2013-03-23 2014-09-24 杨筑平 Bar code printing method, device and system and bar code label
CN103235951B (en) * 2013-04-22 2016-06-15 中山大学 A kind of Primary Location method of matrix two-dimensional barcode
CN104125386B (en) * 2013-04-25 2018-04-17 宏达国际电子股份有限公司 Image processor and its image treatment method
CN103927765B (en) * 2014-02-21 2016-10-12 北京象开科技有限公司 For positioning the method and apparatus in bar code region in image
CN106056020B (en) * 2016-06-01 2018-09-25 东莞理工学院 A kind of bar code detection recognition method and system based on NI Vision Builder for Automated Inspection
CN108073849B (en) * 2016-11-18 2021-04-30 杭州海康威视数字技术股份有限公司 Bar code detection method, device and system
CN106778988B (en) * 2016-11-19 2019-06-25 哈尔滨理工大学 A kind of hiding information recognition methods based on gray scale identification
CN110874733A (en) * 2018-08-31 2020-03-10 北京意锐新创科技有限公司 Passive code scanning payment method and device supporting external equipment
CN110046528B (en) * 2018-11-20 2022-10-28 维库(厦门)信息技术有限公司 Dot-shaped DataMatrix two-dimensional code identification method
CN111723804B (en) * 2019-03-18 2024-05-17 株式会社理光 Image-text separation device, image-text separation method and computer readable recording medium
CN109934040B (en) * 2019-03-22 2022-06-10 福州图腾易讯信息技术有限公司 Boundary screening method and equipment for one-dimensional bar code
CN110991201B (en) * 2019-11-25 2023-04-18 浙江大华技术股份有限公司 Bar code detection method and related device
CN111553317B (en) * 2020-05-14 2023-08-08 北京惠朗时代科技有限公司 Anti-fake code acquisition method and device, computer equipment and storage medium
CN111783493A (en) * 2020-06-18 2020-10-16 福州富昌维控电子科技有限公司 Identification method and identification terminal for batch two-dimensional codes

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882207A (en) * 2010-06-01 2010-11-10 福建新大陆电脑股份有限公司 Bar code decoding chip of Data Matrix codes and decoding method thereof
CN102346850A (en) * 2011-10-13 2012-02-08 西北工业大学 DataMatrix bar code area positioning method under complex metal background

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100379190C (en) * 2005-07-19 2008-04-02 北京中星微电子有限公司 Rate control method based on two-dimension code video transmission

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882207A (en) * 2010-06-01 2010-11-10 福建新大陆电脑股份有限公司 Bar code decoding chip of Data Matrix codes and decoding method thereof
CN102346850A (en) * 2011-10-13 2012-02-08 西北工业大学 DataMatrix bar code area positioning method under complex metal background

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Data Matrix条码实用定位技术;姚林昌等;《江南大学学报》;20120430;第11卷(第2期);第137-141页 *
一种Data Matrix条码的快速识别方法;姚林昌等;《计算机应用研究》;20111130;第28卷(第11期);第4368-4369页 *
姚林昌等.Data Matrix条码实用定位技术.《江南大学学报》.2012,第11卷(第2期),第137-141页.
姚林昌等.一种Data Matrix条码的快速识别方法.《计算机应用研究》.2011,第28卷(第11期),第4368-4369页.

Also Published As

Publication number Publication date
CN102663337A (en) 2012-09-12

Similar Documents

Publication Publication Date Title
CN102663337B (en) Method for quick Data Matrix two-dimensional barcode identifying under simple condition background
CN103745234B (en) Band steel surface defect feature extraction and classification method
CN104751187B (en) Meter reading automatic distinguishing method for image
CN101504716B (en) QR two-dimension bar code recognition method and system based on field programmable gate array
CN103400151B (en) The optical remote sensing image of integration and GIS autoregistration and Clean water withdraw method
CN102136058B (en) Bar code image identification method
CN102654902B (en) Contour vector feature-based embedded real-time image matching method
Garz et al. Binarization-free text line segmentation for historical documents based on interest point clustering
CN109100741A (en) A kind of object detection method based on 3D laser radar and image data
CN103049763B (en) Context-constraint-based target identification method
CN104680161A (en) Digit recognition method for identification cards
CN109190752A (en) The image, semantic dividing method of global characteristics and local feature based on deep learning
CN106600600A (en) Wafer defect detection method based on characteristic matching
CN101576958B (en) Extraction method of rectangle seal graphics with border based on form feature
CN105095822B (en) A kind of Chinese letter co pattern image detection method and system
CN104766046A (en) Detection and recognition algorithm conducted by means of traffic sign color and shape features
CN103514448A (en) Method and system for navicular identification
CN104680130A (en) Chinese character recognition method for identification cards
CN102236788A (en) Kilowatt-hour meter image automatic identification method
CN104102904B (en) A kind of static gesture identification method
CN102750531B (en) Method for detecting handwriting mark symbols for bill document positioning grids
CN103530590A (en) DPM (direct part mark) two-dimensional code recognition system
CN102867195B (en) Method for detecting and identifying a plurality of types of objects in remote sensing image
CN104680550A (en) Method for detecting defect on surface of bearing by image feature points
CN109376740A (en) A kind of water gauge reading detection method based on video

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20161020

Address after: 214029 floor, building A1, high wave East Road, Binhu District, Jiangsu, Wuxi, 9, China

Patentee after: Jiangsu blue creative intelligent Polytron Technologies Inc

Address before: 1800 No. 214122 Jiangsu city of Wuxi Province Li Lake Avenue

Patentee before: Jiangnan University

CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 214122 1-5 / F, building 8, 2018 Lihu Avenue, Wuxi City, Jiangsu Province

Patentee after: JIANGSU LANCHUANG INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: 214029 9th floor, building A1, 999 gaolang East Road, Binhu District, Wuxi City, Jiangsu Province

Patentee before: JIANGSU LANCHUANG INTELLIGENT TECHNOLOGY Co.,Ltd.