A method, device, medium and system for accurately extracting target corner points
By setting the quasi-likelihood function in the computer and using Bayesian variable selection and EM algorithms, the problem of the semantic segmentation model being unable to extract the precise location of feature points in the image is solved, and the accuracy of SLAM pose estimation is improved, combining semantics The segmentation model is provided for SLAM pose estimation, which solves the problem of limited accuracy of SLAM pose estimation in the existing technology.
Patent Information
- Application Number
- CN202410797355.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-06-20
AI Technical Summary
In the existing technology, semantic segmentation models cannot directly extract the precise locations of feature points in images, resulting in limited accuracy of SLAM pose estimation.
By setting a quasi-likelihood function in the computer, Bayesian variable selection and EM algorithm are used to perform iterative calculations to complete the completion of pixel points, thereby accurately extracting the corner position of the target object, combined with the binary map of the semantic segmentation model, Provided for SLAM pose estimation.
It achieves the organic combination of semantic segmentation and SLAM pose estimation, improves the accuracy of SLAM pose estimation, and can extract the precise location of feature points in the image under the influence of noise.
Smart Images

Figure CN118364209B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual SLAM pose estimation, and more specifically, to a method, device, medium and system for accurately extracting target corner points. Background Art
[0002] Visual SLAM pose estimation can provide the camera's current position and pose relative to the target object based on the information extracted from the image. The most critical part of this method is that it requires the precise position of the feature points of the target object in the image.
[0003] In the prior art, the semantic segmentation model can achieve the effect of segmenting the target object in the image by training the neural network on the object. However, it is not sensitive to the feature points of the target object, and the precise position of the feature points in the image cannot be directly obtained through the semantic segmentation model. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a method, device, medium and system for accurately extracting target corner points, extracting the positions of feature points from a binary image obtained by a semantic segmentation model, and providing the positions of the feature points to SLAM pose estimation, thereby completing the organic combination of semantic segmentation and SLAM pose estimation.
[0005] The object of the present invention is achieved through the following solutions:
[0006] A method for accurately extracting target corner points comprises the following steps:
[0007] Setting a quasi-likelihood function in a computer;
[0008] After setting the quasi-likelihood function, the probability of each pixel being identified as a target object is used to iterate its value, thereby completing the missing pixel completion;
[0009] After completing the pixels, the precise corner position of the target object in the image is calculated to obtain accurate SLAM pose estimation.
[0010] Furthermore, the setting of the quasi-likelihood function in the computer specifically includes the following sub-steps: the setting of the quasi-likelihood function is based on the characteristics of the target object, each pixel point is surrounded by eight points, and the complex characteristics of the object are ignored at the pixel level.
[0011] Furthermore, the probability of each pixel being identified as a target object is used to iterate its value, thereby completing the missing pixel completion. Specifically, iterative calculation based on Bayesian variable selection and EM algorithm is used to complete the missing pixel completion.
[0012] Furthermore, the setting of the quasi-likelihood function is based on the characteristics of the target object. Each pixel is surrounded by eight points, and the complex features of the object are ignored at the pixel level. The specific sub-steps are as follows: assuming that an object is a square, when the eight surrounding points are all 1, that is, it belongs to the target object, the pixel is an inner point; when the eight points have the same value only in the horizontal or vertical rows, the pixel is an edge point; when three of the eight points are connected and not in a row or column and the value is 1, the pixel is a corner point; when there are missing pixels at the edge of the semantically segmented image, other situations will inevitably occur, and penalties will be imposed on it at this time; the loss function for the value of each pixel is set according to the appearance characteristics of the target object to complete the setting of the quasi-likelihood function.
[0013] A computer device comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is loaded by the processor, any of the above methods is executed.
[0014] A readable storage medium stores a computer program, wherein the computer program executes any of the above methods when loaded by a processor.
[0015] A target corner point accurate extraction system includes the computer device as described above.
[0016] The beneficial effects of the present invention include:
[0017] The present invention proposes a method for accurately extracting target corner points based on Bayesian variable selection, extracts the positions of feature points in a binary image obtained by a semantic segmentation model, and provides the positions of the feature points to SLAM pose estimation, thereby completing the organic combination of semantic segmentation and SLAM pose estimation. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0019] Figure 1 is a normal distribution with different variances;
[0020] Figure 2 are double exponential distributions with different variances. DETAILED DESCRIPTION
[0021] All features disclosed in all embodiments in this specification, or steps in all methods or processes implicitly disclosed, except for mutually exclusive features and / or steps, can be combined and / or expanded or replaced in any manner.
[0022] In view of the problems in the background, the inventors of the present invention have conducted continuous thinking and believe that the semantic segmentation model is a pixel-level classification model, which scores each pixel in the image and then connects the pixels with higher scores. Such a result intuitively looks like the general shape of the target, but in actual applications, due to the influence of noise such as weather, its boundaries are often uneven, which makes it impossible to extract boundaries using general boundary extraction algorithms.
[0023] In order to solve the above technical problems, in the embodiment of the present invention, the specific implementation process is as follows: each pixel in the image is regarded as a variable. Assuming that the image pixel is 1920*1080, there are 2073600 variables to be examined. Each pixel takes the value of 0 and 1 depending on whether it is judged to be within the target. The image output by the semantic segmentation is a binary image, which is equivalent to providing an initial value in each pixel. In a further conception, a quasi-likelihood function setting step is included. After the quasi-likelihood function is set, the value of each pixel is iterated by affecting the probability of each pixel being identified as a target object, thereby completing the completion of the missing pixels. After the pixels are completed, the precise corner position of the target object in the image can be given, thereby obtaining accurate SLAM pose estimation.
[0024] In a specific implementation, the embodiment of the present invention completes the setting of the quasi-likelihood function in a computer, and the specific inventive concept is as follows: depending on the characteristics of the target object, each pixel is surrounded by eight points, and the complex features of the object can be ignored at the pixel level. Assuming that an object is square, when the eight surrounding points are all 1, that is, it belongs to the target object, the pixel is an inner point; when the eight points have the same value only in the horizontal or vertical rows, the pixel is an edge point; when three of the eight points are connected and not in a row or column and the value is 1, the pixel is a corner point. When there are missing pixels at the edge of the semantically segmented image, other situations will inevitably occur, and a larger penalty can be imposed on it. The loss function for the value of each pixel point is set according to the shape characteristics of the target object to complete the setting of the quasi-likelihood function.
[0025] In the specific implementation, the embodiment of the present invention utilizes the Bayesian variable selection method. The Bayesian variable selection method is a method suitable for screening massive data. Bayesian variable selection requires the construction of a reasonable Bayesian framework, and the specific construction method is as follows:
[0026] Assumed coefficient The indicator variable is , each indicator variable has only two values. When the mth explanatory variable is included in the regression model, its corresponding indicator variable takes the value of 1, otherwise it takes the value of 0. Therefore, the total number of indicator variables is subspaces, and Bayesian variable selection is to select the optimal result in these subspaces.
[0027] Examining the prior distribution of coefficients, coefficients In the indicator variable The distributions obeyed under different values (0 and 1) are different. Generally, it is assumed that these two distributions belong to the same type of distribution, with a mean of 0, and the difference is only reflected in the variance. When the variable is selected into the model, that is, when the indicative variable takes 1, the variance of the prior distribution it obeys will be larger. Similarly, when the variable is screened out, the variance of the prior distribution it obeys will be smaller. This prior distribution is also called the "spike-and-slab" prior, which makes the screened variables fluctuate slightly around 0. In fact, unless the explained variable is an unchanging constant, the regression coefficient cannot be truly 0. It will also fluctuate in a small range around 0, which is similar to Bayes' assumption.
[0028] The distribution of the overall prior distribution has a certain impact on the regression results, assuming it is a normal distribution. The prior distribution of can be expressed as:
[0029] (1)
[0030] in is a hyperparameter and In the “spike-and-slab” distribution, the variance is The distribution of is also called the "slab distribution"; and the equation is The distribution of is a “spike” distribution.
[0031] In order to more intuitively examine the effect that the “spike-and-slab” prior distribution can bring, the embodiments of the present invention respectively take , the corresponding normal distribution is shown in the figure, see Figure 1 . It can be seen intuitively that the larger the variance, the lower the probability of its value being near 0. This makes it easier for variables with smaller coefficients in a regression to fall into the range of the screened variables, that is, the "spike" distribution, so that the parameter is judged as a variable with less influence on the explanatory variable, while variables with larger regression coefficients are more likely to fall into the "slab" distribution, which is also the variable that we need to find out that has a greater influence on the explanatory variable, and this is also the significance of variable selection.
[0032] In addition to the normal distribution, many scholars tend to choose the double exponential distribution as the prior distribution of the parameter, namely:
[0033] (2)
[0034] in is a hyperparameter and For comparison, the embodiments of the present invention also take , put the double exponential prior distribution under two variances on the same graph for display, see Figure 2 . It can be seen that the "spike-and-slab" prior distribution can also achieve the effect of variable selection, and compared with the case where the prior distribution is a normal distribution, the "spike" distribution of the double exponential distribution is more "sharp", which makes it more rigorous in the process of screening out irrelevant variables. However, there are gains and losses. Although the variables screened out using the double exponential prior distribution are fewer than those screened out using the normal prior distribution, they are also more credible.
[0035] After obtaining the "spike-and-slab" prior distribution of the parameter, we will continue to discuss the prior distribution of other parameters. For ease of representation, assume , the probability density function of the coefficient is:
[0036] (3)
[0037] Assume that the indicator variable The probability of taking 1 is ,but The prior distribution of is a Bernoulli distribution with parameters The prior distribution of adopts the method of non-information prior, assuming a uniform distribution between 0 and 1. It is expressed as follows:
[0038] (4)
[0039] (5)
[0040] At this point, the framework of Bayesian variable selection is completed.
[0041] It can be seen that the framework examines three parameters, namely: coefficient , the coefficient of the indicator variable and the probability that the indicator variable takes 1 .
[0042] In the embodiment of the present invention, it is assumed that the quasi-likelihood function of the model to be investigated is , after taking the logarithm, Combining the Bayesian framework, the posterior probability distribution can be obtained as:
[0043] (6)
[0044] In this posterior distribution, is known, is a hyperparameter. The coefficients to be examined are: the probability of a certain explanatory variable being selected into the regression model , an explanatory variable is selected as an indicator variable in the regression model and the coefficient of the explanatory variable .variable is an unobservable variable whose value depends on After creative thinking, the inventors of the embodiments of the present invention believe that this makes the EM algorithm very effective in solving this problem.
[0045] Therefore, the embodiment of the present invention contemplates first taking the logarithm of the posterior probability distribution:
[0046] (7)
[0047] The unknown parameters are , , , it is very inconvenient to directly calculate the maximum likelihood estimation of the parameters. This is because the three parameters cannot be separated during the optimization process. The embodiment of the present invention uses the EM algorithm to solve this problem well. The EM algorithm converts the indicative variables It is regarded as a hidden variable and the convergence result is obtained through step-by-step iteration. The iterative steps are divided into E-step expectation and M-step maximum likelihood estimation, which specifically include the following steps:
[0048] Step E: Find the expectation
[0049] When considering the u+1th iteration, the hidden variable Assume that the result of the u-th iteration is , , ,make . Through the Bayesian formula, we can conclude that:
[0050] (8)
[0051] Find hidden variables After the expectation, the parameters in the original function becomes a constant, and The related expectations can also be solved through the iteration results of the previous step. After the expectation, we proceed to step M and find the parameters by iteration. and The optimal solution of .
[0052] M step: find the maximum likelihood estimate
[0053] For equation (8), find the hidden variable The expectation of , we get the Q function:
[0054] (9)
[0055] in, , C is a constant term.
[0056] Formula (9) can be decomposed into: . Using the idea of coordinate descent method, we can optimize and The process can be separated by maximizing Functions and The function gets the parameters. The optimization process of Function about A component of Derivative:
[0057] (10)
[0058] because , about The second-order derivative must be less than 0. We only need to set the first-order derivative to 0 to get the optimal solution. The solution is: .
[0059] Next, through Function to optimize parameters . The function is:
[0060] (11)
[0061] At this point, we can see The function form is similar to lasso regression, but there are some differences. The difference is that the coefficient of the penalty term is inconsistent with the general lasso. The general lasso problem solution is that all parameters share a coefficient, and then adjust the coefficient. This is equivalent to setting a standard for all parameters, and filtering out those below this standard.
[0062] Formula (11) is not the final result, because the parameters cannot be directly obtained. The embodiment of the present invention uses the Newton-Raphson iteration method to obtain the optimal solution of the parameter The result of the u+1th optimization includes the following steps:
[0063] When the optimization function is a convex function and its form is relatively complex, the Newton-Raphson iteration method is a more efficient method. The optimization result of The results of the previous iteration Performing the second-order Taylor approximation, we get function:
[0064] (12)
[0065] At this time, the optimization problem is transformed into:
[0066] (13)
[0067] The optimization function is about Take the derivative and set it to 0. Since there is an absolute value in the formula, for each component Classification discussion is needed:
[0068] like ,but:
[0069]
[0070] like ,but:
[0071]
[0072] In summary, we can get The u+1th optimization result is:
[0073] (14)
[0074] in is the threshold function:
[0075]
[0076] If the parameter The prior distribution of is taken as normal distribution, and it is easy to get:
[0077] (15)
[0078] When the second-order derivative is 0, the optimization by Newton iteration method will be wrong. In fact, when all explanatory variables are standardized, the probability of this happening is very small, unless the explanatory variable is a constant. Therefore, the embodiment of the present invention will first eliminate all explanatory variables with fixed values before iteration. If the second-order derivative is still 0 during the iteration process, the countermeasure of the embodiment of the present invention is to keep the parameter as the value of the previous step.
[0079] The optimization process of each parameter has been derived so far. Next, the optimization processes of these parameters are combined together through the idea of coordinate descent method to form a complete set of optimization processes.
[0080] The core idea of the coordinate descent method is to optimize many different parameters in batches. In the process of optimizing some parameters, other parameters are fixed as the results of the previous step. In the embodiment of the present invention, the idea of the coordinate descent method is used to optimize the parameters first. , and then optimize the parameters Combined with the E step to find the indicative variable The expectation of the entire iteration process is:
[0081] (1) Standardization of explanatory variables;
[0082] (2) Select initial value , ;
[0083] (3) Update once using the Newton-Raphson iteration method ;
[0084] (4) Through (15), we can get , and then update it once ;
[0085] (5) Repeat steps (3) and (4) until the number of The sum of the squares of the differences is less than a preset value.
[0086] So far, the Bayesian variable selection based on the EM algorithm and the steps of implementing it by using the coordinate descent method conceived in the embodiment of the present invention have been completed. For a general binary classification model, it is only necessary to substitute its likelihood function into its framework.
[0087] The specific implementation of the present invention is not limited to the above-mentioned methods. The above description is only the preferred embodiment of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. It is possible for those skilled in the art to make various obvious changes, adjustments and substitutions without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may also include more other equivalent embodiments without departing from the principles and concepts of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for accurately extracting target corner points. It is characterized in that The following steps are involved: A quasi-likelihood function is set in a computer; the setting of the quasi-likelihood function is determined according to the characteristics of the target object, and each pixel point is surrounded by eight points, and the complex characteristics of the object are ignored at the pixel level; assuming that a certain object is a square, when the eight surrounding points are all 1, that is, it belongs to the target object, the pixel point is an inner point; when the eight points have the same value only in the horizontal or vertical rows, the pixel point is an edge point; when three of the eight points are connected and not in a row or a column and the value is 1, the pixel point is a corner point; when there are missing pixels on the edge of the semantically segmented image, other situations will inevitably occur, and penalties will be imposed on it at this time; the loss function of each pixel point value is set according to the shape characteristics of the target object to complete the setting of the quasi-likelihood function; After setting the quasi-likelihood function, the probability of each pixel being identified as a target object is used to iterate its value, thereby completing the missing pixels. Specifically, the missing pixels are completed by iterative calculation based on Bayesian variable selection and EM algorithm; After completing the pixels, the precise corner position of the target object in the image is calculated, thereby obtaining accurate SLAM pose estimation.
2. A computer device, It is characterized in that The computer device comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is loaded by the processor, the method according to claim 1 is executed.
3. A readable storage medium, It is characterized in that A computer program is stored in the readable storage medium, and when the computer program is loaded by a processor, the method according to claim 1 is executed.
4. A target corner point accurate extraction system, It is characterized in that Comprising the computer device as claimed in claim 2.
Citation Information
Patent Citations
Visual SLAM (Simultaneous Localization and Mapping) method and system based on panoramic annular camera
CN114463374A
Semi-ordered point cloud-based three-dimensional reconstruction method for light-sectioning
CN115205462A
