An ORB feature extraction and matching method based on improved WOA algorithm
By improving the WOA algorithm to optimize ORB feature extraction and matching, combined with the RANSAC algorithm and Hamming distance, the problem of insufficient feature point recognition of ORB algorithm in complex environments is solved, the matching accuracy and adaptability of the VSLAM system is improved, and the computing resource requirements are reduced .
Patent Information
- Application Number
- CN202410686109.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-05-30
AI Technical Summary
In low-texture scenes, high-reflective surfaces and strong lighting environments, the feature point recognition of the ORB algorithm is insufficient, adaptability is insufficient, and it is easy to mismatch, affecting the performance of the VSLAM system.
The improved WOA algorithm is used to optimize the ORB feature extraction and matching process, calculate the homography matrix through the RANSAC algorithm, and build the fitness function with Hamming distance and inner point proportion, conduct global and local searches, and dynamically adjust the WOA algorithm parameters to improve the matching accuracy and adaptability.
It improves feature point matching accuracy and VSLAM system adaptability in complex environments, reduces computing resource requirements, speeds up processing speed, and improves matching quality and robustness.
Smart Images

Figure CN118552742B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision and VSLAM, and specifically but not limited to, relates to an ORB feature extraction and matching method based on an improved WOA algorithm. Background Art
[0002] In the development of VSLAM technology, the ORB feature extraction algorithm has attracted widespread attention due to its high efficiency and low resource consumption. However, under conditions such as low-texture scenes, highly reflective surfaces, and strong lighting environments, the feature descriptor generation and matching process of the ORB algorithm presents problems such as insufficient feature point recognition, insufficient adaptability, easy mismatching, and impact on system performance.
[0003] In view of this, it is necessary to provide a new structure to solve at least part of the above problems. Summary of the invention
[0004] In response to one or more problems in the prior art, the present invention proposes an ORB feature extraction and matching method based on an improved WOA algorithm. The ORB feature extraction and matching process is optimized by the improved WOA algorithm, the usability and efficiency of VSLAM technology in diversified application scenarios are improved, and the feature point recognition, tracking capability and overall performance of the VSLAM system are enhanced.
[0005] The technical solution to achieve the purpose of the present invention is:
[0006] An ORB feature extraction and matching method based on an improved WOA algorithm includes:
[0007] S1. Use the ORB algorithm to extract features from a scene, obtain feature points and their BRIEF descriptors, and generate initial feature point matching pairs;
[0008] S2, randomly select the initial feature point matching pairs, use the RANSAC test algorithm to calculate the homography matrix H, and calculate the Hamming distance of all matching pairs, and screen out spatially consistent inner point matching pairs, the spatial correspondence of the inner point matching pairs is described by the homography matrix H;
[0009] S3, constructing a fitness function based on the Hamming distance between BRIEF descriptors, the spatial consistency of the inlier matching pairs, and combining the Hamming distance of the descriptors with the inlier ratio, wherein the Hamming distance reflects the similarity between the BRIEF descriptors, and the inlier ratio reflects the geometric constraint compliance of the inlier matching pairs;
[0010] S4, based on the fitness function, the WOA algorithm is improved, and global and local searches are performed according to the quality and geometric consistency of the interior point matching pairs. In the iterative process, according to the feedback of the fitness function, the feature point matching scheme is updated, and a set of matching pairs with better fitness function values is obtained and the fitness function is updated;
[0011] S5. For the matching pairs optimized by the WOA algorithm, the RANSAC verification algorithm is used to eliminate potential mismatches, and the fitness function refined by the WOA algorithm is used to verify and refine the remaining matching pairs to obtain geometrically consistent and stable matching pairs.
[0012] Furthermore, the ORB feature extraction and matching method based on the improved WOA algorithm of the present invention, S1 specifically includes:
[0013] S1-1, using the ORB algorithm to identify feature points in the image and calculate the corresponding descriptors;
[0014] S1-2, based on the extracted feature points and their BRIEF descriptors, the Hamming distance between the BRIEF descriptors is calculated, and the BRIEF descriptors are paired by brute force matching to generate matching pairs;
[0015] S1-3, using a cross-check algorithm to eliminate mismatches in the matching pairs, and obtaining initial feature point matching pairs.
[0016] Furthermore, in the ORB feature extraction and matching method based on the improved WOA algorithm of the present invention, the pairing of the BRIEF descriptors in S1-2 is specifically as follows:
[0017] M={(i,j)|D H (d i , dj)≤τ}
[0018] Where M is the set of all feature point pairs identified as matches, (i, j) is an index pair, where i and j represent the index of the feature point in the first image and the index of the feature point in the second image respectively; D H represents the Hamming distance function, which is used to calculate the Hamming distance between two descriptors; d i and d j Represent the feature descriptors in the two images respectively; τ is the set Hamming distance threshold, which is used to determine whether the descriptors can be considered as matching.
[0019] Further, in the ORB feature extraction and matching method based on the improved WOA algorithm of the present invention, the screening of spatially consistent inner point matching pairs in S2 includes:
[0020] S2-1. Randomly select four pairs of points from the matching point pairs {(p1[i], p2[i])} in the two images, where each pair of points p1[i] and p2[i] is in two different images and is expressed in homogeneous coordinate form, i.e., p1[i] = (x1, y1, 1) T and p2[i] = (x2, y2, 1) T Using these four pairs of points, we construct the following linear equation to estimate the element h of the homography matrix H: ij ,Right now:
[0021] x2·(h 31 x1+h 32 y1+h 33 )=h 11 x1+h 12 y1+h 13
[0022] y2·(h 31 x1+h 32 y1+h 33 )=h 21 x1+h 22 y1+h 23
[0023] Wherein, (x1, y1) represents the coordinates of the randomly selected point in the pixel coordinate system of the first image, and (x2, y2) represents the coordinates of the corresponding point of the randomly selected point in the second image;
[0024] S2-2. Reorganize the above equations into a linear system Ah = 0, and apply singular value decomposition to find the null space of the matrix A. The singular vector corresponding to the minimum singular value is the best estimate of h, that is, the vector h that minimizes ||Ah|| and satisfies Ah = 0, where h is the vector containing all the unknown elements of the homography matrix [h 11 ,h 12 ,h 13 ,h 21 ,h 22 ,h 23 ,h 31 ,h 32 ,h 33 ] T , then the homography matrix H is obtained as:
[0025]
[0026] S2-3, RANSAC calculates the homography matrix by repeatedly randomly selecting point pairs and determining the number of internal points supported by each matrix to obtain the optimal homography matrix;
[0027] S2-4. Use the estimated best homography matrix to transform all other points and calculate the Euclidean distance between the transformed points and their matching points:
[0028]
[0029] in, is the transformed point, Represents the point (x1, y1, 1) in the first image acted upon by the homography matrix H T The result after the homography transformation is the predicted position of the points in the first image in the second image.
[0030] If the Euclidean distance d(p1[i],p2[i]) is less than the threshold τ, the point pair (p1[i],p2[i]) is considered to be an inlier; if the Euclidean distance is lower than the preset threshold, these point pairs are considered to be inliers.
[0031] Furthermore, in the ORB feature extraction and matching method based on the improved WOA algorithm of the present invention, the fitness function constructed in S3 is:
[0032]
[0033] Among them, Fitness represents the evaluation result of the feature matching quality, m represents the number of matching pairs identified as inliers by the RANSAC algorithm, n is the total number of matching pairs, and K is a coefficient used to adjust the importance of the inlier ratio in the fitness value; the first part of the fitness function The proportion of inliers in all matching pairs is emphasized. The higher the proportion, the more ready matching pairs are found. The coefficient K is used to adjust the influence of this proportion factor. It is the average Hamming distance of all inlier matching pairs, indicating the average similarity between the descriptors of these matching pairs. The lower the value, the higher the average similarity and the better the matching quality.
[0034] Further, in the ORB feature extraction and matching method based on the improved WOA algorithm of the present invention, the improved WOA algorithm based on the fitness function in S4 includes: dynamically adjusting the balance coefficients a, A, C, and l of the WOA algorithm, and introducing a weighting factor W to adjust the weight of the fitness function, wherein:
[0035] The balance coefficient a is used to reduce the search range, and its dynamic change law is expressed as:
[0036]
[0037] Where t is the current iteration number and T is the maximum iteration number;
[0038] The balance coefficient A is a random adjustment based on a, which is used to determine the search range of the next possible solution. Its calculation formula is:
[0039] A=2×a×ra
[0040] Where r is a random number in the range [0,1];
[0041] The balance coefficient C is used to enlarge or reduce the search step size, and its calculation formula is:
[0042] C=2×r
[0043] The balance coefficient l is a random number used to simulate the spiral update position of the whale, and its expression is:
[0044] l∈[-1,1]
[0045] The calculation formula of weighting factor W is:
[0046] W=λ1·f(a,A,C)+λ2·g(l)
[0047] Among them, λ1 and λ2 are two hyperparameters, which are used to adjust the influence of f(a,A,C) and g(l) in the weighting factor W. f(a,A,C) is the comprehensive search behavior influence function, which is used to calculate the influence of parameters a, A and C on the search behavior in the whale algorithm; g(l) is the whale spiral search behavior influence function.
[0048] Furthermore, in the ORB feature extraction and matching method based on the improved WOA algorithm of the present invention, the expression of the function f(a, A, C) is:
[0049]
[0050] Here, t is a constant that adjusts the steepness of the curve.
[0051] Furthermore, in the ORB feature extraction and matching method based on the improved WOA algorithm of the present invention, the expression of the function g(l) is:
[0052] g(l)=cos(2πl)
[0053] This function is generated according to the periodicity of the l parameter and reflects the influence of the spiral search behavior. The function form is cos(2vl), which will change periodically with the change of l. The value of l determines the direction and range of the spiral behavior.
[0054] Furthermore, the ORB feature extraction and matching method based on the improved WOA algorithm of the present invention has an updated fitness function Fitness ′ for:
[0055] Fitness′ =(1+W)·Fitness
[0056] Fitness is the original fitness evaluation function, and W is the weighting factor used to adjust the fitness value.
[0057] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:
[0058] 1. The ORB feature extraction and matching method based on the improved WOA algorithm of the present invention combines the improved whale optimization algorithm (WOA) with the RANSAC algorithm, which not only improves the matching accuracy of feature points in complex visual environments, but also enhances the adaptability to low-texture, high-reflection and strong lighting environments by dynamically adjusting the search strategy.
[0059] 2. The ORB feature extraction and matching method based on the improved WOA algorithm of the present invention reduces redundant calculations by optimizing the matching algorithm, significantly reduces the algorithm's demand for computing resources, and speeds up the processing speed, especially on mobile devices with limited resources.
[0060] 3. The ORB feature extraction and matching method based on the improved WOA algorithm of the present invention introduces a dynamically adjusted weighting factor, so that the WOA algorithm can accurately adjust the search behavior according to the feedback of the fitness function in different search stages, thereby improving the global and local search effects of feature matching, thereby effectively improving the overall matching quality and robustness of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The accompanying drawings are used to provide a further understanding of the present invention and are used together with the description to explain the embodiments of the present invention, but do not constitute a limitation of the present invention. In the accompanying drawings:
[0062] Figure 1 The flowchart of the ORB feature extraction and matching method based on the improved WOA algorithm of the present invention is shown.
[0063] Figure 2 The flowchart of the improved WOA algorithm of the present invention is shown. DETAILED DESCRIPTION
[0064] In order to further understand the present invention, preferred embodiments of the present invention are described below in conjunction with examples. However, it should be understood that these descriptions are only for further illustrating the features and advantages of the present invention, rather than limiting the claims of the present invention.
[0065] The description in this section is only for typical embodiments, and the present invention is not limited to the scope of the embodiments. The combination of different embodiments, the mutual replacement of some technical features in different embodiments, and the mutual replacement of the same or similar prior art means with some technical features in the embodiments are also within the scope of the description and protection of the present invention.
[0066] An ORB feature extraction and matching method based on the improved WOA algorithm, such as Figure 1 As shown, including:
[0067] Step S1: Use the ORB algorithm to extract feature points from a given data set. Based on the extracted feature descriptors, use the Hamming distance to generate preliminary feature point matching pairs through a brute force matching method. These preliminary matching pairs provide a starting solution set for the WOA algorithm.
[0068] The ORB algorithm first applies a variant of the FAST algorithm to locate corners in the image, and then uses a pyramid scaling technique to enhance the robustness of feature points to scale changes. A modified BRIEF descriptor is used to generate a binary string based on the local image patch of each feature point. These descriptors are computationally efficient while adding directional information to enhance invariance to rotation. The extracted descriptors are then paired using the Brute-Force Matcher algorithm, using the Hamming distance as a similarity metric:
[0069] M={(i,j)|D H (d i ,d j )≤τ}
[0070] Where M is the set of all feature point pairs identified as matches, (i, j) is an index pair, where i and j represent the index of the feature point in the first image and the feature point in the second image respectively. H Represents the Hamming distance function, which is used to calculate the distance between two descriptors. i ,d j Represent the feature descriptors in the two sets of images respectively. τ is the set Hamming distance threshold, which is used to determine whether the descriptor can be considered a match.
[0071] Step S2: The RANSAC algorithm is used to iteratively calculate the most suitable homography matrix H from the preliminary matching pairs, which reflects the geometric transformation between the images. Through this process, consistent inlier matches are screened out, and those matching pairs whose spatial correspondence is accurately described by the homography matrix H. This inlier set is the basis for the fitness function evaluation, which quantifies the quality of the feature matching pairs in the current iteration.
[0072] In the framework of the RANSAC algorithm, the homography matrix H is estimated by selecting a random set of point pairs, and then D is calculated for all matching pairs. H First, four pairs of points are randomly selected from the matching point pairs {(p1[i], p2[i])} in the two images, where each pair of points p1[i] and p2[i] is in two different images and expressed in homogeneous coordinate form, that is, p1[i] = (x1, y1, 1) T and p2[i]=(x2,y2,1) T Using these four pairs of points, we construct the following linear equation to estimate the element h of the homography matrix H: ij ,Right now:
[0073] x2·(h 31 x1+h 32 y1+h 33 )=h 11 x1+h 12 y1+h 13
[0074] y2·(h 31 x1+h 32 y1+h 33 )=h 21 x1+h 22 y1+h 23
[0075] Where (x1, y1) and (x2, y2) represent the coordinates of the corresponding points in the first and second images, respectively. These equations can be reorganized into a linear system Ah = 0. An effective way to solve this linear system is to apply singular value decomposition to find the null space of the matrix A. The singular vector corresponding to the minimum singular value gives the best estimate of h. That is, the vector h that minimizes ∥Ah∥ satisfies Ah = 0. Where h is a vector containing all the unknown elements of the homography matrix [h 11 ,h 12 ,h 13 ,h 21 ,h 22 ,h 23 ,h 31 ,h 32 ,h 33 ] T , so the homography matrix H is:
[0076]
[0077] RANSAC finds the best homography matrix by repeatedly randomly selecting point pairs, calculating the homography matrix, and determining the number of inliers supported by each matrix. All other points are transformed using the estimated best H, and inliers are identified by calculating the Euclidean distance between the transformed points and their matching points.
[0078]
[0079] in, is the transformed point. (x1,y1) represents the coordinates of the point in the second image after being transformed by the homography matrix H. If the distance d(p1[i],p2[i]) is less than the threshold τ, the point pair (p1[i],p2[i]) is considered to be an inlier. If the distance is below a preset threshold, these point pairs are considered to be inliers. The homography matrix H is used in the fitness function to evaluate the spatial consistency and matching quality of the matching pair {(p1[i],p2[i])} to guide the subsequent optimization steps of the WOA algorithm.
[0080] Step S3: Based on the inlier matching pairs obtained from RANSAC, a fitness function is defined to reflect the similarity between descriptors and consider whether the matching pairs meet the geometric constraints determined by the homography matrix H. At the same time, the Hamming distance of the matching pairs is combined with the inlier ratio to form a comprehensive performance metric. The value of the fitness function determines the search direction of the WOA algorithm, prompting the algorithm to identify the feature point combination that can maximize the matching accuracy.
[0081] First, the goal of the fitness function is to maximize the matching quality. Then, the Hamming distance is used to measure the similarity between two BRIEF descriptors. At the same time, the number of internal points is considered to measure the fitness of the function. This scheme designs a fitness function for evaluating feature point matching that conforms to the ORB algorithm, which fully considers the Hamming distance between matching pairs and the geometric consistency of matching pairs. The fitness function can be expressed as:
[0082]
[0083] Among them, Fitness represents the evaluation result of the feature matching quality, m represents the number of matching pairs identified as inliers by the RANSAC algorithm, n is the total number of matching pairs, and K is a coefficient used to adjust the importance of the inlier ratio in the fitness value. The first part of the fitness function The ratio of inliers in all matching pairs is emphasized. The higher the ratio, the more ready matching pairs are found. Multiplying by the coefficient K can adjust the influence of this ratio factor. is the average Hamming distance of all inlier matching pairs. By averaging the Hamming distances of all inlier matching pairs, we can get a metric that indicates the average similarity between the descriptors of these matching pairs. The lower this value is, the higher the average similarity is and the better the matching quality is.
[0084] Step S4: Figure 2 As shown in Figure 1, the WOA algorithm is customized to suit the feature matching problem. A weighting factor W is introduced, which depends on the value of a specific parameter in the current iteration to adjust the weight of the fitness function. In this way, the WOA algorithm can perform global and local searches more accurately based on the quality and geometric consistency of the matching pairs.
[0085] Parameters a, A, C, and r directly affect the global and local characteristics of the algorithm's search behavior.
[0086] Parameter a is mainly used to reduce the search range, allowing the algorithm to gradually shift from a broad global search to a more detailed local search in the search space. Its dynamic change law is expressed as:
[0087]
[0088] It decreases as the number of iterations increases. Here t is the current number of iterations and T is the maximum number of iterations. Parameter a decreases linearly from 2 to 0 as the iterations increase, affecting the range of variation of other parameters.
[0089] Parameter A is a random adjustment based on a, which is used to determine the search range of the next possible solution. It determines the search agent's behavior towards or away from the current optimal solution. Its value changes with a to control the intensity of the search. Its calculation formula is:
[0090] A=2×a×ra
[0091] Where r is a random number in the range [0,1]. It can be positive or negative, allowing the search agent to move closer to or away from the global optimal solution, which helps avoid local optimality and enhance exploration capabilities.
[0092] Parameter C is used to enlarge or reduce the search step size and increase the randomness and diversity of the search. Its calculation formula is:
[0093] C=2×r
[0094] Here r is also a random number between [0,1]. This parameter provides a random weight, and together with A, it can make the search agent search around a certain position of the optimal solution, thereby increasing the diversity of the search.
[0095] The parameter l is a random number between -1 and 1, which is used to simulate the spiral update position of the whale. Its expression is:
[0096] l∈[-1,1]
[0097] This parameter enables the algorithm to mimic the spiraling feeding behavior of whales, by creating spirals around the location of the solution, helping the algorithm to escape from possible local optima.
[0098] By dynamically adjusting the above parameters, the WOA algorithm can effectively search in the solution space of the feature point matching problem. At the same time, the framework designed in this solution allows the influence of the parameters to be directly reflected in the fitness function evaluation. A weighting factor W is introduced, which is dynamically calculated from these parameters to adjust the value of the original fitness function. We define the weighting factor W as follows:
[0099] W=λ1·f(a,A,C)+λ2·g(l)
[0100] Among them, λ1 and λ2 are two hyperparameters, which are used to adjust the influence of f(a,A,C) and g(l) in the weighting factor W. f(a,A,C) is the comprehensive search behavior influence function, and its expression is as follows:
[0101]
[0102] This function is modeled after the activation function in the logistic regression model. Its purpose is to convert the influence of these parameters into a weight factor between 0 and 1, so as to simulate the comprehensive influence of parameter a on the search behavior. Among them, parameter a controls the slope of the function, while A·C provides the quality of the combined influence of parameters A and C, which together with a determines the horizontal shift of the function, and t is a constant that adjusts the steepness of the curve.
[0103] At the same time, the g(l) function is a spiral search influence function, and its expression is as follows:
[0104] g(l)=cos(2πl)
[0105] This function is generated according to the periodicity of the l parameter, reflecting the influence of the spiral search behavior. The function form is cos(2πl), which will change periodically with the change of l. The value of l determines the direction and range of the spiral behavior. Combined with the above weight factors, we can define a new fitness function Fitness ′ as follows:
[0106] Fitness ′ =(1+W)·Fitness
[0107] This new fitness function Fitness ′Not only the original fitness evaluation function Fitness is considered, but also the fitness value is adjusted through W, a weighting factor dynamically calculated by parameters a, A, C, and l. This design allows different stages and characteristics of the search behavior to directly affect the evaluation criteria of the solution, increasing the flexibility and adaptability of the algorithm.
[0108] Step S5: After the WOA algorithm optimizes the matching pair, the RANSAC verification algorithm is applied again to ensure that the final matching pair is geometrically consistent and stable. Through this process, possible mismatches are further eliminated to ensure that the optimized matching pair can provide higher accuracy and robustness in practical applications.
[0109] This step innovatively adopts a double verification process, that is, after optimizing the ORB feature matching with the improved WOA algorithm, the RANSAC algorithm is further used to eliminate false matches, which can enhance the accuracy and robustness of the matching pairs. RANSAC is an iterative method for estimating the parameters of a mathematical model from a set of observations containing outliers. This algorithm is particularly suitable for situations where there are a large number of outliers in the data, and is common in image processing and computer vision, especially in the fields of feature matching, stereo vision, and motion tracking. First, n data points are randomly selected and the model parameters are estimated using these points. Then, after the consistent set calculation, that is:
[0110] C={p∈D|d(M,p) <t}
[0111] Among them, C is the consistent set, which contains all points p whose distance to model M is less than the threshold t; D is the set of observed data points; M is the model estimated based on randomly selected data points; d(M,p) is the distance from point p to model M; t is the distance threshold, which is used to determine whether the data point is consistent with the model.
[0112] Repeat the above steps multiple times and record the model with the largest consistent set. Use all data points with the largest consistent set to re-estimate the model parameters and get the final model. The number of iterations k is calculated based on the required confidence level P and the probability w of the internal point:
[0113]
[0114] Here P is the confidence that the algorithm has successfully found a good model, w is the probability that any selected set of samples is an inlier, and n is the minimum number of samples required.
[0115] This makes full use of the ability of the RANSAC algorithm to identify and retain correct matching pairs when dealing with data containing a lot of noise.
[0116] The description and application of the present invention here are illustrative, and it is not intended to limit the scope of the present invention to the above-mentioned embodiments. The effects or advantages involved in the specification may not be reflected in the actual experimental examples due to the uncertainty of specific condition parameters or other factors, and the effects or advantages are not used to limit the scope of the invention. The deformation and change of the embodiments disclosed here are possible, and the replacement of the embodiments and the various equivalent parts are well known to those of ordinary skill in the art. It should be clear to those skilled in the art that the present invention can be implemented in other forms, structures, arrangements, proportions, and with other components, materials and parts without departing from the spirit or essential features of the present invention. Other deformations and changes can be made to the embodiments disclosed here without departing from the scope and spirit of the present invention.
Claims
1. An ORB feature extraction and matching method based on an improved WOA algorithm, characterized in that: include: S1. Use the ORB algorithm to extract features from a scene image, obtain feature points and their BRIEF descriptors, and generate initial feature point matching pairs; S2, randomly select the initial feature point matching pairs, use the RANSAC test algorithm to calculate the homography matrix H, and calculate the Hamming distance of all matching pairs, and screen out spatially consistent inner point matching pairs, the spatial correspondence of the inner point matching pairs is described by the homography matrix H; S3. Based on the Hamming distance between BRIEF descriptors, the spatial consistency of the inlier matching pairs, and the combination of the Hamming distance of the descriptors and the inlier ratio, a fitness function is constructed, wherein the Hamming distance reflects the similarity between the BRIEF descriptors, and the inlier ratio reflects the geometric constraint compliance of the inlier matching pairs; the constructed fitness function is: Among them, Fitness represents the evaluation result of the feature matching quality, m represents the number of matching pairs identified as inliers by the RANSAC algorithm, n is the total number of matching pairs, and K is a coefficient used to adjust the importance of the inlier ratio in the fitness value; the first part of the fitness function The proportion of inliers in all matching pairs is emphasized. The higher the proportion, the more ready matching pairs are found. The coefficient K is used to adjust the influence of this proportion factor. is the average Hamming distance of all inlier matching pairs, indicating the average similarity between the descriptors of these matching pairs. The lower the value, the higher the average similarity and the better the matching quality. S4, based on the fitness function, the WOA algorithm is improved, and global and local searches are performed according to the quality and geometric consistency of the interior point matching pairs. In the iterative process, according to the feedback of the fitness function, the feature point matching scheme is updated, and a set of matching pairs with better fitness function values is obtained and the fitness function is updated; S5. For the matching pairs optimized by the WOA algorithm, the RANSAC verification algorithm is used to eliminate potential mismatches, and the fitness function refined by the WOA algorithm is used to verify and refine the remaining matching pairs to obtain geometrically consistent and stable matching pairs.
2. The ORB feature extraction and matching method based on the improved WOA algorithm according to claim 1 is characterized in that: S1 specifically includes: S1-1, using the ORB algorithm to identify feature points in the image and calculate the corresponding descriptors; S1-2, based on the extracted feature points and their BRIEF descriptors, the Hamming distance between the BRIEF descriptors is calculated, and the BRIEF descriptors are paired by brute force matching to generate matching pairs; S1-3, using a cross-check algorithm to eliminate mismatches in the matching pairs, and obtaining initial feature point matching pairs.
3. The ORB feature extraction and matching method based on the improved WOA algorithm according to claim 2 is characterized in that: The specific pairing of BRIEF descriptors in S1-2 is as follows: M={(i,j)∣D H (d i ,d j )≤τ} Where M is the set of all feature point pairs identified as matches, (i, j) is an index pair, where i and j represent the index of the feature point in the first image and the index of the feature point in the second image respectively; D H represents the Hamming distance function, which is used to calculate the Hamming distance between two descriptors; d i and d j Represent the feature descriptors in the two images respectively; τ is the set Hamming distance threshold, which is used to determine whether the descriptors can be considered as matching.
4. The ORB feature extraction and matching method based on the improved WOA algorithm according to claim 1 is characterized in that: The inlier matching pairs that are consistent in the screening space in S2 include: S2-1. Randomly select four pairs of points from the matching point pairs {(p1[i], p2[i])} in the two images, where each pair of points p1[i] and p2[i] are in two different images and are expressed in homogeneous coordinate form, that is, p1[i] = (x1, y1, 1) T and p2[i]=(x2,y2,1) T , use these four pairs of points to construct the following linear equation to estimate the element h of the homography matrix H ij ,Right now: x2·(h 31 x1+h 32 y1+h 33 )=h 11 x1+h 12 y1+h 13 y2·(h 31 x1+h 32 y1+h 33 )=h 21 x1+h 22 y1+h 23 Wherein, (x1, y1) represents the coordinates of the randomly selected point in the pixel coordinate system of the first image, and (x2, y2) represents the coordinates of the corresponding point of the randomly selected point in the second image; S2-2. Reorganize the above equations into a linear system Ah = 0, and apply singular value decomposition to find the null space of the matrix A. The singular vector corresponding to the minimum singular value is the best estimate of h, that is, the vector h that minimizes ||Ah|| and satisfies Ah = 0, where h is the vector containing all the unknown elements of the homography matrix [h 11 ,h 12 ,h 13 ,h 21 ,h 22 ,h 23 ,h 31 ,h 32 ,h 33 ] T , then the homography matrix H is obtained as: S2-3, RANSAC calculates the homography matrix by repeatedly randomly selecting point pairs and determining the number of internal points supported by each matrix to obtain the optimal homography matrix; S2-4. Use the estimated best homography matrix to transform all other points and calculate the Euclidean distance between the transformed points and their matching points: in, is the transformed point, Indicates that the homography matrix H acts on the point (x1, y1, 1) in the first image T The result after homography transformation is the predicted position of the points in the first image in the second image. If the Euclidean distance d(p1[i],p2[i]) is less than the threshold τ, the point pair (p1[i],p2[i]) is considered to be an inlier.
5. The ORB feature extraction and matching method based on the improved WOA algorithm according to claim 1 is characterized in that: In S4, the improvement of the WOA algorithm based on the fitness function includes: dynamically adjusting the balance coefficients a, A, C, and l of the WOA algorithm, and introducing a weighting factor W to adjust the weight of the fitness function, wherein: The balance coefficient a is used to reduce the search range, and its dynamic change law is expressed as: In the formula, t is the current iteration number, T is the maximum iteration number; The balance coefficient A is a random adjustment based on a, which is used to determine the search range of the next possible solution. Its calculation formula is: A=2×a×ra Where r is a random number in the range [0,1]; The balance coefficient C is used to enlarge or reduce the search step size, and its calculation formula is: C=2×r The balance coefficient l is a random number used to simulate the spiral update position of the whale, and its expression is: l∈[-1,1] The calculation formula of weighting factor W is: W=λ1·f(a,A,C)+λ2·g(l) Among them, λ1 and λ2 are two hyperparameters, which are used to adjust the influence of f(a,A,C) and g(l) in the weighting factor W respectively. f(a,A,C) is the comprehensive search behavior influence function, which is used to calculate the influence of parameters a, A and C on the search behavior in the whale algorithm; g(l) is the whale spiral search behavior influence function.
6. The ORB feature extraction and matching method based on the improved WOA algorithm according to claim 5 is characterized in that: The expression of function f(a,A,C) is: Here, t is a constant that adjusts the steepness of the curve.
7. The ORB feature extraction and matching method based on the improved WOA algorithm according to claim 5 is characterized in that: The expression of function g(l) is: g(l)=cos(2πl) This function is generated according to the periodicity of the l parameter and reflects the influence of the spiral search behavior. The function form is cos(2πl), which will change periodically with the change of l. The value of l determines the direction and range of the spiral behavior.
8. The ORB feature extraction and matching method based on the improved WOA algorithm according to claim 1 is characterized in that: The updated fitness function Fitness' is: Fitness′=(1+W)·Fitness Fitness is the original fitness evaluation function, and W is the weighting factor used to adjust the fitness value.
