Elliptic object feature extraction method based on maximum entropy criterion
Technical Field
The invention relates to an object feature extraction method, in particular to an ellipse object feature extraction method based on the maximum entropy criterion.
Background
Ellipse fitting is an essential basic technique in image processing, and has been widely used in the fields of computer vision, astronomical observation, automated production, medical diagnosis, and the like. For example, iris is an important biological feature, iris recognition technology has important application in the fields of security, national defense, electronic commerce and the like, iris positioning is a primary task of iris recognition, and pupil images are in an elliptical shape due to relative movement of eyes and cameras, so that pupil areas can be determined by means of image processing technologies such as image threshold segmentation, edge detection, elliptical fitting and the like, and a foundation is laid for subsequent iris positioning, wherein elliptical fitting is a core technology for extracting iris features.
Currently, there are many basic methods for implementing ellipse fitting, such as Hough Transform (HT) and Least Squares (LS), etc. In the preprocessing process of data points required by ellipse fitting, due to specular reflection or object shielding and the like, the collected data points often introduce large noise, namely outliers, the outlier errors are usually far larger than edge data point errors, so that the ellipse fitting accuracy is obviously reduced, and therefore, the reduction of the influence of the outliers on the ellipse fitting is an urgent task.
Methods for mitigating the contribution of outliers to ellipse fitting have been widely focused and studied, and common outlier processing methods are data point sparse combination based methods and Weighted Least Squares (WLS) based methods. The data point sparse combination based method needs to assume that the upper error bound is known, and compared with the WLS based method, the WLS based method is more efficient and simpler and is more widely used. The robustness of the above two methods to outliers is not high enough, and both methods may fail in the presence of more outliers.
The concept of entropy has recently been successfully applied to non-linear, non-gaussian signal processing, particularly in impulse noise environments. Consideration of entropy can also be used to measure similarity between data points and true ellipses. Therefore, it is necessary to study a method that introduces the maximum entropy criterion into ellipse fitting to achieve ellipse object feature extraction and is robust to outliers.
Disclosure of Invention
The invention aims to solve the technical problem of providing an ellipse object feature extraction method based on the maximum entropy criterion, which introduces a weight for each edge data point in the ellipse fitting process, utilizes the robustness of a norm, improves the ellipse fitting precision, and further determines the position feature of an ellipse object according to the fitted high-precision ellipse.
The technical scheme adopted for solving the technical problems is as follows: an ellipse object feature extraction method based on the maximum entropy criterion is characterized by comprising the following steps:
step 1: photographing the elliptical object to obtain a picture; then preprocessing the picture by adopting morphological operation to obtain a preprocessed picture; detecting all edge data points including the wild value from the preprocessed picture by adopting an edge detection technology, and setting the number of the detected edge data points including the wild value as N; wherein N is a positive integer, and N is more than or equal to 5;
step 2: in the preprocessed picture, the abscissa of N edge data points including the outlier is correspondingly marked as x 1 ,x 2 ,…,x N And corresponding the ordinate of the N edge data points including the wild value as y 1 ,y 2 ,…,y N The method comprises the steps of carrying out a first treatment on the surface of the And setting the general equation of the ellipse to be solved corresponding to the ellipse-shaped object part in the preprocessed picture as Ax 2 +Bxy+Cy 2 +dx+ey+f=0; wherein x is 1 And y 1 X corresponds to the abscissa and ordinate representing the 1 st edge data point 2 And y 2 X corresponds to the abscissa and ordinate representing the 2 nd edge data point N And y N Corresponding to an abscissa and an ordinate representing an nth edge data point, x represents an abscissa of any point on an ellipse to be solved corresponding to an ellipse-shaped object part in the preprocessed picture, y represents an ordinate of any point on the ellipse to be solved corresponding to the ellipse-shaped object part in the preprocessed picture, and A, B, C, D, E, F is 6 parameters in a general equation of an ellipse to be solved corresponding to the ellipse-shaped object part in the preprocessed picture;
step 3: describing algebraic distance between an ellipse to be solved corresponding to an ellipse-like object part in the preprocessed picture and each edge data point in a model mode, and describing a model of algebraic distance between the ellipse to be solved corresponding to the ellipse-like object part in the preprocessed picture and the ith edge data point as p T u i The method comprises the steps of carrying out a first treatment on the surface of the Wherein i is a positive integer, i is more than or equal to 1 and less than or equal to N, p represents a parameter vector, and p= [ A, B, C, D, E and F] T ,u i Representing the i-th vector of edge data points,x i and y i Corresponding to the abscissa and ordinate representing the ith edge data point, the superscript "T" represents the transpose of the matrix or vector;
step 4: using maximum entropy criterion, p T u i Conversion to kappa σ (p T u i ) The method comprises the steps of carrying out a first treatment on the surface of the Then according to kappa σ (p T u i ) The optimization problem based on the maximum entropy criterion is obtained and described as:wherein, kappa σ () Representing the laplace kernel function,σ represents the kernel bandwidth in the laplace kernel function, the value of σ being according to Silverman's criterion σ=1.06×min (σ E ,R/1.34)×N -0.2 Determining min () as minimum function, sigma E Is p T u i R is p T u i E represents a natural radix, the symbol "||" is the absolute value symbol, max () is the maximum function, "s.t." means "constrained to … …", the symbol "||||" is a euclidean distance symbol, P is p 1 、p 2 、p 3 Corresponding to the 1 st element, the 2 nd element and the 3 rd element in p, namely p 1 Is A, p 2 B, p of a shape of B, p 3 Is C;
step 5: according to the nature of the convex conjugate function: there is a primitive function f (α) =e -α The corresponding convex conjugate function satisfiesFor a fixed α, taking the maximum when w= -f (α), the optimization problem based on the maximum entropy criterion is translated into the following form: />Wherein f () is a function expression form, f (α) is an original function, α is an unknown variable of the original function f (α), φ (w) is a convex conjugate function corresponding to the original function f (α), w represents a weight vector, w i Represents the i-th element in w, phi (w i ) Representing a convex conjugate function corresponding to the original function with the ith element of alpha as an unknown variable;
step 6: will beThe decomposition is into two sub-problems, one described as:the second sub-problem is described as: />Wherein, min () is a function taking the minimum value;
step 7: the first sub-problem is rewritten into an upper mirror diagram form, and a standard second-order cone planning problem is obtained, which is described as follows:then introducing a constant ε and imposing a constraint p 2 Is numbered with epsilon to make constraint condition [ p ] 2 ,p 1 -p 3 ] T ||<p 1 +p 3 Strictly, a solution model for converting a second order cone programming problem into a first sub-problem is described as:wherein τ represents |p T u i Upper bound of i, τ i Represents the i-th element in tau, epsilon being a non-zero constant;
step 8: according to the nature of the convex conjugate function: for a fixed α, taking the maximum when w= -f (α), determine that the sub-problem two has a closed-form solution:
step 9: solving p in an iterative mode, wherein the specific process is as follows:
step 9_1: let t represent the iteration number, the initial value of t is 1;
step 9_2: in the t-th iteration process, epsilon respectively takes a positive constant and a negative constant with the same absolute value, and constrains p 2 The same number as epsilon; then, respectively taking a constant with the same positive and negative absolute values from epsilon by using a CVX tool box in matlab softwareSolving the solution model of the problem I to obtain two corresponding p values; taking the value of p with small objective function as the value of p after the t-th iteration; in the process of solving the solving model of the first sub-problem, the initial value of the weight vector w is a unit vector;
step 9_3: substituting the value of p after the t iteration into a formula of a closed solution of the second sub-problem to obtain the value of the weight vector w after the t iteration, namely updating the weight vector w;
step 9_4: let t=t+1, then return to step 9_2 to continue execution until ||p is satisfied (t) -p (t-1) || 2 <10 -5 Ending the iterative process to obtain p (t) As the final solution of p, the value of A, B, C, D, E, F is obtained; wherein "=" in t=t+1 is an assignment symbol, p (t) Represents the value of p after the t-th iteration, p (t-1) The value of p after the t-1 th iteration is indicated, sign' I 2 "means a binary norm symbol;
step 10: and converting the value of A, B, C, D, E, F to obtain the circle center, the long axis, the short axis and the inclination angle of the ellipse to be solved, which correspond to the ellipse-shaped object part in the preprocessed picture, fitting to obtain the ellipse corresponding to the ellipse-shaped object part in the preprocessed picture, and further determining the position of the ellipse-shaped object, namely extracting to obtain the position characteristics of the ellipse-shaped object.
Compared with the prior art, the invention has the advantages that:
according to the method, a maximum entropy criterion is introduced into an elliptical object feature extraction process, a nonlinear non-convex problem (an optimization problem based on the maximum entropy criterion) is obtained, each edge data point is provided with corresponding weight through the property of a convex conjugate function, then the problem containing the weight is decomposed into two sub-problems, the first sub-problem can be converted into a standard second-order cone planning problem, the second sub-problem is provided with a closed solution, the first sub-problem and the second sub-problem in the second-order cone planning form are solved in an iterative mode, parameters in an elliptical general equation are obtained, compared with the existing elliptical object feature extraction method, the method disclosed by the invention is used for applying the Laplace kernel function to elliptical fitting for the first time, the advantages of the maximum entropy criterion and the first norm are combined, a new scheme for ensuring that the estimated parameters can form an ellipse is deduced, the first sub-problem can be converted into the standard second-order cone planning form, the second sub-problem is provided with a closed solution, the second sub-problem can be ensured to be converged to local optimum even if the method cannot be converged to the global optimum, and the elliptical object feature fitting method is still good in performance under the condition that a large number of wild values exists, and elliptical object feature fitting accuracy is still determined.
Drawings
FIG. 1 is a block diagram of a general implementation of the method of the present invention;
FIG. 2a is an edge data point obtained by processing a selected 1 st picture (including an elliptical object);
FIG. 2b is an edge data point obtained by processing the selected 2 nd picture (including elliptical objects);
FIG. 2c is an edge data point obtained by processing the 3 rd selected picture (including elliptical objects);
FIG. 2d is an edge data point obtained by processing the 4 th selected picture (including elliptical objects);
FIG. 2e is an edge data point obtained by processing the 5 th selected picture (including elliptical objects);
FIG. 2f is an edge data point obtained by processing the 6 th selected picture (including elliptical objects);
FIG. 3a is an ellipse fitted using the edge data points of FIG. 2a using the method of the present invention;
FIG. 3b is an ellipse obtained by using the MCC-Gaussian method and fitting the edge data points of FIG. 2 a;
FIG. 3c is an ellipse fitted using the ADMM method and using the edge data points of FIG. 2 a;
FIG. 3d is an ellipse fitted using the RANSAC method and using the edge data points of FIG. 2 a;
FIG. 3e is an ellipse fitted using the SAREfit method and using the edge data points of FIG. 2 a;
FIG. 3f is an ellipse fitted using the Munoz method and using the edge data points of FIG. 2 a;
FIG. 4a is an edge data point obtained by processing a selected 1 st picture (including coupled elliptical objects);
FIG. 4b is an edge data point obtained by processing the selected 2 nd picture (including coupled elliptical objects);
FIG. 5a is an ellipse fitted using the edge data points of FIG. 4a using the method of the present invention;
FIG. 5b is an ellipse fitted using the WLS method and using the edge data points of FIG. 4 a;
FIG. 5c is an ellipse fitted using the edge data points of FIG. 4b using the method of the present invention;
fig. 5d is an ellipse fitted using WLS method and using the edge data points in fig. 4 b.
Detailed Description
The invention is described in further detail below with reference to the embodiments of the drawings.
The invention provides an ellipse object feature extraction method based on the maximum entropy criterion, the general implementation block diagram of which is shown in figure 1, comprising the following steps:
step 1: photographing the elliptical object to obtain a picture; then preprocessing the picture by adopting the existing morphological operation to obtain a preprocessed picture; detecting all edge data points including the wild value from the preprocessed picture by adopting the existing edge detection technology, and setting the number of the detected edge data points including the wild value as N; wherein N is a positive integer, and the larger N is larger than or equal to 5,N, the higher the calculation complexity is.
Here, noise of the picture can be removed through morphological operation, and the edge effect of the picture is enhanced, so that subsequent edge detection is facilitated; in the edge detection technique, if the threshold is set relatively large, the number of detected edge data points is relatively small, but in the invention, a minimum of 5 edge data points are needed.
Step 2: in the preprocessed picture, N pieces of edge data including wild valuesThe abscissa of the point is correspondingly noted as x 1 ,x 2 ,…,x N And corresponding the ordinate of the N edge data points including the wild value as y 1 ,y 2 ,…,y N The method comprises the steps of carrying out a first treatment on the surface of the And setting the general equation of the ellipse to be solved corresponding to the ellipse-shaped object part in the preprocessed picture as Ax 2 +Bxy+Cy 2 +dx+ey+f=0; wherein x is 1 And y 1 X corresponds to the abscissa and ordinate representing the 1 st edge data point 2 And y 2 X corresponds to the abscissa and ordinate representing the 2 nd edge data point N And y N Corresponding to the abscissa and ordinate representing the nth edge data point, x represents the abscissa of any point on the ellipse to be solved corresponding to the ellipse-like object part in the preprocessed picture, y represents the ordinate of any point on the ellipse to be solved corresponding to the ellipse-like object part in the preprocessed picture, and A, B, C, D, E, F is 6 parameters in the general equation of the ellipse to be solved corresponding to the ellipse-like object part in the preprocessed picture.
Step 3: describing algebraic distance between an ellipse to be solved corresponding to an ellipse-like object part in the preprocessed picture and each edge data point in a model mode, and describing a model of algebraic distance between the ellipse to be solved corresponding to the ellipse-like object part in the preprocessed picture and the ith edge data point as p T u i The method comprises the steps of carrying out a first treatment on the surface of the Wherein i is a positive integer, i is more than or equal to 1 and less than or equal to N, p represents a parameter vector, and p= [ A, B, C, D, E and F] T ,u i Representing the i-th vector of edge data points,x i and y i The superscript "T" represents the transpose of the matrix or vector, corresponding to the abscissa and ordinate representing the ith edge data point, and the algebraic distance between the ellipse and the point on the ellipse is zero.
Step 4: using maximum entropy criterion, p T u i Conversion to kappa σ (p T u i ) The method comprises the steps of carrying out a first treatment on the surface of the Then according to kappa σ (p T u i ) Obtaining optimization problem based on maximum entropy criterionThe description is as follows:wherein, kappa σ () Representing the laplace kernel function,σ represents the kernel bandwidth in the laplace kernel function, the value of σ is according to the existing Silverman's criterion σ=1.06×min (σ E ,R/1.34)×N -0.2 Determining min () as minimum function, sigma E Is p T u i R is p T u i E represents a natural radix, e=2.17 …, the symbol "||" is an absolute value symbol, max () is a maximum function, "s.t." means "constrained to … …", the symbol "||||" is a euclidean distance symbol, P is p 1 、p 2 、p 3 Corresponding to the 1 st element, the 2 nd element and the 3 rd element in p, namely p 1 Is A, p 2 B, p of a shape of B, p 3 Is C.
Other kernel functions may be used here, but the use of the laplace kernel function works best in the present invention.
Step 5: according to the nature of the convex conjugate function: there is a primitive function f (α) =e -α The corresponding convex conjugate function satisfiesFor a fixed α, taking the maximum when w= -f (α), the optimization problem based on the maximum entropy criterion is translated into the following form: />Wherein f () is a function expression form, f (α) is an original function, α is an unknown variable of the original function f (α), φ (w) is a convex conjugate function corresponding to the original function f (α), w represents a weight vector, w i Represents the i-th element in w, phi (w i ) Representing the convex conjugate function corresponding to the original function with the i element of alpha as the unknown variable.
Step 6: will beThe decomposition is into two sub-problems, one described as:the second sub-problem is described as: />Wherein, min () is a function taking the minimum value.
Step 7: the first sub-problem is rewritten into an upper mirror diagram form, and a standard second-order cone planning problem is obtained, which is described as follows:then introducing a constant ε and imposing a constraint p 2 Is numbered with epsilon to make constraint condition [ p ] 2 ,p 1 -p 3 ] T ||<p 1 +p 3 Strictly, a solution model for converting a second order cone programming problem into a first sub-problem is described as:wherein τ represents |p T u i Upper bound of i, τ i Represents the i-th element in τ, ε is a non-zero constant.
Step 8: according to the nature of the convex conjugate function: for a fixed α, taking the maximum when w= -f (α), determine that the sub-problem two has a closed-form solution:
step 9: solving p in an iterative mode, wherein the specific process is as follows:
step 9_1: let t denote the number of iterations, the initial value of t being 1.
Step 9_2: in the t-th iteration process, epsilon respectively takes a positive constant and a negative constant with the same absolute value, and constrains p 2 The same number as epsilon; then, the CVX toolbox in matlab software is adopted to respectively take one positive and one negative with the same absolute value as the constant for epsilonSolving the solving model to obtain two corresponding p values; taking the value of p with small objective function as the value of p after the t-th iteration; in the process of solving the solving model of the first sub-problem, the initial value of the weight vector w is a unit vector.
Step 9_3: substituting the value of p after the t iteration into a formula of a closed solution of the second sub-problem to obtain the value of the weight vector w after the t iteration, namely updating the weight vector w.
Step 9_4: let t=t+1, then return to step 9_2 to continue execution until ||p is satisfied (t) -p (t-1) || 2 <10 -5 Ending the iterative process to obtain p (t) As the final solution of p, the value of A, B, C, D, E, F is obtained; wherein "=" in t=t+1 is an assignment symbol, p (t) Represents the value of p after the t-th iteration, p (t-1) The value of p after the t-1 th iteration is indicated, sign' I 2 "means a two-norm symbol.
Step 10: the circle center, the long axis, the short axis and the inclination angle of the ellipse to be solved, which correspond to the ellipse-shaped object part in the preprocessed picture, are obtained through the value conversion of A, B, C, D, E, F, the ellipse corresponding to the ellipse-shaped object part in the preprocessed picture is obtained through fitting, and then the circle center, the long axis, the short axis and the inclination angle of the ellipse-shaped object part of the ellipse-shaped object are obtained, the position of the ellipse-shaped object is determined, and the position characteristics of the ellipse-shaped object are obtained through extraction.
To verify the feasibility and effectiveness of the method of the invention, the method of the invention was tested.
Six pictures containing an elliptical object were randomly selected from the 256 reference dataset of the california institute of technology. The six pictures are respectively processed by adopting the method and the existing five ellipse fitting methods, and the performance comparison is carried out. The five ellipse fitting methods available are J.Liang, Y.Wang, and X.Zeng, robust ellipse fitting via half-quadratic and semidefinite relaxation optimization (robust ellipse fitting based on semi-quadratic technique and semi-definite programming), IEEE Transactions on Image Processing [ J]2015 24 (11): 4276-4286 (abbreviated MCC-Gauss herein)ian), J.Liang, P.Li, and D.Zhou, robust ellipse fitting via alternating direction method of multipliers (robust ellipse fitting based on alternate direction multiplier method) [ Signal Processing [ J]2019 164 (2) 30-40 (abbreviated herein as ADMM), M.A.Fischler, R.C.Bolles.Random sample presentation A paradigm for model fitting with applications to image analysis and automated cartography (random sample consensus: a model fitting paradigm employing image analysis and automatic mapping). Communications. ACM [ J ]]1981 24 (6): 381-395 (abbreviated herein as RANSAC), K.Thurn hofer-Hemsi et al Ellipse fitting by spatial averaging of random ensembles (random set space average ellipse fitting) [ Pattern Recognition [ J ]]2020:107406 (abbreviated herein as SAREfit), J.J.Perez, O.D. de Cd zar-Maci as, E.B. Bl zquez-Parra, et al Multicriteria robust fitting of elliptical primitives (Multi-criterion robust ellipse fitting) Journal of Mathematical Imaging&Vision[J]2014 49 (2): 492-509 (abbreviated herein as Munoz).
In the method of the invention, the constant epsilon can take any value, epsilon=0.01 and epsilon= -0.01 are taken in each iteration process, and the initial value of the weight vector is taken as a unit vector.
Fig. 2a is an edge data point obtained by processing the selected 1 st picture, fig. 2b is an edge data point obtained by processing the selected 2 nd picture, fig. 2c is an edge data point obtained by processing the selected 3 rd picture, fig. 2d is an edge data point obtained by processing the selected 4 th picture, fig. 2e is an edge data point obtained by processing the selected 5 th picture, and fig. 2f is an edge data point obtained by processing the selected 6 th picture.
Since there are more pictures of the fitting results, only the fitting results for the edge data points shown in fig. 2a are given here. FIG. 3a is an ellipse fitted using the edge data points of FIG. 2a using the method of the present invention; FIG. 3b is an ellipse obtained by using the MCC-Gaussian method and fitting the edge data points of FIG. 2 a; FIG. 3c is an ellipse fitted using the ADMM method and using the edge data points of FIG. 2 a; FIG. 3d is an ellipse fitted using the RANSAC method and using the edge data points of FIG. 2 a; FIG. 3e is an ellipse fitted using the SAREfit method and using the edge data points of FIG. 2 a; fig. 3f is an ellipse fitted using the Munoz method and using the edge data points in fig. 2 a. Comparing fig. 3a with fig. 3b to fig. 3f, it can be seen that the method of the present invention can accurately fit an ellipse, which is sufficient to prove that the method of the present invention has excellent performance and superiority in terms of challenge values.
The method is expanded to coupling ellipse fitting, and the performance of the method in a scene with coupling ellipse-shaped objects is tested. Two pictures containing coupled elliptical objects are randomly selected in 256 reference data sets of the california academy of engineering, and the two pictures are respectively processed by adopting the method and the existing weighted least squares method (called WLS for short) and are subjected to performance comparison.
Fig. 4a is an edge data point obtained by processing the selected 1 st picture, and fig. 4b is an edge data point obtained by processing the selected 2 nd picture. FIG. 5a is an ellipse fitted using the edge data points of FIG. 4a using the method of the present invention; FIG. 5b is an ellipse fitted using the WLS method and using the edge data points of FIG. 4 a; FIG. 5c is an ellipse fitted using the edge data points of FIG. 4b using the method of the present invention; fig. 5d is an ellipse fitted using WLS method and using the edge data points in fig. 4 b. Because the method introduces the maximum entropy criterion and the robustness of a norm to the outlier, the method has better performance than the existing weighted least square method (called WLS for short) under the condition of the outlier, and has better overall effect.
The method of the present invention introduces the maximum entropy criterion into the ellipse fitting and uses a more robust norm in the kernel function. Each edge data point has corresponding weight through the property of the convex conjugate function, the farther the edge data point is from the ellipse, the smaller the weight is, and the contribution of the wild value to ellipse fitting is reduced. In addition, the method of the invention makes constraint || [ p ] through establishing second order cone constraint 2 ,p 1 -p 3 ] T ||<p 1 +p 3 The method is strictly established, ensures that the parameters are related to ellipses, and at least converges the problems to local optimum, and shows that the method has good performance in different environments.