A descriptor matching method and storage medium
The descriptor matching method with polar plane normal vector coplanar constraints solves the problem of difficulty in balancing matching speed and interior point rate in the existing technology, achieves efficient descriptor matching, and improves the performance of the SLAM system.
Patent Information
- Application Number
- CN202311529779.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-16
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-11-16
AI Technical Summary
Existing descriptor matching methods are difficult to balance between matching speed and interior point rate. Brute force matching is inefficient, classification matching has over-fitting problems, and geometric constraint matching calculations are complex and time-consuming, making it difficult to meet the needs of real-time SLAM systems.
The descriptor matching method using the coplanarity constraint of polar plane normal vectors is used to design the included angle interval through feature point and descriptor coordinate conversion, projection, normalization, normal vector acquisition, included angle calculation and interval index calculation, and the descriptor is The classification is divided into different intervals, and preset thresholds are used for matching to increase the interior point rate and shorten the matching time.
It improves the interior point rate and efficiency of descriptor matching, shortens the matching time, and achieves the effect of classification matching speed and geometric constraint matching interior point rate without increasing computational complexity.
Smart Images

Figure CN117474953B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning, and in particular to a descriptor matching method and a storage medium. Background Art
[0002] XR devices are electronic products that can provide mixed reality experiences. In XR devices, visual SLAM (Simultaneous Localization and Mapping) is the main 6DoF technology it relies on. It means that when the device's own position is uncertain, it creates a map based on the images collected by the camera in a completely unknown environment and uses the map for autonomous positioning.
[0003] The relocalization scheme in the currently popular visual SLAM mainly includes three stages. The first stage is to select candidate images. In this stage, it is necessary to find the candidate image most similar to the query image in the historical image; the second stage is the matching of image feature descriptors (hereinafter referred to as descriptors). In this stage, it is necessary to match the image feature descriptors of the query image and the candidate image to facilitate the next step of solving the pose; the third stage is geometric verification. In this stage, it is necessary to use the matching results of the previous step to solve the pose and determine the number of inliers.
[0004] Image feature points are a technique for extracting repeatable and highly distinguishable feature pixels on an image, while descriptors are a technique for generating representative and distinguishable feature vectors based on feature pixels. The use of descriptors to obtain the connection between different feature points is called descriptor matching. Descriptor matching of image feature points is a common technique in the field of computer vision, and is often used to generate visual associations, restore depth, and perform relocation operations in multi-view imaging, 3D reconstruction, and SLAM.
[0005] The accuracy of descriptor matching of image feature points directly affects the accuracy of multi-view imaging, 3D reconstruction, and SLAM. In the current manifold robotics and XR fields, since most of the above technologies run on mobile terminals, their computational efficiency is also particularly important.
[0006] In the image feature descriptor matching stage, the most direct method in the prior art is brute force matching, that is, each descriptor of the query image is distanced with all the descriptors of the corresponding candidate image, and the corresponding descriptor closest to the current descriptor is found, thereby obtaining the matching relationship of all descriptors of the two images. This method has the highest accuracy, but it is the least efficient and time-consuming, which is unacceptable in a real-time SLAM system.
[0007] Another common matching method is classification matching, that is, each descriptor is classified into a certain category, and when matching, only the distance with the descriptors of the same category needs to be calculated, which reduces the number of calculations and speeds up the matching speed. However, the classification method needs to be trained in advance, has the problem of overfitting, and forces the descriptor to be classified to the classification center closest to it, often causing similar descriptors to be classified into different categories. In subsequent matching, these similar descriptors can no longer meet, resulting in a reduction in the inlier rate.
[0008] When there is a geometric relationship between two images, descriptor matching based on geometric constraints can also be used. A common geometric constraint matching is called epipolar constraint matching. This method can make full use of geometric priors and increase the inlier rate, but the calculation of the epipolar line may be much more complicated than the descriptor distance calculation, and the final time consumption is often higher than brute force matching. Another common geometric constraint matching is called geometric guided matching (Guided Match). This method comprehensively utilizes the prior of geometric constraints and the efficiency of table lookup operations. It can achieve faster speed than brute force matching and higher inlier rate than classification matching. However, this method is also more complicated to calculate and requires sampling near the entire epipolar line. There are still efficiency issues during mobile terminal operation. The existence of these problems will make it impossible for the matching speed and inlier rate of descriptor matching to meet the requirements at the same time. Summary of the invention
[0009] The present invention provides a descriptor matching method and a storage medium, which are used to solve the problems of low matching speed and low inlier rate of the existing descriptor matching method.
[0010] In order to solve the above technical problems, the present invention discloses the following technical solutions:
[0011] The present invention provides a descriptor matching method, which includes a feature extraction step, a coordinate conversion step, a projection step, a normalization step, a normal vector acquisition step, an angle calculation step, an interval index calculation step and a matching step.
[0012] The feature extraction step is to extract a set of first feature point pixel coordinates and a first descriptor vector and a set of second feature point pixel coordinates and a second descriptor vector, and the same set of feature point pixel coordinates and descriptor vectors corresponds to a coordinate system; the coordinate conversion step is to convert the first feature point pixel coordinates and the second feature point pixel coordinates into observation vectors on a unit sphere to obtain a first observation vector and a second observation vector; the projection step is to project the second observation vector in the second coordinate system to a first coordinate system to obtain a third observation vector; the normalization step is to normalize the translation between the first coordinate system and the second coordinate system to obtain a unit translation vector; the normal vector acquisition step is to obtain a unit translation vector. The first observation vector and the third observation vector are cross-multiplied with the unit translation vector to obtain a first normal vector and a second normal vector; the angle calculation step is based on a phase adjustment function to obtain a first angle and a second angle; the interval index calculation step is based on a floor function to obtain a first angle interval index and a second angle interval index; the matching step, when the first angle interval index is the same as the second angle interval index, calculates the distance between each first descriptor under the first angle interval index and the media second descriptors under the second angle interval index, and records the first descriptor closest to the second descriptor as the matching object of the second descriptor.
[0013] Furthermore, the formula of the coordinate conversion step is:
[0014]
[0015]
[0016] in, represents the first observation vector, represents the second observation vector, π- 1 () represents the back projection transformation function, pa represents the pixel coordinates of the first feature point, and pb represents the pixel coordinates of the second feature point.
[0017] Furthermore, the formula of the projection step is:
[0018]
[0019] in, Represents the third observation vector, and Rab represents the rotation matrix between the first coordinate system and the second coordinate system.
[0020] Furthermore, the formula for the normal vector acquisition step is:
[0021]
[0022]
[0023] in, represents the first normal vector, represents the second normal vector, Represents the unit translation vector.
[0024] Furthermore, the formula for the angle calculation step is:
[0025]
[0026]
[0027] Wherein, θa represents the first angle, θb represents the second angle, and f() represents the phase adjustment function. Represents a preset standard normal vector, which is a constant value.
[0028] Furthermore, the formula for the interval index calculation step is:
[0029]
[0030]
[0031] Wherein, ia represents the first angle interval index, ib represents the second angle interval index, floor() represents the floor function, θstep represents a preset threshold, θstep∈(0,2π).
[0032] The present invention also provides a storage medium, a memory for storing executable program code, a processor reading the executable program code to run a computer program corresponding to the executable program code to execute at least one step in the descriptor matching method of the polar plane normal vector coplanar constraint.
[0033] Compared with the prior art, the present invention has at least the following technical effects:
[0034] The present invention provides a descriptor matching method and a storage medium. The epipolar line constraint is constructed for feature points and descriptors in coordinate systems corresponding to two different cameras by using a method of coplanar constraint of epipolar plane normal vectors, and an angle interval is designed. Feature points and descriptors are classified and divided into different intervals. A preset threshold is used to classify descriptors based on interval division. The larger the value, the looser the geometric constraint. The geometric constraint improves the inlier rate of the descriptor matching method. Descriptors belonging to the same class, that is, descriptors with the same angle interval index, are matched. The angle interval index can limit the range of descriptor matching. Only a set of descriptors with the same angle interval index is matched, thereby improving the descriptor matching efficiency, improving the matching speed, and shortening the matching time. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0036] Figure 1 This is a flow chart of the descriptor matching method according to an embodiment of the present invention;
[0037] Figure 2 A geometric meaning diagram of the descriptor matching method described in an embodiment of the present invention;
[0038] Figure 3 An array diagram under the angle interval index of the descriptor matching method according to an embodiment of the present invention;
[0039] Figure 4 The descriptor matching method described in the embodiment of the present invention is different from the descriptor matching method in the prior art.
[0040] Data comparison chart of
[0041] Figure 5 It is a schematic diagram of the storage medium structure according to an embodiment of the present invention.
[0042] The components in the figure are marked as follows:
[0043] 100 storage medium, 110 memory, 120 processor. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0045] like Figure 1 As shown, the present invention provides a descriptor matching method, including step S1) feature extraction step, step S2) coordinate conversion step, step S3) projection step, step S4) normalization step, step S5) normal vector acquisition step, step S6) angle calculation step, step S7) interval index calculation step and step S8) matching step.
[0046] Step S1) Feature extraction step, extracting a set of first feature point pixel coordinates and a first descriptor vector and a set of second feature point pixel coordinates and a second descriptor vector, the same set of feature point pixel coordinates and descriptor vector corresponds to a coordinate system.
[0047] In this embodiment, the first feature point pixel coordinates and the first descriptor vector are extracted from camera a, the second feature point pixel coordinates and the second descriptor vector are extracted from camera b, and the first feature point pixel coordinates include k first feature points, so the first feature point pixel coordinates are The first descriptor vector includes k first descriptors, so the first descriptor vector is The pixel coordinates of the second feature point include j second feature points, so the pixel coordinates of the second feature point are The second descriptor vector includes j second descriptors, so the second descriptor vector is The first descriptor and the second descriptor can be traditional manually designed descriptors such as SIFT, SURF, ORB, etc., or can be learned descriptors such as SuperPoint, ALike, etc. Camera a corresponds to a first coordinate system, and camera b corresponds to a second coordinate system.
[0048] Step S2) A coordinate conversion step, converting the first feature point pixel coordinates and the second feature point pixel coordinates into observation vectors on a unit sphere to obtain a first observation vector and a second observation vector.
[0049] Step S2) The formula for the coordinate conversion step is:
[0050]
[0051]
[0052] in, represents the first observation vector, which is represents the second observation vector, which is π- 1 () represents the back projection transformation function, pa represents the pixel coordinates of the first feature point, and pb represents the pixel coordinates of the second feature point.
[0053] In this embodiment, in order to construct the epipolar constraint, the pixel coordinates of the feature points need to be converted into the observation vector on the unit sphere, π- 1 () represents the back-projection transformation function of the camera, and the back-projection transformation function is related to the selection of the camera model, including but not limited to the pinhole model, fisheye model, etc.
[0054] Step S3) A projection step is to project the second observation vector in the second coordinate system to a first coordinate system to obtain a third observation vector.
[0055] Step S3) The formula for the projection step is
[0056]
[0057] in, represents the third observation vector, which is Rab represents the rotation matrix between the first coordinate system and the second coordinate system.
[0058] In this embodiment, the transformation matrix between camera a and camera b is [Rab;tab], and the unit observation vector under camera a is projected to camera b to obtain the unit observation vector of camera b represented in the first coordinate system of camera a: The unit observation vector is the third observation vector.
[0059] Step S4) normalization step, normalizing the translation between the first coordinate system and the second coordinate system to obtain a unit translation vector, that is, normalizing the translation tab to obtain the unit translation vector represented in the first coordinate system of camera a
[0060] S5) A normal vector acquisition step is to cross-multiply the first observation vector and the third observation vector with the unit translation vector to obtain a first normal vector and a second normal vector.
[0061] S5) The formula for the normal vector acquisition step is:
[0062]
[0063]
[0064] in, Represents the first normal vector. The first normal vector is Represents the second normal vector, which is Represents the unit translation vector.
[0065] like Figure 2 As shown, in this embodiment, the first observation vector is The second observation vector is and the unit translation vector Constitute a plane, and each of the first observation vector and the second observation vector and the unit translation vector constitute a plane, the plane is the polar plane, the first normal vector With the second normal vector is the normal vector of the plane, the first normal vector With the second normal vector are perpendicular to the unit translation vector
[0066] Step S6) Angle calculation step, based on the phase adjustment function, obtaining a first angle and a second angle.
[0067] Step S6) The formula for the angle calculation step is:
[0068]
[0069]
[0070] Among them, θa represents the first angle, which is θb represents the second angle, which is f() represents the phase adjustment function, so that the angle range of the first angle and the angle range of the second angle are between 0 and 2π, that is, θa∈
[0071] [0,2π), θb∈[0,2π), there are many ways to implement the phase adjustment function. The most general way is to just monitor the calculated angle, and if the angle is less than 0, increase it by 2π. Represents a preset standard normal vector, which is a constant value.
[0072] In this embodiment, the preset standard normal vector can be a fixed value It can also be the first normal vector Any normal vector in and the second normal vector Any normal vector in The first angle is the first normal vector With the preset standard normal vector The angle of is the second normal vector With the preset standard normal vector Angle.
[0073] Step S7) interval index calculation step, based on the floor function, the descriptor classification of the interval division is performed to obtain a first angle interval index and a second angle interval index.
[0074] Step S7) The formula for interval index calculation step is:
[0075]
[0076]
[0077] Where ia represents the first angle interval index, and the first angle interval index is ib represents the second angle interval index, and the second angle interval index is }, floor() represents a floor function, θstep represents a preset threshold, θstep∈(0,2π), the larger the preset threshold, the looser the geometric constraint, and by establishing the geometric constraint, the inlier rate of the descriptor matching is improved.
[0078] like Figure 3 As shown, in this embodiment, let According to the value of different angle interval indexes, the first descriptor and the second descriptor belonging to the angle interval index are added to the corresponding array.
[0079] Using the method of coplanarity constraint of polar plane normal vectors, epipolar constraints are constructed for feature points and descriptors in the coordinate systems corresponding to two different cameras. The angle interval is designed, and the feature points and descriptors are classified into different intervals. A preset threshold is used to classify descriptors based on interval division. The brute force search problem evolves into a table lookup problem, which reduces the search time and improves the matching efficiency.
[0080] Step S8) matching step, when the first angle interval index is the same as the second angle interval index, calculate the distance between each first descriptor under the first angle interval index and the media second descriptors under the second angle interval index, and record the first descriptor closest to the second descriptor as the matching object of the second descriptor.
[0081] In this embodiment, a match is performed between the first descriptor belonging to camera a and the second descriptor belonging to camera b. According to different angle interval indexes, the range of descriptor matching is limited, and only the descriptor set with the same index is matched.
[0082] Another example Figure 3 As shown, only Towards To match, Towards To match, Towards Match, and so on, to get the matching results
[0083] In this embodiment, descriptors are matched by calculating the distance between each first descriptor under the first angle interval index and each second descriptor under the second angle interval index. The distance may be a Hamming distance, a two-norm distance, a cosine distance, etc. The distance calculation function between descriptors may be any distance calculation function in the prior art, which will not be described in detail here.
[0084] like Figure 4As shown, the descriptor matching method provided by the present invention is compared with the original brute force matching method, the classification-based matching method and the geometric constraint matching method in the prior art, among which the first is the original brute force matching method, which is the most time-consuming. The second is the classification-based matching method, which is the least time-consuming, but due to the problems of overfitting and over-classification, the inlier rate is low. The third is the currently common geometric constraint matching method, which is less time-consuming than brute force matching. The fourth is the descriptor matching method provided by the present invention. Due to the addition of geometric constraints, the inlier rate is higher than the result of brute force matching. At the same time, since the calculation process of this method is relatively simple, the time consumption is also significantly lower than other geometric constraint matching methods. Therefore, the descriptor matching method and storage medium provided by the present invention have a speed close to that of classification matching, and achieve the inlier rate of common geometric constraint matching.
[0085] like Figure 5 As shown, the present invention also provides a storage medium 100, including a memory 110 and a processor 120, the storage medium in the memory 110 is used to store executable program code, the processor 120 reads the executable program code to run a computer program corresponding to the executable program code to execute at least one step of step S1) to step S8) in the descriptor matching method of the coplanar constraint of the polar plane normal vector.
[0086] The advantage of the present application is that it provides a descriptor matching method and a storage medium, uses the method of polar plane normal vector coplanarity constraint to construct polar line constraints for feature points and descriptors in the coordinate systems corresponding to two different cameras, designs angle intervals, and classifies feature points and descriptors into different intervals, uses a preset threshold to perform descriptor classification based on interval division, and the larger the value, the looser the geometric constraint. The geometric constraint improves the inlier rate of the descriptor matching method, and then matches descriptors belonging to the same class, that is, descriptors with the same angle interval index. The angle interval index can limit the scope of descriptor matching, and only matches the set of descriptors with the same angle interval index, thereby improving the descriptor matching efficiency, improving the matching speed, and shortening the matching time.
[0087] The above is a detailed introduction to a descriptor matching method and a storage medium provided in an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the technical solutions and core ideas of the present invention. Ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some of the technical features therein with equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A descriptor matching method, characterized in that: include: A feature extraction step, extracting a set of first feature point pixel coordinates and a first descriptor vector and a set of second feature point pixel coordinates and a second descriptor vector, wherein the same set of feature point pixel coordinates and descriptor vector corresponds to one coordinate system; A coordinate conversion step, converting the first feature point pixel coordinates and the second feature point pixel coordinates into observation vectors on a unit sphere to obtain a first observation vector and a second observation vector; A projection step, projecting the second observation vector in the second coordinate system to a first coordinate system to obtain a third observation vector; a normalization step of normalizing the translation between the first coordinate system and the second coordinate system to obtain a unit translation vector; A normal vector acquisition step, cross-multiplying the first observation vector and the third observation vector with the unit translation vector to obtain a first normal vector and a second normal vector; An angle calculation step, obtaining a first angle and a second angle based on a phase adjustment function; An interval index calculation step, obtaining a first angle interval index and a second angle interval index based on a floor function; as well as Matching step: when the first angle interval index is the same as the second angle interval index, calculate the distance between each first descriptor under the first angle interval index and the media second descriptors under the second angle interval index, and record the first descriptor closest to the second descriptor as the matching object of the second descriptor.
2. The descriptor matching method according to claim 1, characterized in that: The formula for the coordinate transformation step is: in, represents the first observation vector, represents the second observation vector, π- 1 () represents the back projection transformation function, pa represents the pixel coordinates of the first feature point, and pb represents the pixel coordinates of the second feature point.
3. The descriptor matching method according to claim 1, characterized in that: The formula for the projection step is: in, Represents the third observation vector, and Rab represents the rotation matrix between the first coordinate system and the second coordinate system.
4. The descriptor matching method according to claim 1, characterized in that: The formula for the normal vector acquisition step is: in, represents the first normal vector, represents the second normal vector, Represents the unit translation vector.
5. The descriptor matching method according to claim 1, characterized in that: The formula for the angle calculation step is: Wherein, θa represents the first angle, θb represents the second angle, and f() represents the phase adjustment function. Represents a preset standard normal vector, which is a constant value.
6. The descriptor matching method according to claim 1, characterized in that: The formula for the interval index calculation step is: Wherein, ia represents the first angle interval index, ib represents the second angle interval index, floor() represents the floor function, θstep represents a preset threshold, θstep∈(0,2π).
7. A storage medium for storing executable program code, characterized in that: A processor reads the executable program code to run a computer program corresponding to the executable program code to perform at least one step in the descriptor matching method according to any one of claims 1 to 6.
