A visual relocalization method and related apparatus
By constructing the association between query feature points and map points, determining the target sampling probability and performing information sampling, the problem of long processing time in visual relocalization systems is solved, and processing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202611649357.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-23
- Publication Date
- 2026-11-27
AI Technical Summary
Visual relocalization systems take a long time to determine the pose of the image acquisition device in the visual map, resulting in low processing efficiency.
By constructing the association between query feature points in the query image and map points in the visual map, the target sampling probability of the target feature points and map points is determined, and information is sampled according to the sampling probability. Finally, the pose is solved, which improves the effectiveness and efficiency of the sampling results.
It reduces redundant calculations of invalid data, improves the accuracy and computational efficiency of pose prediction, and enhances the processing efficiency of visual relocalization.
Smart Images

Figure CN123181576A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision technology, and in particular to a visual relocalization method and related apparatus. Background Technology
[0002] With the development of vehicle intelligence and automatic parking technology, memory parking is increasingly being applied to the automatic parking process. Memory parking systems can utilize environmental information recorded during the vehicle's route learning phase to provide positioning support for the subsequent route navigation phase. In environments with weak satellite positioning signals, such as underground parking lots and park parking areas, visual information can serve as a crucial basis for vehicle positioning. For example, a memory parking system can pre-capture images of the surrounding environment using an onboard image acquisition device while the vehicle is traveling along the parking route, and then create a visual map describing the parking environment based on these images. When the vehicle travels along the same parking route again, it can determine its position and attitude relative to the visual map based on real-time images captured by the image acquisition device, providing positioning information for route following, motion planning, and parking control. To obtain the vehicle's positioning information in the visual map, visual relocalization processing of the query image is typically required, and the corresponding pose result is output.
[0003] Typically, during visual relocalization, the visual relocalization system matches the query image with map information in the visual map, determines the predicted pose of the image acquisition device in the visual map based on the matching result, and outputs this pose as the visual relocalization result.
[0004] However, visual relocalization systems may take a long time to determine the pose of the image acquisition device in the visual map, resulting in low processing efficiency. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a visual relocation method and related apparatus, which can improve the processing efficiency of visual relocation.
[0006] The embodiments of this application disclose the following technical solutions: On one hand, embodiments of this application provide a visual relocalization method, the method comprising: Construct the association between query feature points of the query image and map points in the visual map. The query feature points and map points with the association are called feature point groups. The target group in the feature point group includes target feature points and target map points. For the target group, the target sampling probability of the target group is determined based on the matching degree between the query local descriptor corresponding to the target feature point and the map local descriptor corresponding to the target map point, as well as the historical observation information of the target map point. Based on the target sampling probability, information is sampled from the target feature points and the target map points to obtain the sampling results of the target group; The pose is solved based on the sampling results of the target group to obtain the predicted pose of the image acquisition device, and the query image is the image acquired by the image acquisition device.
[0007] On the other hand, embodiments of this application provide a visual relocation device, the device comprising: The construction unit is used to construct the association between query feature points of the query image and map points in the visual map. The query feature points and map points with the association are called feature point groups, and the target group in the feature point group includes target feature points and target map points. The determining unit is configured to determine the target sampling probability of the target group based on the degree of matching between the query local descriptor corresponding to the target feature point and the map local descriptor corresponding to the target map point, as well as the historical observation information of the target map point. A sampling unit is used to sample information from the target feature points and the target map points according to the target sampling probability, and obtain the sampling result of the target group; The pose solving unit is used to solve the pose based on the sampling results of the target group to obtain the predicted pose of the image acquisition device, wherein the query image is the image acquired by the image acquisition device.
[0008] On the other hand, embodiments of this application provide a computer device, the computer device including a processor and a memory: The memory is used to store computer programs; The processor is configured to implement the methods described above according to the computer program.
[0009] On the other hand, embodiments of this application provide a computer-readable storage medium for storing a computer program that, when executed by a computer device, implements the methods described above.
[0010] As can be seen from the above technical solution, when constructing the association between query feature points in the query image and map points in the visual map, the query feature points and map points with association are treated as feature point groups. For the target group within the feature point group, which includes target feature points and target map points, the target sampling probability of the target group is determined based on the matching degree between the query local descriptor corresponding to the target feature point and the map local descriptor corresponding to the target map point, as well as the historical observation information of the target map point. Information sampling is then performed on the target feature points and target map points according to the target sampling probability to obtain the sampling result of the target group. The matching degree between local descriptors reflects the matching situation between the target feature points in the query image and the target map points in the visual map at the local feature level, and the historical observation information of the target map points reflects the historical observation situation of the target map points during the visual map construction process. By jointly determining the target sampling probability through matching at the local feature level and historical observations during the visual map construction process, information sampling of target feature points and target map points can be achieved. This considers both their matching at the local feature level and the historical observations of the target map points. Different sampling probabilities can be assigned to different matching or historical observation scenarios, reducing invalid data in mismatched cases and improving the effectiveness and efficiency of information sampling. This reduces redundant computation in pose determination due to invalid data in the target group's sampling results. Pose determination based on the target group's sampling results yields the predicted pose of the image acquisition device, improving the accuracy and computational efficiency of the predicted pose, and ultimately enhancing visual relocalization efficiency. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a schematic diagram illustrating an application scenario of a visual relocation method provided in an embodiment of this application. Figure 2 A flowchart illustrating a visual relocation method provided in an embodiment of this application; Figure 3 This application provides a schematic diagram illustrating the construction of the association between query feature points and map points in an embodiment of the present application. Figure 4 This application provides a schematic diagram illustrating the determination of the most similar objects. Figure 5 A flowchart of a hierarchical visual relocation method provided in this application embodiment; Figure 6 This is a schematic diagram of the structure of a visual repositioning device provided in an embodiment of this application; Figure 7 This application provides a schematic diagram of the hardware structure of a computer device according to an embodiment of the present application. Figure 8 This is a schematic diagram of the hardware structure of a server provided in an embodiment of this application. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0014] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.
[0015] During the route navigation phase of memory parking, the vehicle-side computing device uses the query images acquired by the image acquisition device and the loaded visual map for visual relocalization. The visual map can store the map points and their observation records established during the route learning phase. Typically, the system constructs a two-dimensional to three-dimensional correspondence between query feature points in the query image and map points in the visual map through visual matching, and uses a random consistency test to extract a minimum sample set for pose solving from multiple two-dimensional to three-dimensional correspondences to generate and verify the pose assumptions of the image acquisition device.
[0016] However, the matching results may differ between different 2D and 3D models. For example, adjacent parking spaces or pillars in an underground parking garage may have similar appearances, and variations in lighting and camera angles can also affect the matching degree between the query local descriptor and the map local descriptor. Furthermore, the number of times each map point is observed by effective keyframes during mapping may vary, and map points observed by only a few keyframes will have relatively limited multi-view support. Therefore, the effectiveness of different 2D and 3D models in pose determination may differ.
[0017] Traditional random consistency testing uses equal-probability sampling for each 2D-3D correspondence. This ensures that correspondences with lower local descriptor matching and map points with fewer keyframe observations have the same selection probability as correspondences with higher local descriptor matching and map points with more keyframe observations. When the extracted minimum sample set contains mismatches or map points with relatively limited multi-view support, the generated pose hypothesis may fail verification. The system needs to re-extract the minimum sample set and perform pose calculation and verification again, thus increasing the number of iterations in the random consistency test and the pose calculation time, and reducing the efficiency of visual relocalization.
[0018] Based on this, embodiments of this application provide a visual relocalization method. This method, after establishing the correspondence between the query image observation and the 3D information in the visual map, comprehensively considers the current local matching situation and the historical observation information of the corresponding map points in the visual map to determine the sampling probability of the corresponding samples participating in pose solving, and solves the predicted pose of the image acquisition device based on the sampling results. Therefore, the sampling process can consider the quality differences of different correspondences, helping to reduce repeated pose calculations caused by invalid sampling and improving the efficiency of visual relocalization.
[0019] The following is a description of common technical terms that may be involved in the embodiments of this application: Visual maps are maps created from environmental images to record visual and spatial information about the environment. They are used to record visual and spatial information about the parking environment.
[0020] The map layer can record the stable identifiers, coordinate system, camera model and calibration parameters, map version, and the keyframe and map point sets contained in the visual map, so that the map construction and visual relocalization processes use consistent coordinate representations and projection models. When performing only visual relocalization, the information stored in the visual map can be used directly without reconstructing the local neighborhood grid; when there is a need for neighborhood search, the local neighborhood grid can be constructed as needed.
[0021] The keyframe layer can record the stabilization identifier, acquisition time, camera pose, global scene description, and effective local features of each valid keyframe. Each effective local feature can include 2D image coordinates, response value, local descriptor, and the stabilization identifier of the associated map point. The local feature index can be a fixed sequence number of the corresponding local feature in the local feature sequence of the keyframe, used to map the local feature matching result to the corresponding map point.
[0022] The map point layer can record the stable identifier, world coordinates, reference keyframe, number of valid observations, keyframe set for observing the corresponding map point, valid status, and replacement relationship for each valid map point. The number of valid observations for a map point can reflect the historical multi-view support status of the corresponding map point.
[0023] The association layer can maintain bidirectional observation relationships, from local feature indexes of keyframes to map points, and from map points back to keyframes and local feature indexes. It can also establish co-view relationships between keyframes based on the number of map points shared between them. When map points are merged, replaced, or deleted, the corresponding bidirectional observation relationships and keyframe co-view relationships can be updated synchronously. When loading the visual map, the association between local features and map points can be restored based on stability indicators, enabling the matching of queried local features with local features in keyframes to obtain currently valid map points. Therefore, during visual relocalization, the 3D position and historical observation information of the corresponding map points can be obtained based on the local feature matching results.
[0024] Visual repositioning: The process of determining the predicted pose of an image acquisition device relative to a pre-established visual map based on the acquired image and the visual map itself.
[0025] Before introducing the specific methods of this application, the application scenarios of this application will be illustrated by example in conjunction with the implementation environment. It should be understood that the following application scenarios are merely illustrative and are not limited to these examples in practice.
[0026] Figure 1 This illustration shows an application scenario of a visual relocation method provided in an embodiment of this application. The scenario includes an image acquisition device 110 and a visual relocation device 120. The visual relocation method provided in this embodiment can be implemented by the visual relocation device 120.
[0027] Image acquisition device 110 is used to acquire images of the parking environment. For example, image acquisition device 110 can be a camera mounted on the vehicle, specifically a vehicle-mounted fisheye camera. During route cruising, image acquisition device 110 can acquire environmental images around the vehicle and provide query images for current positioning to visual repositioning device 120.
[0028] The visual relocalization device 120 is used to process information from the query image and the visual map. For example, the visual relocalization device 120 can run a visual relocalization program using a central processing unit, a graphics processing unit, or an onboard intelligent computing processor. The visual relocalization device 120 can guide sampling and pose solving by utilizing the matching between the query image and map information, as well as the observation information accumulated in the map.
[0029] As an example, in a route navigation scenario in an underground parking lot, the visual relocalization device 120 can first load a visual map corresponding to the current route. When the vehicle passes through an entrance, pillar, or parking space area, the image acquisition device 110 can transmit a newly acquired query image to the visual relocalization device 120. The visual relocalization device 120 can perform localization processing using the query image and the visual map, and output the predicted pose of the image acquisition device 110 relative to the visual map.
[0030] Understandable, Figure 1 The visual relocation system architecture shown is merely an example. In other embodiments, the system can be configured with multiple image acquisition devices 110 based on the vehicle's camera configuration, can save multiple visual maps based on the parking route, or multiple computing units can handle the processing work of the visual relocation device 120. This application does not limit the number or deployment method of the above components.
[0031] Based on the above application scenarios, this application provides a visual relocation method. Figure 2 The flow of this method is shown. For example... Figure 2 As shown, the visual repositioning device can perform steps S201 to S204. Each step is explained below.
[0032] S201: Construct the association between the query feature points of the query image and the map points in the visual map.
[0033] The query image can be an image acquired by the image acquisition device during the current positioning process. The visual map can be map data that records visual and spatial information of the parking environment. Query feature points can be represented using two-dimensional or three-dimensional coordinates, and map points can also be represented using two-dimensional or three-dimensional coordinates. The dimensions of query feature points and map points can be determined based on the image acquisition method, the data format of the visual map, and the pose calculation method.
[0034] The following example illustrates how query feature points are represented using two-dimensional coordinates and map points using three-dimensional coordinates. In this example, query feature points can represent a two-dimensional observation of a local location in the query image, while map points can represent the three-dimensional location of the corresponding environmental point in the visual map. For instance, the edge of a pillar in the query image can provide the two-dimensional image location of the query feature point, and the environmental point of the pillar edge recorded in the visual map can provide the three-dimensional location of the map point.
[0035] Accordingly, the association relationship can characterize the two-dimensional image location of a query feature point and the three-dimensional location of a map point. This two-dimensional-three-dimensional association can indicate that the two-dimensional observation in the query image and the three-dimensional environment point in the visual map describe the same environmental location; that is, the two-dimensional image location of the query feature point is the observation location of the corresponding map point in the query image. Each association relationship can include one query feature point and one map point. Query feature points and map points with the same association relationship can be considered as a group of feature points. The target group can be any group of feature points, and the target group includes target feature points and target map points; the target feature points are the query feature points in the target group, and the target map points are the map points in the target group.
[0036] Establishing associations refers to the visual relocalization device determining corresponding map points for query feature points based on information from the query image and visual map, and establishing associations between query feature points and map points. The visual relocalization device can perform this process separately for different query feature points, resulting in multiple sets of feature point groups.
[0037] As an example, a visual relocalization device can obtain query local features from a query image and map local features from map keyframes of a visual map. Query local features can record the image location of query feature points and query local descriptors; map local features can record map local descriptors and their association with map points. The visual relocalization device can match query local features with map local features. For retained matches, the visual relocalization device can obtain corresponding valid map points based on the association between the matched map local features and map points. The visual relocalization device can associate query feature points in the matched query local features with the valid map points to form a set of feature points. The visual relocalization device can perform the same processing on other retained matches to form multiple sets of feature points. The currently processed set can be used as the target set, with the query feature points and valid map points in the target set serving as the target feature points and target map points, respectively. The above local feature matching is only one implementation example for establishing associations and does not limit the specific matching algorithm used.
[0038] S202: For the target group, determine the target sampling probability based on the degree of matching between the target feature points and the local descriptors corresponding to the target map points, as well as the historical observation information of the target map points.
[0039] The query local descriptor corresponding to the target feature point can be derived from query local features that include the target feature point. The map local descriptor corresponding to the target map point can be derived from map local features that match the query local features and are associated with the target map point. The degree of matching between the two local descriptors can characterize the degree of matching between the two local features during this relocalization process. Historical observation information can characterize the observation support obtained by the target map point during the mapping phase. For example, historical observation information can include the number of valid keyframe observations of the target map point.
[0040] Specifically, the target sampling probability can be positively correlated with the degree of matching between local descriptors. That is, given the same historical observation information, a higher degree of matching results in a higher target sampling probability, increasing the likelihood of the target group being selected during the sampling process; conversely, a lower degree of matching results in a lower target sampling probability, decreasing the likelihood of the target group being selected during the sampling process. The target sampling probability can also be positively correlated with the number of effective keyframe observations of the target map point. Given the same degree of matching, a higher number of effective keyframe observations indicates more sufficient historical observation support for the target map point, leading to a higher target sampling probability; conversely, a lower number of effective keyframe observations indicates more limited historical observation support for the target map point, leading to a lower target sampling probability.
[0041] Determining the target sampling probability refers to the process by which a visual relocalization device evaluates a target group based on the degree of matching of its local descriptors and historical observation information of the target map points. The visual relocalization device can also combine the evaluation results of other feature point groups involved in the sampling to determine the sampling probability of the target group relative to the multiple feature point groups participating in the sampling.
[0042] As an example, a visual relocalization device can obtain local descriptor similarity and the number of valid keyframe observations for corresponding map points for target groups participating in sampling. The visual relocalization device can then determine quality weights based on the similarity of the target groups and the number of valid keyframe observations. The device can normalize the quality weights of each group, and determine the target sampling probability as the proportion of the target group's quality weight in the normalized result.
[0043] S203: Based on the target sampling probability, information is sampled from the target feature points and target map points to obtain the sampling results of the target group.
[0044] Target feature points can provide their two-dimensional positions in the query image, while target map points can provide their three-dimensional positions in the visual map. For example, the two-dimensional position of a target feature point can be represented as image coordinates, and the three-dimensional position of a target map point can be represented as world coordinates in the visual map coordinate system. Target feature points and target map points are already grouped into the same target group through association. Information sampling can be performed on the two-dimensional and three-dimensional information corresponding to the target group, and the sampling results of the target group can include the positions of the selected target feature points, the positions of the target map points, and the association between the two.
[0045] During information sampling, the visual relocalization device can treat a target group as a sampling unit and determine the probability of selecting the target group in a single sampling based on the target sampling probability. When the visual relocalization device selects a target group, it can simultaneously acquire information on the target feature points and target map points to form the sampling result for the target group.
[0046] As an example, in a single iteration of the random sampling consistency check, the visual relocalization device can extract the groups needed for pose determination from the feature point groups participating in the sampling, according to the sampling probability of each feature point group. When the target group is extracted, the visual relocalization device can record both the 2D image position of the target feature point and the 3D world coordinates of the target map point into the extracted data. The visual relocalization device can continue to extract other feature point groups to obtain the sampling data required for one pose determination. The above random sampling consistency check process is only one implementation example of information sampling.
[0047] S204: Solve the pose based on the sampling results of the target group to obtain the predicted pose of the image acquisition device.
[0048] The sampling results of the target group can include the two-dimensional position of the selected target feature points, the three-dimensional position of the target map points, and the correlation between the target feature points and the target map points. The predicted pose of the image acquisition device can include the position and orientation of the image acquisition device relative to the visual map. For example, the predicted pose can be represented using rotation and translation information.
[0049] The predicted pose of the image acquisition device can be the pose estimated by considering the query image and the visual map at the moment the query image is acquired. This predicted pose characterizes the position and orientation of the image acquisition device relative to the visual map at the moment the query image is acquired, and may specifically include rotation and translation information.
[0050] Pose determination based on the sampling results of target groups refers to the visual relocalization device using the 2D positions of target feature points and the 3D positions of target map points to calculate the position and orientation of the image acquisition device relative to the visual map. When multiple feature point groups are used sequentially as target groups, the visual relocalization device can aggregate the sampling results of multiple target groups to obtain multiple sets of 2D-3D information required for pose determination. Since the query image is acquired by the image acquisition device, the pose obtained by the visual relocalization device based on the 2D observations in the query image and the 3D positions in the visual map can be used as the predicted pose of the image acquisition device.
[0051] As an example, a visual relocalization device can obtain multiple sets of 2D image positions and 3D world coordinates from sampling results of multiple target groups. Each 2D image position and its corresponding 3D world coordinates can maintain a correspondence. The visual relocalization device can input these multiple sets of 2D image positions and 3D world coordinates into a pose solving algorithm. The pose solving algorithm can calculate the rotation and translation information of the image acquisition device relative to the visual map based on the geometric relationship between the 2D image positions and the 3D world coordinates, and use the calculation result as the predicted pose of the image acquisition device.
[0052] Through the above method, after constructing the association between query feature points and map points, the visual relocalization device can determine the target sampling probability based on the matching degree of local descriptors of the target group and the historical observation information of the target map points. It then obtains the sampling results of the target group based on the target sampling probability and solves the predicted pose of the image acquisition device based on the sampling results. The determination of the target sampling probability considers both the matching degree of local descriptors and the historical observation information of the target map points, which helps to increase the likelihood that the sampling results are suitable for pose solving. By solving the pose based on the above sampling results, the visual relocalization device can reduce invalid sampling and repeated calculations caused by information unfavorable to effective pose solving, shorten the prediction pose solution time, and improve the processing efficiency of visual relocalization.
[0053] Optionally, in another optional embodiment provided by this application, a visual relocation method based on local feature matching to construct association relationships is provided. In this method, step S201 may include: B1. Perform local feature matching on multiple query local features of the query image and multiple map local features in the visual map to obtain local feature pairs that meet the matching conditions. B2. Based on the local feature pairs, construct the association between the query feature points in the query local features and the map points corresponding to the map local features.
[0054] Specifically, query local features can be visual features extracted from local regions of the query image, while map local features can be local visual features stored in a visual map. For example, query local features can include query feature points, response values, and query local descriptors. Query feature points can record two-dimensional locations in the query image, and query local descriptors can describe the visual features of the query image region corresponding to the query feature points. Map local features can include image locations, response values, and map local descriptors.
[0055] Visual maps can store multiple local map features through map keyframes. Specifically, a map keyframe can store a sequence of local features, and each local map feature in the sequence can correspond to a local feature record. Each local feature record can include a local map descriptor and a map point identifier for the associated map point, and can also have a corresponding feature index. The visual relocalization device can locate the corresponding local feature record based on the feature index, and obtain the corresponding map point based on the map point identifier in the local feature record.
[0056] A local feature pair can include a query local feature and a map local feature that satisfy the matching criteria. Local feature matching can first establish a two-dimensional match between the query local feature and the map local feature. For example, a visual relocalization device can determine whether the query local feature and the map local feature satisfy the matching criteria based on the degree of matching between the query local descriptor and the map local descriptor, and record the query local feature and map local feature that satisfy the matching criteria as a local feature pair.
[0057] refer to Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the construction of the association between query feature points and map points, provided in an embodiment of this application. For example... Figure 3 As shown, the visual relocalization device can perform local feature matching between query local features in the query image and map local features in the keyframe layer. Based on the feature index of the matched map local features, the corresponding map points are obtained through the bidirectional observation relationship maintained by the association layer. Thus, the visual relocalization device can associate the two-dimensional image coordinates of the query feature points with the three-dimensional world coordinates of the map points, forming a two-dimensional-three-dimensional association between the query feature points and the map points.
[0058] This application provides a method for constructing association relationships based on local feature matching. Using this method, the visual relocalization device can first determine local feature pairs that meet matching conditions from query local features and map local features. Then, based on the map points corresponding to the map local features, the two-dimensional-two-dimensional matching between the query local features and the map local features is converted into a two-dimensional-three-dimensional association between the query feature points and the map points. Local feature pairs that meet the matching conditions can provide a filtering basis for constructing association relationships, helping to reduce the participation of local features that do not meet the matching conditions in the construction of association relationships. The visual relocalization device also obtains map points based on the records corresponding to the map local features, further reducing the processing required to determine the corresponding map points and improving the efficiency of constructing association relationships.
[0059] Optionally, in another optional embodiment provided by this application, a visual relocalization method based on bidirectional most similarity relationship for filtering local feature pairs is provided. In this method, B1 may include: C1. Perform pairwise similarity calculations on the query local descriptors in multiple query local features and the map local descriptors in multiple map local features to obtain the similarity of multiple local descriptors. The matching degree between the query local descriptor corresponding to the target feature point and the map local descriptor corresponding to the target map point is the local descriptor similarity between the query local descriptor in the query local features corresponding to the target feature point and the map local descriptor in the map local features corresponding to the target map point. C2. Based on the similarity of multiple local descriptors, determine the initial feature pairs that are the most similar objects from multiple query local features and multiple map local features; C3. If the local descriptor similarity of the target feature pair in the initial feature pair is greater than the preset matching threshold, then the target feature pair is regarded as a local feature pair that meets the matching conditions.
[0060] Specifically, query local descriptors and map local descriptors can be in the form of feature vectors. Local descriptor similarity can be used to quantify the degree of similarity between query local descriptors and map local descriptors. Pairwise similarity calculation can refer to the visual relocalization device calculating the similarity between each query local descriptor and each map local descriptor separately. Each local descriptor similarity can correspond to a pair of query local features and a map local feature, and the local descriptor similarities corresponding to different pairs can form multiple local descriptor similarities.
[0061] For example, a visual relocalization device can use cosine similarity to calculate the local descriptor similarity between a query local descriptor and a map local descriptor. Let the first... The query local descriptor is , No. A local map descriptor is The local descriptor similarity between two local descriptors is Then the cosine similarity can be expressed as: ; in, This query represents the inner product between a local descriptor and a map local descriptor. and and represent the L2 norm of the query local descriptor and the map local descriptor, respectively. In the example above, the higher the local descriptor similarity, the more similar the two local descriptors are. The cosine similarity mentioned above is only one implementation example for calculating local descriptor similarity and does not constitute a limitation on the method of calculating local descriptor similarity. When the ... The query local features and the first When a map local feature corresponds to the m-th feature point group, the local descriptor similarity of the m-th feature point group is... Can be taken ,Right now Therefore, in the quality weight formula... It can represent the local descriptor similarity between the query local descriptor corresponding to the m-th feature point group and the map local descriptor.
[0062] The matching degree can be represented by the local descriptor similarity between the local descriptors corresponding to the target feature point and the target map point. Specifically, the query local descriptor corresponding to the target feature point can be a query local descriptor within the query local features that contain the target feature point; the map local descriptor corresponding to the target map point can be a map local descriptor within the map local features corresponding to the target map point.
[0063] The most similar objects refer to a query local feature and a map local feature that are the most similar objects in both matching directions. These most similar objects are also called mutual nearest neighbors. An initial feature pair can include a query local feature and a map local feature that are the most similar objects.
[0064] refer to Figure 4 As shown, Figure 4 This is a schematic diagram illustrating the determination of the most similar objects to each other, as provided in an embodiment of this application. Figure 4 The left side shows several local features of the query. Figure 4The right side shows multiple local map features. The visual relocalization device can determine the most similar object in the direction from a query local feature to a map local feature based on the similarity of multiple local descriptors. The visual relocalization device can also determine the most similar object in the direction from a map local feature to a query local feature for the same query local feature. When the query local feature and map local feature determined in both directions are the same, the visual relocalization device can identify the query local feature and map local feature as the most similar objects and form an initial feature pair. Figure 4 The process of determining one initial feature pair is shown only; other initial feature pairs can be determined in the same way.
[0065] The target feature pair can be an initial feature pair to be determined whether it meets a preset matching threshold. The preset matching threshold can be a numerical condition for judging whether the local descriptor similarity of the target feature pair meets the matching requirements. The visual relocalization device can compare the local descriptor similarity of the target feature pair with the preset matching threshold. When the local descriptor similarity of the target feature pair is greater than the preset matching threshold, the visual relocalization device can retain the target feature pair and use it as a local feature pair that meets the matching conditions. When the local descriptor similarity of the target feature pair does not reach the preset matching threshold, the visual relocalization device can construct the association between the query feature point and the map point without using the target feature pair.
[0066] As an example, when a visual map contains multiple similar-looking pillar local features, a query local feature may have high local descriptor similarity with multiple map local features. The visual relocalization device can determine the map local feature that is most similar to the query local feature from among the multiple map local features by judging the most similar objects in two directions. The visual relocalization device can further compare the local descriptor similarity between two local features with a preset matching threshold, and retain target feature pairs whose local descriptor similarity is greater than the preset matching threshold.
[0067] This application provides a method for filtering local feature pairs based on bidirectional most similarity relationships. Using this method, the visual relocalization device can first utilize multiple local descriptor similarities to determine initial feature pairs that are most similar to each other from two matching directions, and then filter the initial feature pairs using a preset matching threshold. Bidirectional most similarity relationships can reduce the possibility of one-to-many local matching in repetitive texture regions, and the preset matching threshold can reduce the participation of initial feature pairs with low local descriptor similarity in the construction of association relationships. This two-stage filtering helps improve the matching reliability of local feature pairs, reduces invalid processing caused by local features that do not meet matching requirements, and improves the processing efficiency of visual relocalization.
[0068] Optionally, in another optional embodiment provided by this application, a visual relocalization method for determining local map features based on candidate keyframe retrieval is provided. In this method, the visual map may include multiple map keyframes, and the map keyframes may include a global map description and local map features. Before B1, the method may further include: D1. Calculate the global description similarity between the query global description of the query image and the global description of the map of multiple map keyframes; D2. Based on the global description similarity corresponding to the map keyframes, determine a preset number of candidate keyframes from multiple map keyframes; D3. Determine the local map features of the candidate keyframes as multiple local map features.
[0069] Specifically, map keyframes can be image frames in a visual map that store environmental visual information. For example, a memory parking system can select map keyframes from environmental images acquired by an image acquisition device during the route learning phase, and store a global map description and local map features within each keyframe. The global map description can be used to describe the overall scene features of the map keyframe, while the local map features can be used to describe the visual features of the corresponding local areas within the keyframe. Correspondingly, a query global description can be used to describe the overall scene features of a query image. Candidate keyframes can be map keyframes selected from multiple keyframes based on the similarity of their global descriptions.
[0070] In practical applications, visual relocalization devices can employ processing methods adapted to map keyframes, performing cropping, scaling, masking, or contrast adjustments on the query image, and adjusting camera parameters accordingly when image size or coordinates change. Visual relocalization devices can extract a global description of the query through a global scene description network and extract local features through a local feature network. For example, convolutional neural networks can be used for both the global scene description network and the local feature network.
[0071] Global description similarity can be used to quantify the similarity between a query image and map keyframes in terms of overall scene features. For example, when both the query global description and the map global description use feature vectors, the visual relocalization device can use cosine similarity to calculate the global description similarity. The visual relocalization device can arrange multiple map keyframes in descending order of global description similarity and determine a predetermined number of the top-ranked map keyframes as candidate keyframes. The number of candidate keyframes can be less than the total number of map keyframes in the visual map.
[0072] As an implementation example, the visual relocalization device can sequentially read the global map descriptions stored in each map keyframe, calculate the cosine similarity between the query global description and each map global description, and record the identifier of each map keyframe and its corresponding cosine similarity. The visual relocalization device can arrange the identifiers of each map keyframe in descending order of cosine similarity and add a predetermined number of the top-ranked map keyframe identifiers to a candidate keyframe list. The visual relocalization device can then read the local feature sequences stored in the corresponding map keyframes based on the candidate keyframe list and use the local map features in the local feature sequences for local feature matching.
[0073] This application provides a method for determining local map features based on candidate keyframe retrieval. Using this method, the visual relocalization device can first determine a preset number of candidate keyframes from multiple map keyframes by utilizing the global description similarity between the query global description and the map's global description. Then, the local map features in the candidate keyframes are used for local feature matching. Candidate keyframe retrieval can narrow down the visual map range involved in local feature matching, reduce the number of local map features involved in local feature matching, and decrease the corresponding local feature comparison operations, thereby reducing the computational load of the visual relocalization process.
[0074] Optionally, in another optional embodiment provided by this application, a visual relocalization method is provided that determines the sampling probability based on the degree of local descriptor matching and historical observation information of map points. In this method, the number of feature point groups can be M, and the historical observation information of the target map point can be the number of valid keyframe observations of the target map point. S202 may include: E1. For the target group, determine the corresponding quality weight according to the following formula: ; in, For quality weight, For local descriptor similarity, To preset the matching threshold, The number of valid keyframe observations for the target map point. To observe the support saturation parameter, Minimum retention weight; E2. Determine the target sampling probability of the target group based on the quality weights corresponding to the feature point groups.
[0075] Specifically, M can represent the number of feature point groups participating in the sampling, and m can represent the current feature point group used for quality weight calculation. The m-th feature point group can be used as the target group, and the query feature point and map point in the m-th group can be used as the target feature point and target map point, respectively. The visual relocalization device can sequentially use each feature point group participating in the sampling as the target group and determine the corresponding quality weight for each feature point group.
[0076] Local descriptor similarity This can be used to measure the similarity between the query local descriptor corresponding to the target feature point and the map local descriptor corresponding to the target map point, reflecting the degree of matching between the two local descriptors. Valid keyframe observation count. The number of valid keyframes for observing target map points in the visual map can be used to determine the historical multi-view observation support for target map points.
[0077] In the quality weight formula, This can represent descriptor matching items for the target group. Among them, This can indicate that the value within the parentheses is limited to the range of 0 to 1. Visual relocalization devices can first utilize a preset matching threshold. Local descriptor similarity Perform interval mapping, and then apply numerical constraints to the interval mapping results. The descriptor matching terms can increase as the local descriptor similarity increases.
[0078] Historical observation support items It can be adjusted according to the number of valid keyframe observations. The weighting increases with the number of effective keyframe observations and gradually saturates when the number of observations in a large number of effective keyframes is high, reducing the possibility that a few map points with a high number of observations will excessively influence the quality weights. Visual relocalization devices can calculate the product of the descriptor matching term and the historical observation support term, plus the minimum retained weight. The larger value in the middle is determined as the quality weight. This preserves non-zero quality weights for each feature point group.
[0079] Determining the target sampling probability based on the quality weights corresponding to feature point groups can refer to the visual relocalization device normalizing the quality weights of the M feature point groups participating in the sampling. Let the quality weight of the l-th feature point group be... The target sampling probability of the m-th feature point group is The target sampling probability can then be expressed as: ; in, This can represent the sum of the quality weights of the M groups of feature points. Target sampling probability. Quality weights for the target group The proportion of the sum of quality weights. The sum of the sampling probabilities of each feature point group can be 1.
[0080] Quality weights can be used to determine the likelihood of a feature point group participating in the pose calculation sample, but are not directly used as the result of judging whether the predicted pose is correct. Visual relocalization devices can perform pose calculation based on the sampling results and verify the pose calculation results through geometric information. Therefore, local descriptor similarity and historical observation information can be used to guide sampling, and the pose calculation results can still be judged based on geometric information.
[0081] As an implementation example, the visual relocalization device can obtain the local descriptor similarity of M feature point groups and the number of effective keyframe observations of map points, respectively. These two values are then substituted into the quality weight formula to obtain the quality weight of each feature point group. The visual relocalization device can calculate the sum of the M quality weights and divide the quality weight of each feature point group by the sum of the quality weights to obtain the sampling probability of each feature point group. When the m-th feature point group is used as the target group, the normalized result corresponding to the m-th feature point group can be used as the target sampling probability.
[0082] In practical applications, the visual relocalization device can perform sampling without replacement in each iteration of the random sampling consistency test, according to the sampling probability of each feature point group. After a feature point group is sampled, the visual relocalization device can temporarily remove that feature point group from the list of feature point groups to be sampled in the current iteration and redetermine the sampling probability based on the quality weights of the remaining feature point groups. The visual relocalization device can continue to perform sampling until the sampling results include the number of feature point groups required for pose solving. The same feature point group can be sampled at most once in one iteration; at the beginning of the next iteration, the visual relocalization device can re-sample from the M groups of feature points. The above sampling without replacement is only one example of information sampling based on sampling probability.
[0083] This application provides a method for determining sampling probability based on local descriptor matching degree and historical observation information of map points. Using this method, the visual relocalization device can evaluate the matching degree of target groups using local descriptor similarity and evaluate the historical observation support of target map points using the number of effective keyframe observations. The observation support saturation parameter can reduce the possibility of high-observation-number map points excessively influencing sampling, and the minimum retention weight can retain non-zero sampling probabilities for each feature point group. Determining the sampling probability based on quality weights can increase the likelihood of feature point groups with high matching degree and sufficient historical observation support participating in pose calculation samples, reduce redundant calculations caused by invalid sampling, and improve the processing efficiency of visual relocalization.
[0084] Optionally, in another optional embodiment provided by this application, a visual relocalization method for determining pose through candidate pose generation and geometric consistency verification is provided. In this method, step S204 may include: F1. Generate candidate poses based on the sampling results of the target group; F2. Based on the reprojection error of the feature point group under the candidate pose, perform geometric consistency verification on the candidate pose. F3. If the candidate pose passes the geometric consistency verification, the candidate pose is determined as the predicted pose of the image acquisition device.
[0085] Specifically, candidate poses can include rotation and translation information of the image acquisition device relative to the visual map. The visual relocalization device can solve for the rotation and translation information based on the correspondence between the two-dimensional image positions of the query feature points and the three-dimensional world coordinates of the map points in the sampling results, and generate candidate poses.
[0086] Geometric consistency verification can be used to determine whether the spatial transformation relationship described by the candidate pose conforms to the geometric constraints between the two-dimensional observation in the query image and the three-dimensional position in the visual map. Since the sampling results used to generate the candidate pose may contain inaccurate correlations, visual relocalization devices can use other feature point sets to perform geometric consistency verification on the candidate pose.
[0087] Reprojection error can be defined as the difference between the projected position and the 2D position of the corresponding query feature point after a visual relocalization device projects map points onto a query image according to the candidate pose and camera projection model. For example, a visual relocalization device can use the pixel distance between the projected position and the 2D position of the query feature point as the reprojection error of the corresponding feature point group. The smaller the reprojection error, the higher the geometric consistency between the corresponding feature point group and the candidate pose is generally.
[0088] As an implementation example, a visual relocalization device can obtain the correspondence between multiple sets of query feature points and map points from the sampling results. Based on the 2D image positions of the query feature points and the 3D world coordinates of the corresponding map points, it calculates the rotation and translation information of the image acquisition device relative to the visual map to obtain candidate poses. The visual relocalization device can then project the map points from the multiple sets of feature points onto the query image based on the candidate poses and the camera projection model, and calculate the reprojection error between each projected position and the corresponding 2D position of the query feature point. The visual relocalization device can then perform geometric consistency verification on the candidate poses based on the reprojection errors of the multiple sets of feature points. If the candidate poses pass the geometric consistency verification, the visual relocalization device can determine the candidate poses as the predicted poses of the image acquisition device.
[0089] In one possible implementation, the visual relocalization device can generate candidate poses using a maximum likelihood perspective multi-point pose solving algorithm. When the image acquisition device employs a fisheye camera model, the visual relocalization device can utilize the backprojection function of the fisheye camera model to convert query feature points into observation rays, and solve for candidate poses based on the 3D world coordinates of the observation rays and corresponding map points.
[0090] After candidate poses are generated, the visual relocalization device can also determine whether each map point satisfies the positive depth condition under the candidate pose. The visual relocalization device can identify feature point groups whose reprojection error meets the error condition and whose map points meet the positive depth condition as geometric inliers, and accept or reject candidate poses based on the number of geometric inliers.
[0091] After the candidate pose passes geometric consistency verification, the visual relocalization device can use the candidate pose as the initial pose and perform a two-stage reprojection map optimization. The first stage of reprojection map optimization preserves the 3D world coordinates of map points and uses a robust kernel to reduce the impact of geometric outliers on the optimization results. After the first stage is completed, the visual relocalization device can redetermine the geometric inliers based on the reprojection chi-square error and positive depth condition, and then use the redetermined geometric inliers to perform the second stage of reprojection map optimization to obtain the optimized predicted pose.
[0092] When multiple candidate keyframes are obtained from visual map retrieval, the visual relocalization device can sequentially perform association construction, information sampling, candidate pose generation, geometric consistency verification, and reprojection map optimization for each candidate keyframe. When the number of effective geometric inliers reaches the localization success threshold, the visual relocalization device can output the predicted pose of the image acquisition device, the number of effective geometric inliers, and the localization success status. When the number of effective geometric inliers does not reach the localization success threshold, the visual relocalization device can continue processing the next candidate keyframe. When no acceptable pose is obtained from any of the candidate keyframes, the visual relocalization device can output a localization failure status.
[0093] In one experimental example, one frame can be extracted every five frames from an independent relocalization sequence, resulting in 1318 test images. The Random Sample Consensus (RANSAC) and Stability-Aware Consensus Random Sample Consensus (SAC-RANSAC) sampling schemes can use the same visual map, candidate keyframes, local matching threshold, pose solving threshold, maximum number of iterations, and reprojection optimization parameters, differing only in how the minimum sample set is generated. The ground truth pose of the relocalization sequence can be aligned to the coordinate system of the visual map using the same fixed rigid body transformation, maintaining a scale of 1 during the alignment process. This fixed rigid body transformation can be used by both sampling schemes. The relocalization experimental results for the two sampling schemes are shown in Table 1.
[0094] Table 1. Relocation Experiment Results for Different RANSAC Sampling Methods
[0095] Table 1 shows that the average number of iterations for the SAC-RANSAC sampling scheme decreased from 41.77 to 23.56, the average RANSAC time decreased from 2.233 milliseconds to 1.240 milliseconds, and the average number of optimal interior points increased from 91.66 to 98.63. The localization success rate, translation error, and rotation error of the two sampling schemes were quite similar. Specifically, compared to the RANSAC sampling scheme, the translation error of the SAC-RANSAC sampling scheme increased from 0.1571 meters to 0.1576 meters, a change of 0.0005 meters; the rotation error increased from 0.4074 degrees to 0.4077 degrees, a change of 0.0003 degrees. Therefore, under these experimental parameters, the SAC-RANSAC sampling scheme can reduce the number of sampling iterations and the pose calculation time while maintaining a similar localization success rate and pose error.
[0096] Furthermore, to verify the stability of the sampling results under different random seeds, 66 test images were selected, and five sets of random seeds were used for the experiment. The average number of iterations for the SAC-RANSAC sampling scheme and the RANSAC sampling scheme were 17.87 and 22.52, respectively. The localization success rate of the SAC-RANSAC sampling scheme under all five sets of random seeds was 93.94%; the average localization success rate of the RANSAC sampling scheme was 93.64%, and the standard deviation of the localization success rate was 0.61 percentage points. The above experimental results are only used to illustrate the processing results under specific parameter settings and do not constitute a limitation on the embodiments of this application.
[0097] This application provides a method for determining the predicted pose through candidate pose generation and geometric consistency verification. Using this method, the visual relocalization device can utilize the reprojection errors of multiple sets of feature points to verify whether the candidate pose conforms to the geometric constraints between the query image and the visual map, and determine the candidate pose that passes the geometric consistency verification as the predicted pose of the image acquisition device. This reduces the possibility of accepting unreasonable candidate poses due to a small number of erroneous associations, lowers the impact of erroneous associations on the pose solution results, and improves the reliability of the predicted pose of the image acquisition device.
[0098] Optionally, in another optional embodiment provided by this application, a visual relocation method for updating a visual map based on map point update information is provided. In this method, the visual map may include map point update information, and the method may further include: G1. Update map points in the visual map based on map point update information.
[0099] Specifically, map point update information can be used to describe changes to map points. For example, map point update information may include the identifier of the map point to be updated, its merging relationship, replacement relationship, deletion status, or the identifier of the map point after the update. Updating map points in a visual map can refer to modifying the data records of the corresponding map points based on the map point update information.
[0100] As an implementation example, when map points are merged or replaced, the visual relocalization device can update the original map points to an invalid state based on the map point update information and record the updated map points. When map points are deleted, the visual relocalization device can update the corresponding map points to an invalid state. When the visual relocalization device accesses the original map points, it can obtain the updated valid map points based on the replacement relationships; if no available replacement points exist for the original map points, the visual relocalization device can build the association relationship without using the original map points.
[0101] In practical applications, map point data records can also include the number of valid keyframe observations, valid status, and replacement relationships. When map points are merged, replaced, or deleted, the visual relocalization device can update the map point data records and the aforementioned bidirectional observation relationships, and can correspondingly update the number of valid keyframe observations and the co-view relationships between keyframes. After the visual map is loaded, the visual relocalization device can restore the association between local map features and map points based on map point identifiers. During pure relocalization, the visual relocalization device can construct local neighborhood data as needed when neighborhood search is required.
[0102] This application provides a method for updating map points in a visual map based on map point update information. Using this method, the visual relocation device can update the corresponding map points and their associations based on the fusion, replacement, or deletion of map points, reducing the possibility that local map features still point to invalid map points and mitigating the impact of inconsistent map point records on the construction of association relationships.
[0103] refer to Figure 5 As shown, Figure 5 This is a flowchart illustrating a hierarchical visual relocation process provided in an embodiment of this application. Figure 5 As shown, the visual relocalization device can first load a visual map and restore the association between local features and map points in the visual map. The visual relocalization device can preprocess the query image to extract a global description of the query and multiple local features of the query.
[0104] Visual relocalization devices can determine candidate keyframes from multiple map keyframes based on the similarity between the query's global description and the global descriptions of each map keyframe. Global retrieval is used to narrow down the scope of subsequent local feature matching; however, the global retrieval results are not directly used as the final localization result, nor are they used alone as the basis for determining whether localization was successful.
[0105] Visual relocalization devices can perform local feature matching between the query image and candidate keyframes, and obtain corresponding map points based on the matched local map features. After obtaining the map points, their validity and the existence of replacement relationships can be checked, and the currently valid map points can be determined based on the check results. If currently valid map points are obtained, the two-dimensional image coordinates of the query feature points can be associated with the three-dimensional world coordinates of the map points to form a two-dimensional-three-dimensional correspondence; local feature matching results where currently valid map points cannot be obtained can be excluded from pose solving.
[0106] Once the number of 2D-3D correspondences reaches a preset threshold, the visual relocalization device can determine the quality weights of each 2D-3D correspondence based on local descriptor similarity and the number of effective keyframe observations of map points. Sampling is then performed according to these quality weights to solve for the initial pose. The quality weights can guide the generation of the minimum sampling set for the initial pose, while the complete 2D-3D correspondence set can still be used to verify the geometric consistency of the initial pose. When a fisheye camera is used for image acquisition, the camera back-projection function can be used to convert query feature points into observation rays, and the initial pose can be solved based on the spatial relationship between the observation rays and the 3D map points.
[0107] Visual relocalization devices can perform reprojection optimization on the initial pose. During reprojection optimization, only the pose variables of the current image acquisition device can be optimized, while maintaining the 3D world coordinates of each map point. Each reprojection constraint can consist of a 2D observation in the query image and its corresponding 3D map point, and the reprojection residual can be calculated using the camera projection model corresponding to the image acquisition device. In the first stage, a robust kernel can be used to reduce the impact of anomalous matching, and the geometric interior and exterior points can be determined based on the reprojection error and positive depth conditions. In the second stage, only the geometric interior points can be used to further optimize the pose of the current image acquisition device.
[0108] After reprojection optimization, it can be determined whether the number of effective geometric inliers has reached the localization success threshold. If the number of effective geometric inliers reaches the localization success threshold, the predicted pose of the image acquisition device and the localization success status can be output, and the vehicle pose can be determined based on the fixed extrinsic parameters between the image acquisition device and the vehicle. If the number of effective geometric inliers has not reached the localization success threshold and there are still unprocessed candidate keyframes, local feature matching and pose solving can continue for the next candidate keyframe; if no pose that meets the localization success conditions is obtained for all candidate keyframes, a localization failure status can be output.
[0109] In the foregoing Figure 1-5 Based on the corresponding embodiments, Figure 6 This is a schematic diagram of a visual repositioning device provided in an embodiment of this application. The visual repositioning device 600 can be used to execute the visual repositioning method provided in the foregoing embodiments. Figure 6 As shown, the visual repositioning device 600 may include a construction unit 601, a determination unit 602, a sampling unit 603, and a pose solving unit 604.
[0110] The construction unit 601 is used to construct the association between query feature points of the query image and map points in the visual map. The query feature points and map points with the association are called feature point groups, and the target group in the feature point group includes target feature points and target map points.
[0111] The determining unit 602 is used to determine the target sampling probability of the target group based on the degree of matching between the query local descriptor corresponding to the target feature point and the map local descriptor corresponding to the target map point, as well as the historical observation information of the target map point.
[0112] The sampling unit 603 is used to sample information from the target feature points and the target map points according to the target sampling probability to obtain the sampling results of the target group.
[0113] The pose solving unit 604 is used to solve the pose based on the sampling results of the target group to obtain the predicted pose of the image acquisition device. The query image is an image acquired by the image acquisition device.
[0114] Optionally, in the above Figure 6 Based on the corresponding embodiments, in another embodiment of the visual repositioning device 600 provided in this application, the building unit 601 may include: The local feature matching unit is used to perform local feature matching between multiple query local features of the query image and multiple map local features in the visual map to obtain local feature pairs that meet the matching conditions. The association construction unit is used to construct the association between the query feature points in the query local features and the map points corresponding to the map local features based on the local feature pairs.
[0115] Optionally, based on the above embodiments, in another embodiment of the visual relocalization device 600 provided in this application, the local feature matching unit may include: The local similarity calculation unit is used to perform pairwise similarity calculations on the query local descriptors in the plurality of query local features and the map local descriptors in the plurality of map local features, respectively, to obtain multiple local descriptor similarities. The matching degree between the query local descriptor corresponding to the target feature point and the map local descriptor corresponding to the target map point is the local descriptor similarity between the query local descriptor in the query local features corresponding to the target feature point and the map local descriptor in the map local features corresponding to the target map point. An initial feature pair determination unit is used to determine, based on the similarity of the plurality of local descriptors, an initial feature pair that is the most similar to each other from the plurality of query local features and the plurality of map local features; The local feature pair determination unit is used to determine the target feature pair as a local feature pair that satisfies the matching condition when the local descriptor similarity of the target feature pair in the initial feature pair is greater than a preset matching threshold.
[0116] Optionally, in the above Figure 6 Based on the corresponding embodiments, in another embodiment of the visual relocalization device 600 provided in this application, the visual map includes multiple map keyframes, and the map keyframes include a global map description and local map features. The visual relocalization device 600 may further include: A global similarity calculation unit is used to calculate the global description similarity between the global description of the query image and the global description of the map of the plurality of map keyframes. The candidate keyframe determination unit is used to determine a preset number of candidate keyframes from the plurality of map keyframes according to the global description similarity corresponding to the map keyframes. A map local feature determination unit is used to determine the map local features of the candidate keyframe as the plurality of map local features for local feature matching.
[0117] Optionally, in the above Figure 6 Based on the corresponding embodiment, in another embodiment of the visual relocalization device 600 provided in this application, the number of feature point groups is M, and the historical observation information of the target map point is the number of effective keyframe observations of the target map point. The determining unit 602 may include: The quality weight determination unit is used to determine the quality weight corresponding to the target group according to the following formula: , in, For the quality weight, For local descriptor similarity, To preset the matching threshold, The number of valid keyframe observations for the target map point. To observe the support saturation parameter, Minimum retention weight; The sampling probability determination unit is used to determine the target sampling probability of the target group based on the quality weight corresponding to the feature point group.
[0118] Optionally, in the above Figure 6 Based on the corresponding embodiments, in another embodiment of the visual relocalization device 600 provided in this application, the pose solving unit 604 may include: A candidate pose generation unit is used to generate candidate poses based on the sampling results of the target group; A geometric consistency verification unit is used to perform geometric consistency verification on the candidate pose based on the reprojection error of the feature point group under the candidate pose. The predicted pose determination unit is used to determine the candidate pose as the predicted pose of the image acquisition device when the candidate pose passes the geometric consistency verification.
[0119] Optionally, in the above Figure 6 Based on the corresponding embodiments, in another embodiment of the visual relocation device 600 provided in this application, the visual map includes map point update information. The visual relocation device 600 may further include: The map point update unit is used to update the map points in the visual map according to the map point update information.
[0120] After establishing the association between query feature points and map points, the visual relocalization device determines the target sampling probability based on the matching degree of local descriptors of the target group and the historical observation information of the target map points. It then obtains the sampling results of the target group based on these probabilities and uses them to solve for the predicted pose of the image acquisition device. The determination of the target sampling probability considers both the matching degree of local descriptors and the historical observation information of the target map points, which helps increase the likelihood that the sampling results are suitable for pose calculation. The visual relocalization device solves for pose based on these sampling results, reducing invalid sampling and redundant calculations caused by information unfavorable to effective pose calculation, shortening the prediction pose solution time, and improving the processing efficiency of visual relocalization.
[0121] This application also provides a computer device. The aforementioned apparatus can be configured in this computer device. The computer device may include a terminal device or a server, and can implement the steps of the methods described in the foregoing embodiments by running a computer program. The following is in conjunction with... Figure 6 The hardware structure of the computer device will be described.
[0122] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 7 As shown, the computer device 800 may include a processor 810, a storage device 820, a sensor 830, an output unit 840, a power management unit 850, an input unit 860, a memory 870, and a communication unit 880. Figure 7 The various components shown can be directly or indirectly connected to the processor 810 through corresponding interfaces or lines to realize data transmission and function calls under the control of the processor 810.
[0123] The processor 810 can serve as the control center of the computer device 800. The processor 810 can control various components in the computer device 800 to perform corresponding functions by running computer programs and calling corresponding data. The processor 810 may include one or more processing units. For example, the processor 810 may include at least one of a central processing unit, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices.
[0124] To provide computer programs and data to processor 810, computer device 800 may include storage device 820 and memory 870. Storage device 820 may store computer program 821 and data 822. Computer program 821 may include program instructions executable by processor 810, and data 822 may include data that needs to be read, generated, or processed during the execution of computer program 821. Storage device 820 may include hard disk, solid-state drive, flash memory, or other non-volatile storage devices.
[0125] The memory 870 can be used to temporarily store program instructions, data to be processed, or intermediate processing results required by the processor 810 when running the computer program 821. The memory 870 may include at least one of random access memory, read-only memory, or cache memory. In actual operation, the processor 810 can load the computer program 821 from the storage device 820 into the memory 870, and can perform corresponding data processing functions by executing the computer program 821 loaded into the memory 870.
[0126] During the execution of computer program 821 by processor 810, computer device 800 can acquire information to be processed through input unit 860, sensor 830, or communication 880. Input unit 860 can be used to receive input information and may include a touch panel, keyboard, or other input device 861. Other input device 861 may include at least one of a mouse, buttons, microphone, camera device, or external data acquisition device.
[0127] Sensor 830 can be used to collect status information of the computer device 800 itself or the environment in which the computer device 800 is located. For example, sensor module 830 may include at least one of an image sensor, a temperature sensor, a position sensor, or a motion sensor. The computer device 800 may or may not include sensor 830 according to actual functional requirements.
[0128] Communication 880 can be used for data communication between computer device 800 and other devices. Communication 880 may include at least one of wired communication 881 and wireless communication 882. Wired communication 881 can transmit data through an Ethernet interface, a universal serial bus interface, a serial communication interface, or other wired communication interfaces. Wireless communication 882 can transmit data through a wireless local area network, a cellular communication network, a Bluetooth communication network, or other wireless communication networks.
[0129] After processing the acquired information, the processor 810 can output the processing results through the output unit 840 or the communication 880. The output unit 840 may include a display panel 841. The display panel 841 can display the operating interface, operating status, or processing results of the computer device 800. The output unit 840 may also include an audio output device, an indicator device, or other output devices.
[0130] To ensure the normal operation of the aforementioned components, the computer device 800 may also include a power management system 850. The power management system 850 can provide operating power to the processor 810, storage device 820, sensor 830, output unit 840, input unit 860, memory 870, and communication system 880, and can manage the power supply voltage, power supply current, or battery status of the computer device 800.
[0131] In this embodiment, the computer program 821 may include program instructions for performing the aforementioned methods. When the processor 810 executes the computer program 821, it can implement the steps of the methods described in any of the foregoing embodiments. Therefore, the computer device 800 can implement the methods described in any of the foregoing embodiments.
[0132] It should be noted that, Figure 7 The structure shown does not constitute a limitation on the computer device 800. The computer device 800 may include, but is not limited to, other types of devices. Figure 7 The components shown can be combined with more or fewer components. Figure 7 The components shown may be partial or arranged differently. Figure 7 The connections between the components shown are only for illustrating that the components can transmit data or control information, and do not limit the components to adopt specific methods. Figure 7 The connection method is shown.
[0133] The computer device 800 can be either a terminal device or a server. When the computer device is a server, it can also employ... Figure 8 The server structure is shown below. (Followed by...) Figure 8 The hardware structure of the server will be explained.
[0134] When the computer device is a server, the computer device can use Figure 8 The hardware structure is shown. Figure 8 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Figure 8 As shown, server 900 may include processor 910, memory 920, communication interface 930, computer-readable storage medium 940, input / output interface 950, and system bus 960. The various components can transmit data via system bus 960.
[0135] Computer-readable storage medium 940 can store computer program 941. Processor 910 can read computer program 941 from computer-readable storage medium 940 and load data required for the execution of computer program 941 into memory 920. By executing computer program 941, processor 910 can control server 900 to perform corresponding data processing operations. Computer-readable storage medium 940 may include hard disk, solid-state drive, flash memory, optical disk, or other media capable of storing computer programs.
[0136] Server 900 can receive data or processing requests from other devices through communication interface 930, and can send processing results to other devices. Input / output interface 950 can be used to connect input devices, output devices, or other external devices. Communication interface 930 may include at least one of wired communication interface and wireless communication interface.
[0137] In this embodiment, when the processor 910 executes the computer program 941, it can implement the steps of the method described in any of the foregoing embodiments. The server 900 can execute the foregoing method independently or communicate with other devices to provide services such as data storage, data processing, or result analysis.
[0138] Server 900 can be a standalone physical server, or it can be a server cluster, a distributed system, or a cloud server. Figure 8 The structure shown does not constitute a limitation on server 900, which may include more than Figure 8 The number of components shown may be more or less, and the same as the components can be used. Figure 8 Different component configurations.
[0139] This application also provides a storage medium for storing a computer program for executing the methods provided in the above embodiments.
[0140] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0141] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding” and any variations thereof are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0142] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0143] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a server or terminal device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing computer programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0144] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments.
[0145] The above-described embodiments are merely illustrative of the technical solutions of this application and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. Moreover, based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods.
Claims
1. A visual relocalization method, characterized in that, The method includes: Construct the association between query feature points of the query image and map points in the visual map. The query feature points and map points with the association are called feature point groups. The target group in the feature point group includes target feature points and target map points. For the target group, the target sampling probability of the target group is determined based on the matching degree between the query local descriptor corresponding to the target feature point and the map local descriptor corresponding to the target map point, as well as the historical observation information of the target map point. Based on the target sampling probability, information is sampled from the target feature points and the target map points to obtain the sampling results of the target group; The pose is solved based on the sampling results of the target group to obtain the predicted pose of the image acquisition device, and the query image is the image acquired by the image acquisition device.
2. The method according to claim 1, characterized in that, The association between the query feature points of the constructed query image and the map points in the visual map includes: Local feature matching is performed between multiple query local features of the query image and multiple map local features in the visual map to obtain local feature pairs that meet the matching conditions. Based on the local feature pairs, construct the association between the query feature points in the query local features and the map points corresponding to the map local features.
3. The method according to claim 2, characterized in that, The step of performing local feature matching between multiple query local features of the query image and multiple map local features in the visual map to obtain local feature pairs that satisfy the matching conditions includes: The query local descriptors in the multiple query local features and the map local descriptors in the multiple map local features are respectively subjected to pairwise similarity calculation to obtain multiple local descriptor similarities. The matching degree between the query local descriptor corresponding to the target feature point and the map local descriptor corresponding to the target map point is the local descriptor similarity between the query local descriptor in the query local features corresponding to the target feature point and the map local descriptor in the map local features corresponding to the target map point. Based on the similarity of the multiple local descriptors, an initial feature pair that is the most similar to each other is determined from the multiple query local features and the multiple map local features; If the local descriptor similarity of the target feature pair in the initial feature pair is greater than the preset matching threshold, then the target feature pair is regarded as a local feature pair that satisfies the matching condition.
4. The method according to claim 2, characterized in that, The visual map includes multiple map keyframes, each keyframe including a global map description and local map features; before performing local feature matching between the multiple query local features of the query image and the multiple local map features in the visual map to obtain local feature pairs that satisfy the matching conditions, the method further includes: Calculate the global description similarity between the global description of the query image and the global description of the map of the plurality of map keyframes; Based on the global description similarity corresponding to the map keyframes, a preset number of candidate keyframes are determined from the plurality of map keyframes; The map local features of the candidate keyframes are determined as the plurality of map local features.
5. The method according to claim 1, characterized in that, The number of feature point groups is M, and the historical observation information of the target map points is the number of effective keyframe observations of the target map points. For the target group, the target sampling probability is determined based on the matching degree between the query local descriptor corresponding to the target feature point and the map local descriptor corresponding to the target map point, as well as the historical observation information of the target map points. This includes: For the target group, the corresponding quality weight is determined according to the following formula: , in, For the quality weight, For local descriptor similarity, To preset the matching threshold, The number of valid keyframe observations for the target map point. To observe the support saturation parameter, Minimum retention weight; The target sampling probability of the target group is determined based on the quality weights corresponding to the feature point group.
6. The method according to any one of claims 1 to 5, characterized in that, Based on the sampling results of the target group, the pose is solved to obtain the predicted pose of the image acquisition device, including: Candidate poses are generated based on the sampling results of the target group; Based on the reprojection error of the feature point group under the candidate pose, the geometric consistency of the candidate pose is verified. If the candidate pose passes the geometric consistency verification, the candidate pose is determined as the predicted pose of the image acquisition device.
7. The method according to any one of claims 1 to 5, characterized in that, The visual map includes map point update information; the method further includes: Update the map points in the visual map based on the map point update information.
8. A visual repositioning device, characterized in that, The device includes: The construction unit is used to construct the association between query feature points of the query image and map points in the visual map. The query feature points and map points with the association are called feature point groups, and the target group in the feature point group includes target feature points and target map points. The determining unit is configured to determine the target sampling probability of the target group based on the degree of matching between the query local descriptor corresponding to the target feature point and the map local descriptor corresponding to the target map point, as well as the historical observation information of the target map point. A sampling unit is used to sample information from the target feature points and the target map points according to the target sampling probability, and obtain the sampling result of the target group; The pose solving unit is used to solve the pose based on the sampling results of the target group to obtain the predicted pose of the image acquisition device, wherein the query image is the image acquired by the image acquisition device.
9. A computer device, characterized in that, The computer device includes a memory and a processor: The memory is used to store computer programs; The processor is used to implement the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer-readable storage medium is used to store a computer program that, when executed by a computer device, implements the method of any one of claims 1 to 7.
