Feature extracting method based on Image neighborhood structure tensor equation
Technical field
The invention belongs to algorithm field, it is related to a kind of Region Feature Extraction method, and in particular to one kind is based on Image neighborhood
The feature extracting method of structure tensor equation.
Background technology
The widely used Quick Response Code in Data Matrix Shi world manufacture fields.Data Matrix are the one of Quick Response Code
Individual member, was invented with 1989 by U.S. world data company, was widely used in false proof, the pool mark of commodity.It is that one kind can be with
The coding of the surface of solids is marked directly on, the coding can automatically be read as usual bar code by corresponding scanning means,
Favored by manufacturing industry very much.Current Data Matrix are widely used in product identification, false proof, quality tracing, automatic stored, logistics
The system such as management and control.Data Matrix employ the error-correcting code technique of complexity so that the coding has superpower antipollution
Ability.Even if coded portion is damaged, reading full detail is not interfered with equally.The print characteristics of Data Matrix cause it into
For currently the only support can be marked directly(Print, scribe, photoetching, the mode such as burn into punching press)In product or component surface
Coding.Its efficient fault freedom allows it to bear the pollution identified to component surface in manufacture or the process of circulation, because
This receives manufacturing welcome very much.For a variety of applications, the Data of diversified forms has been promulgated in the world
Matrix symbol standards systems.The minimum dimension of Data Matrix is minimum in current all bar codes, especially particularly suitable
In the mark of finding, and it is directly printed on physically.
Data Matrix can be divided into ECC000-140 and ECC200 two types again, and ECC000-140 has various differences
The error correcting function of grade, and ECC200 then produces polynomial computation to make mistake correction through Reed-Solomon algorithms
Code, its size can on demand be printed as different size, but the error correcting code for using should with dimensional fits, due to its algorithm compared with
For easy, and size is more resilient, therefore general more universal with ECC200.Data Matrix code densities are high, and size is small, information
Amount is big, domestic also less to DM yards of research to this identification there is provided possible.Data Matrix yards is a kind of matrix type two-dimension
Bar code, its maximum feature is exactly density high, and its minimum dimension is the code of minimum in current all bar codes.DM yards can be only
25mm2Area on encode 30 numerals.DM employs the error-correcting code technique of complexity so that the coding has superpower antipollution
Ability.Data Matrix can still deposit rational data content because providing minimum and highdensity label, therefore particularly suitable
Identified in finding, commodity counterfeit prevention, circuit identifier etc..Due to its outstanding error correcting capability, DM yards oneself turn into South Korea's mobile phone two dimension
The mainstream technology of bar code.For QR, DM yards few due to information capacity difference, using simple, is referred to as in the industry " simple
Code ", not high to demanding terminal, the mobile phone of 300,000 pixels just can recognize that, it is more the increment based on WAP.Quick Response Code is to hand
Machine online brings new entrance, and by scanning all kinds of bar codes, user will soon enter WAP site, carry out fast browsing.
Data Matrix symbols look like a chessboard being made up of two kinds of colors of the depth, each formed objects
Black or white boxes are referred to as a data unit, and Data Matrix symbols are exactly to be made up of many such data units.
Seek border area outer layer to have width is a dead zone for data unit.The border that border area is " chessboard " is sought, is served only for positioning and defining number
According to unit-sized, and any coding information is not contained.Coding information is included by the data field for seeking border area encirclement.
Mostly printed using Data Matrix in the prior art, scribed, photoetching, the mode, these modes such as burn into punching press
The RM of the Quick Response Code of generation is simpler, because the resolution at its edge is higher, but by the way of 3D printing, directly
Generation Quick Response Code, its identification edge is relatively obscured, it is more difficult to realize positioning, therefore, research one kind can be generated for 3D printing method
The Quick Response Code method that carries out zone location, have great importance.
The content of the invention
The technical problem to be solved in the present invention, is to provide a kind of feature extraction side based on Image neighborhood structure tensor equation
Method, the neighborhood border for determining Quick Response Code is calculated using the characteristic value of region-growing method and structure tensor, and each side is determined more respectively
The method in battery limit (BL) domain is simpler, and the border for determining is more accurate.
In order to solve the above technical problems, the technical solution used in the present invention is:
A kind of feature extracting method based on Image neighborhood structure tensor, is carried out according to following steps order:
1)Determine the lower boundary of Quick Response Code;
2)The extracted region carried out using region-growing method;
3)Characteristic value based on structure tensor is calculated;
4)Using least square method, three borders of other discrete to obtaining are fitted, and obtain final standard
Datamatix two-dimension code areas.
As a kind of restriction of the invention, described step 1)Carry out in the following order:
a)Calculate image centroid;
To the digital picture of a width two-dimensional discrete, its rank geometric moment is defined as:
;Wherein, p, q=0,1,2..., M, N are the width and height of image;
Then the computing formula of barycenter is:
;Wherein x0It is the abscissa of barycenter, y0It is the ordinate of barycenter;
b)The region of barycenter surrounding pixel is intercepted, and its gray histogram curve is calculated by the row of image array;
c)Obtain estimation region of the row where finding curve global minimum after histogram curve as Quick Response Code lower boundary;
d)Calculate the gradient of minimum region;
Image pixel horizontal directionGradient be:gx
Image pixel vertical directionGradient be:gy =
The gradient magnitude of image is:;
e)Gradient magnitude to being calculated carries out non-maxima suppression computing, obtains the local maximum of gradient;
f)The concavo-convex curve matching that will be made up of maximum of gradients using least square method is straight line, is calculated Quick Response Code
Lower boundary;Wherein, the object function J of least square method is:J()=min()。
As another restriction of the invention, described step 2)Carried out according to following steps order:
a)Growth starting point of the seed point as region is set;
b)Build similitude and judge criterion, by the region where there is the potting gum to sub-pixel of same nature with seed point
In;
c)The pixel that will be newly merged into is used as new seed point;
d)Repeat a)、b)And c)The iteration of algorithm is carried out, until not meeting step b)In conditional pixel be put together.
As the third restriction, described step 3 of the invention)Carried out according to following steps order:
a)Covariance matrix is built using the structure tensor of image;
b)The k gradient in direction of each pixel in image is calculated with gradient operator respectively, k gradient vector square is obtained
Battle array, the value of each point is corresponding pixel points Grad in this direction in original image in each matrix;
c)There is the Grad G in its corresponding k direction using each pixel in original image, then can obtain each picture in image
The neighborhood of element and the gradient in k direction of each neighborhood, if the matrix that the gradient that L is certain neighborhood of pixels is constituted:
L=, wherein i is the scope of neighborhood of pixels, and k is the gradient direction of neighborhood;
The gradient of the neighborhood of each pixel and the different directions of neighborhood is recycled, the structure tensor based on neighborhood region is constructed
Matrix J, then the structure tensor matrix J of each pixel be:
J=LT*L=;Wherein, LTIt is the transposition square of matrix L
Battle array;J is symmetrical matrix, using the property of covariance matrix, calculates the covariance matrix, can obtain k and not have correlation
Characteristic value, if the pixel is smooth region, k characteristic value is equal0。
d)The all pixels of traversing graph picture, calculate the structure tensor matrix of all pixels point, using structure tensor square respectively
The result of calculation of battle array characteristic value can extract the smooth region of image as similarity criterion, as Quick Response Code in itself where
Region.
The present invention also has a kind of restriction, and the object function of described least square method is:J()=min[]。
As a result of above-mentioned technical scheme, compared with prior art, acquired technological progress is the present invention:
The present invention calculates the neighborhood border for determining Quick Response Code using the characteristic value of region-growing method and structure tensor, determines more respectively
The method of each borderline region is simpler, and the border for determining is more accurate.
Extraction of the present invention suitable for two-dimension code area.
The present invention is described in further detail below in conjunction with Figure of description with specific embodiment.
Brief description of the drawings
Fig. 1 is step 1 in the embodiment of the present invention 1)Extract the schematic diagram of result;
Fig. 2 is step 3 in the embodiment of the present invention 1)Extract the schematic diagram of result;
Fig. 3 is step 4 in the embodiment of the present invention 1)Extract the schematic diagram of result.
Specific embodiment
A kind of feature extracting method based on Image neighborhood structure tensor of embodiment 1
A kind of feature extracting method based on Image neighborhood structure tensor, is carried out according to following steps order:
1)Determine the lower boundary of Quick Response Code;
a)Calculate image centroid;
To the digital picture of a width two-dimensional discrete, its rank geometric moment is defined as:
;Wherein, p, q=0,1,2..., M, N are the width and height of image;
Then the computing formula of barycenter is:
;Wherein x0It is the abscissa of barycenter, y0It is the ordinate of barycenter;
b)The region of barycenter surrounding pixel is intercepted, and its gray histogram curve is calculated by the row of image array;
c)Obtain estimation region of the row where finding curve global minimum after histogram curve as Quick Response Code lower boundary;
d)Calculate the gradient of minimum region;
Image pixel horizontal directionGradient be:gx
Image pixel vertical directionGradient be:gy =
The gradient magnitude of image is:;
e)Gradient magnitude to being calculated carries out non-maxima suppression computing, obtains the local maximum of gradient;
f)The concavo-convex curve matching that will be made up of maximum of gradients using least square method is straight line, is calculated Quick Response Code
Lower boundary, as shown in Figure 1;Wherein, the object function J of least square method is:J()=min()。
2)The extracted region carried out using region-growing method;
a)Growth starting point of the seed point as region is set;
b)Build similitude and judge criterion, by the region where there is the potting gum to sub-pixel of same nature with seed point
In;
c)The pixel that will be newly merged into is used as new seed point;
d)Repeat a)、b)And c)The iteration of algorithm is carried out, until not meeting step b)In conditional pixel be put together.
3)Characteristic value based on structure tensor is calculated;
a)Covariance matrix is built using the structure tensor of image;
b)The k gradient in direction of each pixel in image is calculated with gradient operator respectively, k gradient vector square is obtained
Battle array, the value of each point is corresponding pixel points Grad in this direction in original image in each matrix;
c)There is the Grad G in its corresponding k direction using each pixel in original image, then can obtain each picture in image
The neighborhood of element and the gradient in k direction of each neighborhood, if the matrix that the gradient that L is certain neighborhood of pixels is constituted:
L=, wherein i is the scope of neighborhood of pixels, and k is the gradient direction of neighborhood;
The gradient of the neighborhood of each pixel and the different directions of neighborhood is recycled, the structure tensor based on neighborhood region is constructed
Matrix J, then the structure tensor matrix J of each pixel be:
J=LT*L=;Wherein, LTIt is the transposition square of matrix L
Battle array;J is symmetrical matrix, using the property of covariance matrix, calculates the covariance matrix, can obtain k and not have correlation
Characteristic value, if the pixel is smooth region, k characteristic value is equal0。
d)The all pixels of traversing graph picture, calculate the structure tensor matrix of all pixels point, using structure tensor square respectively
The result of calculation of battle array characteristic value can extract the smooth region of image as similarity criterion, as Quick Response Code in itself where
Region, as shown in Figure 2.
4)Using least square method, three borders of other discrete to obtaining are fitted, and obtain final standard
Datamatix two-dimension code areas, as shown in Figure 3;Wherein, the object function of described least square method is:J()=min[]。
The present embodiment is applied to the extraction of two-dimension code area, is particularly suited for the Quick Response Code of 3D printing, when specifically used,
Quick Response Code identification sign is printed on dentognathic model, but due to the more common printing type Quick Response Code of the two-dimension code area of resin printing
Identification is more difficult, therefore in 3D printing dentognathic model, more accurate RM, the present embodiment is needed exist for for identification
The extracting method for being provided can effectively determine the identification border of Quick Response Code, facilitate follow-up Quick Response Code to recognize.
The above, is only presently preferred embodiments of the present invention, is not the restriction for making other forms to the present invention, is appointed
What those skilled in the art is changed as enlightenment possibly also with above-mentioned technology contents or is modified as equivalent variations
Equivalent embodiments.But, it is every without departing from the technology of the present invention design, above example is made according to technical spirit of the invention
The simple modification for going out, equivalent variations and remodeling, still fall within the protection domain of the claims in the present invention.