A visual positioning method based on hierarchical aggregation alignment network and co-view set optimization
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2026-03-23
- Publication Date
- 2026-07-14
Smart Images

Figure CN122391580A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of computer vision, intelligent perception and mobile computing, and specifically relates to a visual localization method based on hierarchical aggregation alignment network (GALANet) and common view set mask edge sample consistency (CV-MAGSAC). Background Technology
[0002] With the widespread adoption of high-performance mobile terminals and the extensive application of location-based services, high-precision positioning technology has become increasingly important. While traditional positioning systems typically rely on radio frequency technologies such as ultra-wideband, wireless fidelity, RFID, and Bluetooth, these methods are often limited by high deployment costs, limited effective range, and multipath propagation. In contrast, visual positioning technology, which can be deployed at low cost and without infrastructure by utilizing cameras commonly found on standard mobile terminals, has become a highly attractive alternative. Its advantages of low hardware cost, high accuracy potential, and strong scene understanding capabilities make it a key technology widely studied in modern location services. Visual positioning methods can generally be divided into model reconstruction-based methods and retrieval-based methods. Model reconstruction-based methods require reconstructing a 3D model from a 2D image, which is not only costly in terms of map building and maintenance but also significantly increases the time required for online model inference. Therefore, retrieval-based methods are favored because they eliminate the complex process of constructing a complex explicit 3D geometric model, enabling efficient and accurate positioning on computationally limited mobile devices. This positioning process typically includes three core steps: offline feature database construction, online image retrieval, and location estimation.
[0003] However, existing retrieval-based visual localization technologies still face significant challenges in practical applications. In the image retrieval stage, current methods often employ traditional feature encoding or directly extract global descriptors using neural networks. However, these two approaches lack robustness in the face of drastic changes in lighting and dynamic object occlusion, easily leading to feature representation failure. Furthermore, strategies relying solely on global features often neglect crucial local spatial structure information used to distinguish similar environments, thus causing perceptual aliasing in similar scenes. Although existing research has proposed two-stage retrieval methods incorporating local feature reordering, these typically require cumbersome and time-consuming geometric consistency checks, severely limiting the overall system efficiency. Moreover, in the location estimation stage following image retrieval, the widely used method based on calculating the fundamental matrix from two-dimensional images is highly sensitive to feature matching noise and outliers introduced by non-co-view regions. Even with the introduction of robust algorithms such as random sampling consistency to remove outliers, the large number of outliers generated in non-viewpoint overlap regions still forces the algorithm to perform massive random sampling and iterations, resulting in a surge in computational overhead. This severely limits the overall estimation efficiency and real-time performance of the localization system. Summary of the Invention
[0004] The purpose of this invention is to provide a visual localization method based on a hierarchical aggregation alignment network and common view set optimization. In the offline stage, an image database is constructed, deep features are extracted from a compact convolutional network (CCT), and a NetVLAD layer is added to aggregate the deep features into a global feature descriptor. Furthermore, since directly utilizing the global aggregated features generated by the deep network often loses spatial structural information of image details, leading to perceptual aliasing in scenes with repetitive textures, we introduce a Local Alignment Algorithm (DGLA) based on the Improved Longest Common Subsequence Guided Alignment. This algorithm uses a "soft" alignment strategy to mine the correspondences of local features in the horizontal and vertical directions and reorder them. Finally, to address the problems of mismatches caused by feature points in non-common view regions and computational redundancy in the fine localization stage, a "common view set" is constructed between images using common view prior information to pre-remove outliers in non-common view regions, and the MAGSAC edge sampling algorithm is integrated to achieve fast and high-precision pose calculation.
[0005] The present invention describes a visual localization method based on a hierarchical aggregation alignment network and common view set optimization. Figure 1 and Figure 2 The flowchart and system framework diagram of this invention include the following steps:
[0006] Step 1: Perform multi-dimensional environment modeling in the target scene (such as an indoor corridor, campus area, or large street), and deploy a number of reference points (RPs) with known locations, denoted as the set. Each reference point is obtained using high-precision measuring equipment. Precise three-dimensional coordinates in the world coordinate system To ensure the completeness and robustness of the offline database, multi-view image acquisition was performed at each reference point using a mobile terminal, specifically including: every... Take a horizontal panoramic image to capture the panoramic features, as well as a downward-sloping view. Top-down views were captured from different angles to extract ground details. Furthermore, the process was repeated at different times of day, such as early morning, noon, and evening, to cover environmental changes under varying lighting conditions, and precise pose labels were added to each acquired image.
[0007] Step 2: Construction and feature extraction of the hierarchical aggregation alignment network (GALANet). For example... Figure 3The diagram shows the GALANT network framework. To extract features that can transcend temporal and spatial changes from massive images, this invention constructs the GALANT backbone architecture. Traditional convolutional neural networks (CNNs) are limited by their local receptive fields and are prone to failure when faced with large-area dynamic occlusion (such as pedestrians in a corridor) due to the destruction of local features. While visual transformers (ViTs) can capture global dependencies, they are prone to overfitting on small- to medium-sized localization datasets and are insensitive to positional information. Therefore, this invention uses compact convolutional transformers (CCTs) as the core of feature extraction. Specifically, the following steps are included:
[0008] Step 2 (a): Construct the backbone architecture of the hierarchical aggregation alignment network (GALANet) based on the compact convolutional Transformer (CCT). The images obtained in Step 1 are then uniformly processed into... The image resolution is then input into the network. First, a convolutional tokenizer is used to process the image. The mapping is a sequence of feature tokens, expressed as follows:
[0009] (1)
[0010] Subsequently, the token sequence is fed into a multi-layer Transformer encoder, which uses a self-attention mechanism to capture long-range dependencies between image regions. The core calculation formula is as follows:
[0011] (2)
[0012] Through this step, the network is able to extract feature maps containing deep semantic information. This provides basic data support for subsequent global aggregation and local alignment.
[0013] Step Two (II): Differentiable Aggregation and Coarse Screening of NetVLAD Global Features. Traditional VLAD algorithms employ hard assignment, meaning each local feature is assigned only to its nearest cluster center. However, in backpropagation, the hard assignment function is discontinuous, making end-to-end gradient updates impossible. To address this issue, this invention introduces a NetVLAD layer to aggregate and coarsely screen differentiable features from local features. Cluster centers The affiliation degree is defined as a soft assignment based on Softmax:
[0014] (3)
[0015] Among them, weight and bias All are trainable parameters. The core logic lies in: when the features... Distance from cluster center The closer the difference is, the higher its weight, thus making the residual aggregation process smoother and differentiable.
[0016] Step Two (Three): Global Descriptor Generation and Retrieval. Calculate the weighted residual sum to generate the final NetVLAD global descriptor. :
[0017] (4)
[0018] The generated descriptor is reduced to 384 dimensions by a fully connected layer and then PCA whitening is performed to remove redundant correlations between dimensions. During online localization, the system calculates the Euclidean distance between the query image and all images in the offline database, and selects the top-10 images with the smallest distances as candidate locations. This "fingerprint matching" method greatly reduces the search space for pose calculation.
[0019] Step 3: Local feature alignment and reordering based on the DGLA algorithm. For example... Figure 4 The image shown is an example of a local feature alignment sequence calculated by the DGLA algorithm. In scenarios such as long corridors, the visual appearance of different reference points is highly similar, and relying solely on global vectors can easily lead to false retrieval. This invention proposes an improved Longest Common Subsequence (LCSS)-guided Local Alignment Algorithm (DGLA) for geometric reordering.
[0020] Step 3 (a): Traditional LCSS algorithms require two elements to be strictly equal (0 or 1), which is difficult to achieve in noisy visual descriptors. This invention designs a dual-threshold "soft similarity" scoring mechanism. For feature sequences x and y, a cumulative score matrix M is constructed:
[0021] (5)
[0022] in, To query the Euclidean distance between local features of the query image and the reference image, and These represent the maximum and minimum values of the distance matrix, respectively. This algorithm employs a "soft" alignment strategy to accurately measure the physical similarity between two images even in the presence of dynamic occlusion. By finding the longest matching path in spatial location, it automatically filters out randomly distributed dynamic interference in the background, ensuring that the alignment score truly reflects the geometric consistency of the physical scene.
[0023] Step 3 (II) Joint Loss Training and Optimization. Define the global-local joint triplet loss function. This is used to optimize network parameters. The loss function combines the discriminative power of global features with the geometric constraints of local alignment.
[0024] (6)
[0025] Its physical meaning is: through Zoom in on geographically proximate image pairs, while utilizing... Punish "negative examples" that have similar global features but conflicting local geometry, thereby eliminating the risk of perceptual aliasing during the training phase.
[0026] Step 4: Fine pose estimation based on common view set mining and CV-MAGSAC model optimization. Figure 5 This diagram illustrates the process of mining the common view set and determining the maximum overlap region in an image. During the fine-tuning stage, non-common view regions caused by viewpoint changes generate numerous mismatched points, severely interfering with the accuracy and efficiency of the geometric model fitting. This invention utilizes the local alignment prior provided by DGLA to mine deep geometrically consistent regions and combines it with the MAGSAC algorithm to recover the camera pose.
[0027] Step 4 (a): Using the DGLA alignment prior information obtained in Step 4, define the common view set S. Point pairs within this set must satisfy both the fixed difference constraint on pixel coordinates and the continuously decreasing constraint.
[0028] (7)
[0029] Subsequently, the "maximum common view set" is extracted by maximizing the cardinality. :
[0030] (8)
[0031] Similarly, And obtained through edge expansion and Finally, the input point set is generated. By extracting the largest common-view set fragment, the system can pre-remove more than 50% of invalid feature points. This strategy of "pre-judging the region and then fine-matching" is the core of improving localization efficiency.
[0032] Step 4 (II): Iterative Solution of the CV-MAGSAC Model. The improved CV-MAGSAC algorithm is integrated onto the purified feature point set. CV-MAGSAC introduces a noise marginalization mechanism to solve for the optimal basis matrix. Noise Model and Residual Distribution: The algorithm assumes a noise level of... It is a random variable that follows an interval Uniform distribution within. For a given noise Assuming the residual components of the interior points in n-dimensional space (n=2) are independent and follow a normal distribution, then the total geometric residual is... obey Vikas-square distribution. Point About the model residual probability density function Represented as:
[0033] (9)
[0034] in, The normalization constant is Gamma function. Marginalization likelihood function: used to eliminate the likelihood of a specific... The algorithm calculates the noise level for each data point by performing a weighted integral over all possible noise levels. The marginal likelihood probability. Let . For point-to-point model The geometric distance is then the point Marginal probability of being identified as an interior point for:
[0035] (10)
[0036] Step 5: Input the test image into the trained model, match it with images in the database, output the best matching image, and obtain the corresponding GPS location information. Utilize a multi-source information fusion model to output the final six-degree-of-freedom (6-DoF) pose. Based on the known positions of the Top-k reference points and the calculated relative pose, construct a distance minimization objective function:
[0037] (11)
[0038] Among them, weight The local alignment score is determined by the output of the DGLA stage. By solving this system of linear equations, the user's precise position coordinates in the global coordinate system are obtained. This method, while ensuring sub-meter level positioning accuracy, improves the computational efficiency of pose estimation by nearly 2 times by utilizing a common view set pre-screening mechanism, ultimately achieving stable and continuous visual positioning services.
[0039] Beneficial effects
[0040] This invention starts with image matching and visual localization techniques. First, multiple geographic reference points are deployed in the experimental area and the training and test sets are divided according to a spatial separation protocol. Second, a hierarchical aggregation alignment network GALANet with a compact convolutional Transformer as its backbone is constructed to collaboratively learn the global discriminative features and local alignment relationships of images. Finally, after performing preliminary screening using global features, a local alignment algorithm is introduced for reordering, and common view set mining is combined to perform fast pose estimation, thereby significantly improving the accuracy and efficiency of localization. Attached Figure Description
[0041] Figure 1 This is a flowchart of the present invention;
[0042] Figure 2 This is a system framework diagram of the present invention;
[0043] Figure 3 Diagram of the GALANet network framework
[0044] Figure 4 Example image of local feature alignment sequence calculated by the DGLA algorithm
[0045] Figure 5 A schematic diagram for mining common view sets and determining the maximum overlap region in images. Detailed Implementation Plan
[0046] The purpose of this invention is to provide a visual localization method based on a hierarchical aggregation alignment network and common view set optimization. In the offline stage, an image database is constructed, deep features are extracted from a compact convolutional network (CCT), and a NetVLAD layer is added to aggregate the deep features into a global feature descriptor. Furthermore, since directly utilizing the global aggregated features generated by the deep network often loses spatial structural information of image details, leading to perceptual aliasing in scenes with repetitive textures, we introduce a Local Alignment Algorithm (DGLA) based on the Improved Longest Common Subsequence Guided Alignment. This algorithm uses a "soft" alignment strategy to mine the correspondences of local features in the horizontal and vertical directions and reorder them. Finally, to address the problems of mismatches caused by feature points in non-common view regions and computational redundancy in the fine localization stage, a "common view set" is constructed between images using common view prior information to pre-remove outliers in non-common view regions, and the MAGSAC edge sampling algorithm is integrated to achieve fast and high-precision pose calculation.
[0047] The present invention describes a visual localization method based on a hierarchical aggregation alignment network and common view set optimization. Figure 1 and Figure 2 The flowchart and system framework diagram of this invention include the following steps:
[0048] Step 1: Perform multi-dimensional environment modeling in the target scene (such as an indoor corridor, campus area, or large street), and deploy a number of reference points (RPs) with known locations, denoted as the set. Each reference point is obtained using high-precision measuring equipment. Precise three-dimensional coordinates in the world coordinate system To ensure the completeness and robustness of the offline database, multi-view image acquisition was performed at each reference point using a mobile terminal, specifically including: every... Take a horizontal panoramic image to capture the panoramic features, as well as a downward-sloping view. Top-down views were captured from different angles to extract ground details. Furthermore, the process was repeated at different times of day, such as early morning, noon, and evening, to cover environmental changes under varying lighting conditions, and precise pose labels were added to each acquired image.
[0049] Step 2: Construction and feature extraction of the hierarchical aggregation alignment network (GALANet). For example... Figure 3 The diagram shows the GALANT network framework. To extract features that can transcend temporal and spatial changes from massive images, this invention constructs the GALANT backbone architecture. Traditional convolutional neural networks (CNNs) are limited by their local receptive fields and are prone to failure when faced with large-area dynamic occlusion (such as pedestrians in a corridor) due to the destruction of local features. While visual transformers (ViTs) can capture global dependencies, they are prone to overfitting on small- to medium-sized localization datasets and are insensitive to positional information. Therefore, this invention uses compact convolutional transformers (CCTs) as the core of feature extraction. Specifically, the following steps are included:
[0050] Step 2 (a): Construct the backbone architecture of the hierarchical aggregation alignment network (GALANet) based on the compact convolutional Transformer (CCT). The images obtained in Step 1 are then uniformly processed into... The image resolution is then input into the network. First, a convolutional tokenizer is used to process the image. The mapping is a sequence of feature tokens, expressed as follows:
[0051] (1)
[0052] Subsequently, the token sequence is fed into a multi-layer Transformer encoder, which uses a self-attention mechanism to capture long-range dependencies between image regions. The core calculation formula is as follows:
[0053] (2)
[0054] Through this step, the network is able to extract feature maps containing deep semantic information. This provides basic data support for subsequent global aggregation and local alignment.
[0055] Step Two (II): Differentiable Aggregation and Coarse Screening of NetVLAD Global Features. Traditional VLAD algorithms employ hard assignment, meaning each local feature is assigned only to its nearest cluster center. However, in backpropagation, the hard assignment function is discontinuous, making end-to-end gradient updates impossible. To address this issue, this invention introduces a NetVLAD layer to aggregate and coarsely screen differentiable features from local features. Cluster centers The affiliation degree is defined as a soft assignment based on Softmax:
[0056] (3)
[0057] Among them, weight and bias All are trainable parameters. The core logic lies in: when the features... Distance from cluster center The closer the difference is, the higher its weight, thus making the residual aggregation process smoother and differentiable.
[0058] Step Two (Three): Global Descriptor Generation and Retrieval. Calculate the weighted residual sum to generate the final NetVLAD global descriptor. :
[0059] (4)
[0060] The generated descriptor is reduced to 384 dimensions by a fully connected layer and then PCA whitening is performed to remove redundant correlations between dimensions. During online localization, the system calculates the Euclidean distance between the query image and all images in the offline database, and selects the top-10 images with the smallest distances as candidate locations. This "fingerprint matching" method greatly reduces the search space for pose calculation.
[0061] Step 3: Local feature alignment and reordering based on the DGLA algorithm. For example... Figure 4 The image shown is an example of a local feature alignment sequence calculated by the DGLA algorithm. In scenarios such as long corridors, the visual appearance of different reference points is highly similar, and relying solely on global vectors can easily lead to false retrieval. This invention proposes an improved Longest Common Subsequence (LCSS)-guided Local Alignment Algorithm (DGLA) for geometric reordering.
[0062] Step 3 (a): Traditional LCSS algorithms require two elements to be strictly equal (0 or 1), which is difficult to achieve in noisy visual descriptors. This invention designs a dual-threshold "soft similarity" scoring mechanism. For feature sequences x and y, a cumulative score matrix M is constructed:
[0063] (5)
[0064] in, To query the Euclidean distance between local features of the query image and the reference image, and These represent the maximum and minimum values of the distance matrix, respectively. This algorithm employs a "soft" alignment strategy to accurately measure the physical similarity between two images even in the presence of dynamic occlusion. By finding the longest matching path in spatial location, it automatically filters out randomly distributed dynamic interference in the background, ensuring that the alignment score truly reflects the geometric consistency of the physical scene.
[0065] Step 3 (II) Joint Loss Training and Optimization. Define the global-local joint triplet loss function. This is used to optimize network parameters. The loss function combines the discriminative power of global features with the geometric constraints of local alignment.
[0066] (6)
[0067] Its physical meaning is: through Zoom in on geographically proximate image pairs, while utilizing... Punish "negative examples" that have similar global features but conflicting local geometry, thereby eliminating the risk of perceptual aliasing during the training phase.
[0068] Step 4: Fine pose estimation based on common view set mining and CV-MAGSAC model optimization. Figure 5 This diagram illustrates the process of mining the common view set and determining the maximum overlap region in an image. During the fine-tuning stage, non-common view regions caused by viewpoint changes generate numerous mismatched points, severely interfering with the accuracy and efficiency of the geometric model fitting. This invention utilizes the local alignment prior provided by DGLA to mine deep geometrically consistent regions and combines it with the MAGSAC algorithm to recover the camera pose.
[0069] Step 4 (a): Using the DGLA alignment prior information obtained in Step 4, define the common view set S. Point pairs within this set must satisfy both the fixed difference constraint on pixel coordinates and the continuously decreasing constraint.
[0070] (7)
[0071] Subsequently, the "maximum common view set" is extracted by maximizing the cardinality. :
[0072] (8)
[0073] Similarly, And obtained through edge expansion and Finally, the input point set is generated. By extracting the largest common-view set fragment, the system can pre-remove more than 50% of invalid feature points. This strategy of "pre-judging the region and then fine-matching" is the core of improving localization efficiency.
[0074] Step 4 (II): Iterative Solution of the CV-MAGSAC Model. The improved CV-MAGSAC algorithm is integrated onto the purified feature point set. CV-MAGSAC introduces a noise marginalization mechanism to solve for the optimal basis matrix. Noise Model and Residual Distribution: The algorithm assumes a noise level of... It is a random variable that follows an interval Uniform distribution within. For a given noise Assuming the residual components of the interior points in n-dimensional space (n=2) are independent and follow a normal distribution, then the total geometric residual is... obey Vikas-square distribution. Point About the model residual probability density function Represented as:
[0075] (9)
[0076] in, The normalization constant is Gamma function. Marginalization likelihood function: used to eliminate the likelihood of a specific... The algorithm calculates the noise level for each data point by performing a weighted integral over all possible noise levels. The marginal likelihood probability. Let . For point-to-point model The geometric distance is then the point Marginal probability of being identified as an interior point for:
[0077] (10)
[0078] Step 5: Input the test image into the trained model, match it with images in the database, output the best matching image, and obtain the corresponding GPS location information. Utilize a multi-source information fusion model to output the final six-degree-of-freedom (6-DoF) pose. Based on the known positions of the Top-k reference points and the calculated relative pose, construct a distance minimization objective function:
[0079] (11)
[0080] Among them, weight The local alignment score is determined by the output of the DGLA stage. By solving this system of linear equations, the user's precise position coordinates in the global coordinate system are obtained. This method, while ensuring sub-meter level positioning accuracy, improves the computational efficiency of pose estimation by nearly 2 times by utilizing a common view set pre-screening mechanism, ultimately achieving stable and continuous visual positioning services.
Claims
1. A visual localization method based on hierarchical aggregation alignment network and common view set optimization, characterized in that... Includes the following steps: Step 1: Perform multi-dimensional environment modeling in the target scene (e.g., indoor corridor, campus area, or large street), deploying several reference points (RPs) with known locations, denoted as a set. Use high-precision measuring equipment to obtain the precise 3D coordinates of each reference point in the world coordinate system. To ensure the completeness and robustness of the offline database, multi-view image acquisition is performed at each reference point using a mobile terminal. Specifically, this includes taking a horizontal panoramic image at regular intervals to capture panoramic features, and taking a top-down view from a downward angle to extract ground details. Furthermore, the above process is repeated at different times of day, such as early morning, noon, and evening, to cover environmental changes under different lighting conditions, and precise pose labeling information is added to each acquired image. Step 2: Construct a hierarchical aggregation alignment network (GALANet), using a compact convolutional Transformer (CCT) as the backbone to extract deep activation features from the image, and generate a global descriptor with environment discrimination through a NetVLAD aggregation layer; Step 3: Establish a Local Alignment Algorithm (DGLA) architecture based on the Improved Longest Common Subsequence (LCSS). Perform reordering by calculating the geometric consistency score of the local feature sequences between the query graph and the candidate graph to solve the perceptual aliasing problem caused by scene repetition. Step 4: Fine-grained pose estimation based on common view set mining and CV-MAGSAC model optimization. The local alignment prior provided by DGLA is used to mine depth geometrically consistent regions, and the camera pose is recovered by combining this with the MAGSAC algorithm. Step 5: Input the test image into the trained model, match it with the images in the database, output the most matching image, and obtain the corresponding GPS location information.
2. The visual localization method based on hierarchical aggregation alignment network and common view set optimization according to claim 1, characterized in that... Step two includes the following steps: Step 2: Construction and Feature Extraction of the Hierarchical Aggregation Alignment Network (GALANet). Figure 3 shows the GALANT network framework. To extract features that can transcend temporal and spatial changes from massive images, this invention constructs the GALANT backbone architecture. Traditional convolutional neural networks (CNNs) are limited by their local receptive fields and are prone to failure when faced with large-area dynamic occlusion (such as pedestrians in a corridor) due to the destruction of local features. While the Visual Transformer (ViT) can capture global dependencies, it is prone to overfitting on small-to-medium-scale localization datasets and is insensitive to positional information. Therefore, this invention uses a compact convolutional transformer (CCT) as the core for feature extraction. Specifically, it includes the following steps; Step 2 (a): Construct the backbone architecture of the hierarchical aggregation alignment network (GALANet) based on the compact convolutional Transformer (CCT). The images obtained in Step 1 are then uniformly processed into... The image resolution is then input into the network. First, a convolutional tokenizer is used to process the image. The mapping is a sequence of feature tokens, expressed as follows: (1) Subsequently, the token sequence is fed into a multi-layer Transformer encoder, which uses a self-attention mechanism to capture long-range dependencies between image regions. The core calculation formula is as follows: (2) Through this step, the network is able to extract feature maps containing deep semantic information. This provides basic data support for subsequent global aggregation and local alignment; Step Two (II): Differentiable Aggregation and Coarse Screening of NetVLAD Global Features. Traditional VLAD algorithms employ hard assignment, meaning each local feature is assigned only to its nearest cluster center. However, in backpropagation, the hard assignment function is discontinuous, making end-to-end gradient updates impossible. To address this issue, this invention introduces a NetVLAD layer to aggregate and coarsely screen differentiable features from local features. Cluster centers The affiliation degree is defined as a soft assignment based on Softmax: (3) Among them, weight and bias All are trainable parameters. The core logic lies in: when the features... Distance from cluster center The closer the difference is, the higher its weighting, thus making the residual aggregation process smoother and differentiable; Step Two (Three): Global Descriptor Generation and Retrieval. Calculate the weighted residual sum to generate the final NetVLAD global descriptor. : (4) The generated descriptor is reduced to 384 dimensions by a fully connected layer and then PCA whitening is performed to remove redundant correlations between dimensions. During online localization, the system calculates the Euclidean distance between the query image and all images in the offline database, and selects the top-10 images with the smallest distances as candidate locations. This "fingerprint matching" method greatly reduces the search space for pose calculation.
3. The visual localization method based on hierarchical aggregation alignment network and common view set optimization according to claim 1, characterized in that... Step three includes the following steps: Step 3: Local Feature Alignment and Reordering Based on the DGLA Algorithm. Figure 4 shows an example of the local feature alignment sequence calculated by the DGLA algorithm. In scenarios such as long corridors, the visual appearance of different reference points is highly similar, and relying solely on global vectors can easily lead to mis-retrieval. This invention proposes an improved Longest Common Subsequence (LCSS)-guided Local Alignment Algorithm (DGLA) for geometric reordering; Step 3 (a): Traditional LCSS algorithms require two elements to be strictly equal (0 or 1), which is difficult to achieve in noisy visual descriptors. This invention designs a dual-threshold "soft similarity" scoring mechanism. For feature sequences x and y, a cumulative score matrix M is constructed: (5) in, To query the Euclidean distance between local features of the query image and the reference image, and These represent the maximum and minimum values of the distance matrix, respectively. This algorithm employs a "soft" alignment strategy, enabling accurate measurement of the physical similarity between two images even in the presence of dynamic occlusion. By finding the longest matching path in spatial location, it automatically filters out randomly distributed dynamic interference in the background, ensuring that the alignment score truly reflects the geometric consistency of the physical scene. Step 3 (II) Joint Loss Training and Optimization. Define the global-local joint triplet loss function. This is used to optimize network parameters. The loss function combines the discriminative power of global features with the geometric constraints of local alignment. (6) Its physical meaning is: through Zoom in on geographically proximate image pairs, while utilizing... Punish "negative examples" that have similar global features but conflicting local geometry, thereby eliminating the risk of perceptual aliasing during the training phase.
4. The visual localization method based on hierarchical aggregation alignment network and common view set optimization according to claim 1, characterized in that... Step four includes the following steps: Step 4: Fine-grained pose estimation based on common view set mining and CV-MAGSAC model optimization. Figure 5 is a schematic diagram of image common view set mining and maximum overlap region determination. In the fine-grained localization stage, non-common view regions caused by viewpoint changes generate a large number of mismatched points, which seriously interfere with the accuracy and efficiency of geometric model fitting. This invention utilizes the local alignment prior provided by DGLA to mine deep geometrically consistent regions and combines it with the MAGSAC algorithm to recover the camera pose; Step 4 (a): Using the DGLA alignment prior information obtained in Step 4, define the common view set S. Point pairs within this set must satisfy both the fixed difference constraint on pixel coordinates and the continuously decreasing constraint. (7) Subsequently, the "maximum common view set" is extracted by maximizing the cardinality. : (8) Similarly, And obtained through edge expansion and Finally, the input point set is generated. By extracting the largest common-view set fragment, the system can pre-remove more than 50% of invalid feature points. This strategy of "pre-judging the region and then fine-matching" is the core of improving localization efficiency. Step 4 (II): Iterative Solution of the CV-MAGSAC Model. The improved CV-MAGSAC algorithm is integrated onto the purified feature point set. CV-MAGSAC introduces a noise marginalization mechanism to solve for the optimal basis matrix. Noise Model and Residual Distribution: The algorithm assumes a noise level of... It is a random variable that follows an interval Uniform distribution within. For a given noise Assuming the residual components of the interior points in n-dimensional space (n=2) are independent and follow a normal distribution, then the total geometric residual is... obey Vikas-square distribution. Point About the model residual probability density function Represented as: (9) in, The normalization constant is Gamma function. Marginalization likelihood function: used to eliminate the likelihood of a specific... The algorithm calculates the dependence on noise by performing a weighted integral over all possible noise levels for each data point. The marginal likelihood probability. Let . For point-to-point model The geometric distance is then the point Marginal probability of being identified as an interior point for: (10)。