## MESA: Effective Matching Redundancy Reduction by Semantic Area Segmentation

Yesheng Zhang, Shuhan Shen, Senior Member, IEEE , Xu Zhao, Member, IEEE

Abstract -Matching redundancy, which refers to fine-grained feature comparison between irrelevant image areas, is a prevalent limitation in current feature matching approaches. It leads to unnecessary and error-prone computations, ultimately diminishing matching accuracy. To reduce matching redundancy, we propose MESA and DMESA, both leveraging advanced image understanding of Segment Anything Model (SAM) to establish semantic area matches prior to point matching. These informative area matches, then, can undergo effective internal feature comparison, facilitating precise inside-area point matching. Specifically, MESA adopts a sparse matching framework, while DMESA applies a dense one. Both of them first obtain candidate areas from SAM results through a novel Area Graph (AG). In MESA, matching the candidates is formulated as a graph energy minimization and solved by graphical models derived from AG. In contrast, DMESA performs area matching by generating dense matching distributions on the entire image, aiming at enhancing efficiency. The distributions are produced from off-the-shelf patch matching, modeled as the Gaussian Mixture Model, and refined via the Expectation Maximization. With less repetitive computation, DMESA showcases a speed improvement of nearly five times compared to MESA, while maintaining competitive accuracy. Our methods are extensively evaluated on five datasets encompassing both indoor and outdoor scenes. The results illustrate consistent and prominent performance improvements from our methods for six point matching baselines across all datasets. Furthermore, our methods exhibit promise generalization and improved robustness against image resolution. Our code is publicly available at github.com/Easonyesheng/A2PM-MESA .

✦

## 1 INTRODUCTION

F tween images, which is vital in a broad range of applications, EATURE matching aims at establishing correspondences besuch as SLAM [1], SfM [2] and visual localization [3]. However, achieving exact point matches is still a challenge due to the presence of matching noises [4], including scale variations, viewpoint and illumination changes, repetitive patterns, and poor texturing.

Recent years have witnessed significant advancements in learning-based feature matching. Classical sparse matching methods have been revolutionized by learning detectors [5], descriptors [6] and matchers [7], [8]. Learning-based semi-dense [9], [10] and dense [11], [12] methods further obtain an impressive precision gap over their sparse counterparts, by dense feature comparison across entire images. Nevertheless, all these matching methods encounter a common obstacle: matching redundancy , which involves detailed comparisons of learning features in irrelevant regions between images. These unnecessary computations are prone to the matching noises, limiting the matching precision.

Intuitively, most of the matching redundancy can be effectively identified through high-level image understanding, and only strongly correlated local areas (or regions ) need dense feature comparison to determine precise matches (cf. Fig. 1). Therefore, recent methods [14], [15] perform learning-based redundancy pruning. However, implicit learning leads to generalization challenges and lack of interpretability. To address these issues, some works turn to explicit image context [16], [17], [18]. As the redundancy is evident in non-overlapping areas, overlapping segmentation is proposed [16], [17]. However, the co-visible area is still rough, and the redundancy persists in it during

Yesheng Zhang and Xu Zhao are with Department of Automation, Shanghai Jiao Tong University. (e-mail: { preacher, zhaoxu @sjtu.edu.cn } ) Shuhan Shen is with the Institute of Automation, Chinese Academy of Sciences. (e-mail: shuhan.shen@ia.ac.cn ) Corresponding author: Xu Zhao

Fig. 1. The matching redundancy reduction of our methods. High-level image understanding enables efficient matching redundancy reduction, allowing for precise point matching by local dense feature comparison . Therefore, the proposed MESA effectively reduces the matching redundancy by area matching based on SAM [13] segmentation, significantly improving the accuracy of DKM [11].

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-0c40ce1e-4fb3-454c-ae02-45a0a70ba07a.jpg)

subsequent matching. SGAM [18] provides a fine-grained way to reduce matching redundancy, named Area to Point Matching (A2PM) framework. Specifically, it establishes explicit semantic area matches before point matching, where the matching redundancy is largely removed according to semantic. However, SGAM heavily relies on semantic segmentation. Its performance, thus, decreases when encountering inexact semantic labeling and semantic ambiguity [18]. Also, SGAM cannot be applied to general scenes due to the close-set semantic labels. Hence, reducing matching redundancy by explicit semantic suffers from impracticality.

Recently, Segment Anything Model (SAM) [13] has gained notable attention from the research community due to its exceptional performance and versatility, which can be the basic front-

end of many tasks [19], [20]. This suggests that the foundation model can accurately comprehend image contents across various domains. Drawing inspiration from this, we realize that the image understanding of SAM can be leveraged to reduce matching redundancy. Thus, we propose to establish area matches based on SAM segmentation to overcome the limitations of SGAM [18]. Similar to the semantic segmentation, the SAM segmentation also provides multiple areas in images, but without semantic labels attached to these areas. However, the general object perception of SAM ensures that its segmentation results inherently contain implicit semantic information. In other words, a complete semantic entity is always segmented as an independent area by SAM. Hence, matching these implicit -semantic areas also effectively reduces matching redundancy and promotes accurate point matching inside areas [18]. Furthermore, the absence of explicit semantics alleviates the issues of inaccurate area matching caused by erroneous labeling. The limitation of generalization due to semantic granularity is also overcome. Nevertheless, area matching cannot be simply achieved by semantic labels but requires other approaches under this situation.

In this work, we propose Matching Everything by Segmenting Anything (MESA, Fig. 3), a method for precise area matching from SAM segmentation. MESA focuses on two main aspects: area relation modeling and area matching based on the relation . To be specific, since individual SAM areas provide only local information, matching them independently can lead to inaccurate results, especially in scenes with repetitiveness. To address this, we construct a novel graph structure, named Area Graph (AG), to model the global context of the areas as a basis for subsequent precise matching. AG takes areas as nodes and connects them with two types of edges: undirected edges for adjacency and directed edges for inclusion. Both edges capture global information, and the latter enables the construction of hierarchy structures similar to [21] for efficient matching. After the area relation modeling , MESA performs area matching by deriving two graphical models from AG: Area Markov Random Field (AMRF) and Area Bayesian Network (ABN). The AMRF involves all globalinformative edges, thus allowing global-consistent area matching through energy minimization on the graph. Specifically, the energy is determined based on the learning area similarity and spatial area relation, and this energy minimization is effectively solvable through Graph Cut [22]. The ABN, furthermore, is proposed to facilitate the graph energy calculation, leveraging the hierarchy structure. Finally, we propose a global matching energy to tackle the issue of multiple solutions in Graph Cut , ultimately leading to effective redundancy reduction from precise area matching.

Although MESA holds promise for high accuracy, its intricate process diminishes its efficiency. To probe the root of this efficiency issue, we deeply review the matching procedure of MESA. Similar to the sparse framework in point matching, MESA essentially operates as a sparse area matching framework. It starts by extracting area candidates from images and subsequently conducts dense similarity computations between the candidate sets from the image pair. However, unlike points, determining area similarities among the sets involves repetitive computation due to area overlaps. Consequently, the efficiency drawback of MESA predominantly emerges from the costly computation of area similarities in the sparse matching framework.

To mitigate this concern, we take inspiration from the dense framework employed in point matching [9], [11] and proposed a Dense counterpart of MESA, named DMESA , to conduct a

Fig. 2. MESA vs. DMESA. The sparse area matching framework of MESA involves repetitive computation in area similarity calculations, leading to an efficiency issue of MESA. To address this issue, DMESA leverages a dense matching distribution to guide the area matching, reducing repetitive computation.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-d1bc0c25-602d-4228-8b01-c693a4a73cb4.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-3d2e323c-5b60-419d-92e7-3a8fc53d8cc5.jpg)

dense area matching framework. In contrast to common beliefs in point matching, a dense area matching framework is more efficient than a sparse one. This difference arises from the overlaps between the basic units. In point matching, there are no overlaps among the basic units (points). Thus, a dense framework that finds correspondences from the entire image incurs significantly higher computational costs than a sparse framework that only considers keypoints. However, in area matching, the basic units (areas) exhibit considerable overlap and often encompass the entire image (cf. Fig. 2 top). Thus, repetitive computations are remarkable in the area similarities calculation of the sparse framework. Conversely, in a dense framework, these repetitive computations can be avoided by directly generating dense matching distributions on the entire image. Moreover, we notice that the matching distributions can be derived through patch matching, mirroring the coarse matching stage of current semi-dense point matchers [10].

Consequently, DMESA focuses on utilizing patch matching to achieve area matching (cf. Fig. 6). Specifically, it first establishes patch matches between a source area and the target image, leveraging the off-the-shelf coarse matching of [10]. Then, it models the joint matching distribution of these patch matches by the Gaussian Mixture Model (GMM), which can be viewed as a dense area matching distribution. Considering the accuracy concern of coarse matching, DMESA introduces the cycle consistency [23] to optimize the distribution, adopting a finite-step Expectation Maximization (EM) algorithm. Afterwards, precise area matching can be obtained from the refined distribution.

This work is an extension version of MESA [24] presented at CVPR'24. Here, we introduce the following technical enhancements and experimental contributions: 1) After investigating the efficiency issue of MESA, we propose its dense counterpart, named DMESA, applying a dense area matching framework . DMESA enables area matching derived from off-the-shelf patch matching. In experiments, it can establish area matches with competitive accuracy at a speed nearly 5 times faster than MESA, offering a better precision/efficiency trade-off; 2) We observe a substantial impact from image resolution on feature matching in experiments. Thus, we conduct an in-depth analysis of this impact, resulting in an improved resolution configuration of A2PM. Moreover, we thoroughly examine image resolution in experiments, providing a more comprehensive evaluation of our methods; 3) We add two point matching baselines in the experiments, to prove

our methods can benefit all existing types of point matchers. By employing a more reproducible experimental setup, we present new results for previous experiments and conduct experiments on two additional indoor and outdoor datasets. Furthermore, experiments about cross-domain generalization, model fine-tuning and using SAM2 [25] segmentation are conducted in this version.

Our work makes several contributions. 1) To effectively reduce matching redundancy, we propose utilizing the high-level image comprehension capability of SAM. To this end, we present two methods, MESA and DMESA , for implicit semantic area matching from SAM segmentation, and ultimately improving matching accuracy. 2) Applying the sparse matching framework, MESA first extracts semantic areas from SAM results by a novel graph, termed AG, which models the global area relations. Based on graphical models derived from AG, precise area matching is achieved for accurate inside-area point matching. 3) To improve the efficiency of MESA, we further introduce DMESA , which employs a dense framework. It conducts area matching by generating dense matching distributions on the entire image. DMESA offers greater flexibility and speed, striking a superior balance between accuracy and efficiency. 4) In extensive experiments on five diverse datasets, our methods consistently yield substantial performance improvements for six point matchers spanning sparse, semi-dense, and dense matching categories, showing their versatility. Moreover, our methods exhibit prominent generalization across various datasets and superior robustness against the input image resolution.

## 2 RELATED WORK

## 2.1 Sparse, Semi-Dense and Dense Matching

There are three types of feature matching methods: sparse, semidense and dense. Classical feature matching methods [26], [27] belongs to the sparse framework, which involves keypoint detection and description in images and matching among keypoint sets. The learning counterpart of this framework utilizes neural networks to perform feature detection [5], [28], description [6], [29], [30] or matching [7], [31]. To avoid the detection failure in sparse methods, semi-dense methods [9], [10], [21], [32] are proposed, also known as the detector-free methods. These methods perform dense feature comparison over the entire image and then select confident patch matches, which are used to refine precise point matches. Dense matching methods [11], [12] output a dense warp with confidence map for the image pair. Recent DKM [11] gradually refines the dense warp from small to large resolution, which can also be viewed as patch matching from coarse to fine, and achieves state-of-the-art performance. However, MESA and DMESA focus on reducing redundancy in feature matching through area matching. Thus, they can be seamlessly combined with all kinds of point matching methods described above through the A2PM framework, to increase matching precision.

## 2.2 Implicit Matching Redundancy Reduction

In general, the establishment of keypoints sets (sparse matching) or patch matching (dense/semi-dense matching) can also be viewed as reducing matching redundancy. However, their implementations rely on feature computation spanning the entire image, inherently containing a significant amount of redundancy. Particularly, feature interactions in irrelevant areas lead to decreased matching accuracy. Thus, current methods for removing matching redundancy concentrate on eliminating these errorprone feature computations. Following learning-based matching methods, TopicFM [14] infers topics for learning features and then confines feature calculation to the same topic to avoid redundant computation. Similarly, PRISM [15] generates feature masks based on mutual information to restrict interactions between features with low similarity. However, both the feature topics and mutual information masks are attained by implicit feature learning, lacking a clear connection to the image context. Consequently, these methods encounter challenges in generalization. Our methods utilize explicit semantic area matching to diminish matching redundancy, enhancing both interpretability and generalization.

## 2.3 Explicit Matching Redundancy Reduction

A well-defined intermediate search space leads to explicit matching redundancy reduction. Initially, as the presence of redundancy is apparent in non-overlapping regions between images, several studies focus on extracting covisible areas. They predict overlaps between images by iterative matching [33] or overlap segmentation [17], [34], [35]. However, within the overlapping regions, matching redundancy persists, especially in the context of detailed local point matching. In contrast, SGAM [18] establishes semantic area matches between images to achieve refined reduction of matching redundancy. Then, point matches are obtained by dense feature comparison inside the matched areas. This A2PM framework is simple yet effective. Our methods further build on its advantages, but leverage the advanced segmentation method, i.e. SAM, to overcome the issues from explicit semantic.

## 3 PRELIMINARIES: A2PM FRAMEWORK

In this section, we introduce the task of feature matching and the A2PM framework. The ultimate goal of feature matching is to establish point matches ( P ) between images ( I 0 , I 1 ), also known as point matching (PM).

$$P M ( I _ { 0 }, I _ { 1 } ) = \mathcal { P } \text{ with } \mathcal { P } \coloneqq \{ ( p _ { 0 } ^ { i }, p _ { 1 } ^ { i } ) \} _ { i }. \quad \ ( 1 )$$

Here, ( p i 0 ∈ I 0 , p i 1 ∈ I 1 ) denotes the 2D projections in two images of the same 3D point, i.e. , a point match. To reduce the redundancy in above matching, the Area to Point Matching (A2PM) framework [18] is proposed. Both Our MESA and DMESA adhere to this framework and focus on its area matching phase.

Firstly, we revisit the core idea of the A2PM framework in Sec. 3.1. Then, due to the pivotal role of image resolution in the A2PM framework, we analyze its effect on matching accuracy (Sec. 3.2). Based on this, we further offer a detailed resolution configuration of the framework and discuss its motivation (Sec. 3.3).

## 3.1 Overview of A2PM Framework

The initial motivation of [18] is to improve the search space for feature matching by semantic. To this end, a semantic-friendly search space was proposed, known as the semantic area matches . By matching these areas, matching redundancy between images could be effectively eliminated by semantic. Thus these area pairs could provide more local details, benefiting inside point matching. Then, the A2PM framework is introduced, which focuses on the coupling of area matching (AM) and point matching. In this framework, the semantic area matches ( { a , a i 0 i 1 } i ) are first established by AM between images, followed by PM within the area pairs cropped from original images. Finally, fusing these inside-area point matches yields the ultimate matching results P .

$$A M ( I _ { 0 }, I _ { 1 } ) \xrightarrow { c r o p } \{ P M ( a _ { 0 } ^ { i }, a _ { 1 } ^ { i } ) \} _ { i } \xrightarrow { \ f u s e } \mathcal { P }. \quad ( 2 )$$

Fig. 3. Overview of MESA. Based on ❶ SAM segmentation , we first construct ❷ Area Graph s. Then the graph is turned to two graphical models based on its two different edges. Through ❸ Area Markov Random Field , area matching is formulated as an ❹ Energy Minimization . Meanwhile, leveraging ③ Area Bayesian Network and our ❺ Learning Area Similarity Calculation , ❻ Graph Energy can be efficiently calculated. Therefore, ❼ Graph Cut is utilized to obtain putative area matches. Finally, ❽ Bidirectional Energy Minimization determines the best area match, which serves as the input of subsequent point matcher for precise feature matching, following the ❾ Area to Point Matching (A2PM) framework [18].

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-4f17b125-0d1e-4a2f-a782-72aead5ad6d3.jpg)

This flexible combination enables independent development of AM techniques to improve the matching precision of various PM methods. Meanwhile, it is evident that accurate AM is the basis of A2PM. Our MESA and DMESA thus focus on achieving precise AM, and showcase consistent improvement for sparse, semi-dense and dense point matchers in extensive experiments.

in the dataset. The resolution of area images and PM input share the same aspect ratio, which is set as 1 . Therefore, in A2PM, the specific cropping operation first expands the shorter side of areas to form squares, then crops them from the high-resolution raw images, and finally scale them to the required and square input resolution. This setting is experimentally confirmed in Sec. F.1.

## 3.2 Image Resolution Impact on Feature Matching

The impact of resolution on matching is rarely explored in current literature, as common point matchers typically resize the raw images directly to a default resolution ( e.g. , the training resolution).

However, with the increasing computational demands of advanced matching methods ( e.g. , quadratic to input resolution for some semi-dense/dense methods [11], [33]), the choice of resolution becomes a practical trade-off between accuracy and efficiency. Especially in scenarios with limited computational resources, point matchers may opt for reduced image sizes below the default, raising concerns about the impact of resolution variation on matching precision.

Moreover, in the A2PM framework, one more resolution is taken into account, that is the area image resolution . It potentially leads to conflicts with the default PM resolution and raises additional concerns regarding resolution and matching accuracy.

This motivates us to discuss the influence of image resolution on matching performance here and experimentally investigate it in Sec. 6. Generally, resolution impacts feature matching in three primary ways. 1) Resolution essentially reflects the level of detail preserved in images and higher resolution ideally enhances matching accuracy. 2) Changes in image resolution can lead to changes in aspect ratio , causing distortion in image content that can reduce matching accuracy. 3) Learning-based methods may demonstrate overfitting to the training resolution . Especially for semi-dense matchers, resolution variation may lead to significant performance declines (experimentally investigated in Sec. A of the appendix), probably due to their Transformer-based structure [36].

## 3.3 Image Resolution Configuration in A2PM

Building on the findings in the last part, we offer a detailed resolution setting for the A2PM framework. Specifically, the original image resolution is set to the resolution of the raw images

The reasons for the setting are as follows. 1) Due to the accurate AM of our methods, matching redundancy is sufficiently reduced in area images. Thus, most of the inside-area pixels containing useful details for PM. Cropping areas from the highresolution original image preserves these details as much as possible, thereby benefiting the matching accuracy. 2) The same aspect ratio between area images and PM input avoid distortion during resize. 3) The aspect ratio constraint of 1 arises from the uncertainty in sizes of semantic areas. In other words, the sizes of semantic areas are determined by specific semantics, whose aspect ratios vary across different images. However, point matchers require input image pairs to have the same dimensions. Therefore, we set a uniform input resolution with aspect ratio of 1 , which leads to minimum changes in area size in a statistical sense, thus reducing redundancy introduction in area size adjustment.

Next, we discuss the impact of learning resolution overfitting on the A2PM framework. This overfitting issue mainly arises from the aspect ratio conflict between the training resolution of PM and its input resolution in A2PM framework. When the training resolution has an aspect ratio of 1, this overfitting is harmless (cf. Tab. 5). Conversely, when the training aspect ratio deviates from 1, the performance of A2PM methods using square inputs may be inferior to the original PM using training size, due to the overfitting issue. Meanwhile, using the training resolution as the input PM size in A2PM framework may also lead to a decrease in matching precision from excessive area size adjustments (cf. Tab. 3). However, in experiments, we only observe the drop in performance specifically with Transformer-based methods on the in-domain indoor dataset , corresponding to their resolution overfitting issue (cf. Sec. A). To alleviate this issue, we can finetune the models on a square resolution (cf. Sec. 6.6). However, this technique, while effective, entails additional training expenses. The optimal approach should focus on addressing the overfitting issue of Transformer in PM, similar to [36]. We hope that this will inspire additional progress in PM within the community.

## 4 SPARSE AREA MATCHING

In this section, we introduce a sparse AM approach, called MESA , which leverages SAM to effectively reduce matching redundancy. It initially identifies candidate semantic areas in images and subsequently matches these candidates, akin to sparse PM methods. There are two main components of MESA: the Area Graph (AG, Sec. 4.1) and the Graphical Area Matching (Sec. 4.2). The former is a novel graph that describes inter-area relations and serves as a basis for AM. The later is responsible for finding area matches utilizing both the inter-area relations and intra-area features.

## 4.1 Area Graph

The main motivation to propose AG is that direct AM on SAM results is inaccurate, as global information is ignored in independent areas. Fixed area sizes from SAM also hinder robust PM under scale changes. Hence, AG is designed to capture the global structure of these areas and construct scale hierarchy for them, by modeling inter-area relations.

Subsequently, we first introduce the definition of AG in Sec. 4.1.1 and then explain how to construct AG from SAM results in Sec. 4.1.2.

## 4.1.1 Area Graph Definition

AG ( G = ⟨V , E⟩ ) takes image areas as nodes and contains two edges to model inter-area relations (Fig. 4), thus making it a multi-relational graph [37]. The graph nodes include both areas provided by SAM and additional areas generated for scale hierarchy (cf. Sec. 4.1.2). They are divided into different levels according to their sizes. On the other hand, the graph edges ( E = E in ⋃ E adj ) represent two relations between areas, i.e. , inclusion ( E in ) and adjacency ( E adj ). The inclusion edge e in ∈E in is directed, pointing from an area to one of its containing areas. It forms a tree-like connection between graph nodes, enabling robust and efficient AM under scale changes. The adjacency edge e adj ∈ E adj is undirected, indicating the areas it connects share common parts but without the larger one including the smaller one. This edge captures the spatial relations among areas, beneficial to accurate AM. By the above two edges, AG models the global structure of image areas, playing a fundamental role in our AM.

## 4.1.2 Area Graph Construction

The construction of AG includes collecting areas as nodes and connecting them by proper edges. Notably, not all SAM areas can function as nodes, since some are too small or have extreme aspect ratios, rendering them unsuitable for inside PM. Thus, Area Preprocessing is performed first to obtain initial graph nodes. We then approach the edge construction as a Graph Link Prediction problem [38]. Afterwards, the preliminary AG is formed, but it still lacks matching efficiency and scale robustness. Thus, we propose the Graph Completion algorithm, which generates additional nodes and edges to construct the scale hierarchy.

Area Pre-processing: To filter unsuitable areas, we set two criteria: the acceptable minimal area size ( T s ) and maximum area aspect ratio ( T r ). Any area that has smaller size than T s or larger aspect ratio than T r , gets screened out. The remaining areas are added into the candidate set. For each filtered area, we fuse it with its nearest neighbor area in the candidate set. The filtering and fusion operations are repeated until no areas get screened out.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-6d12fb85-de62-4e73-87fa-a7287f8f91be.jpg)

Fig. 4. Area Graph. The graph nodes (circles with masks representing rectangle areas) includes both areas from SAM (white boundaries) and our graph completion algorithm (black boundaries). They are divided into various levels according to their sizes. The adjacency edges (dashed lines) and inclusion edges (arrows) connect these nodes. Only adjacency edges within the same level are shown for better view.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-bd26dfc7-c646-4209-8b0a-25d68266c7a5.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-9ccdde6e-1be8-4af7-9cac-89d1f96adedf.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-0e47f242-9674-4162-958b-5566e0273e1a.jpg)

Then, we assign a level l a to each candidate area a based on its size, by setting L size thresholds ( { TL i ∣ ∣ i ∈ [0 , L -1] } ):

$$l _ { a } = i \ | \ T L _ { i } \leq W _ { a } \times H _ { a } < T L _ { i + 1 }. \text{ \quad \ \ } ( 3 )$$

These size levels are the basis of scale hierarchy in AG.

Graph Link Prediction: The edge construction is treated as a link prediction problem. Given two area nodes ( v , v i j ), the edge between them ( e ij ) can be predicted according to the spatial relation of their corresponding areas ( a , a i j ). This approach adopts the ratio ( δ ) of the overlap size ( O ij ) to the minimum size between two areas ( δ = O / ij min( W i × H , W i j × H j ) ) as the score function:

$$e _ { i j } \in \begin{cases} \mathcal { E } _ { i n } &, \delta > = \delta _ { h } \\ \mathcal { E } _ { a d j } &, \delta _ { l } < \delta < \delta _ { h } \, \\ \varnothing &, \delta \leq \delta _ { l } \end{cases},$$

where δ , δ l h are predefined thresholds.

Graph Completion: Initial AG is achieved by connecting all the processed nodes using different edges. However, since SAM inherently produces areas containing complete entity, there are few inclusion relations among areas. Consequently, initial AG lacks the scale hierarchy, which reduces its robustness at scale variations and makes accessing nodes inefficient. To address the issue, we propose the Graph Completion algorithm. It generates additional nodes and edges to ultimately construct a complete tree structure in the original graph. The core of this algorithm is to generate parent nodes for each orphan node, which has no parent node in the next higher level. The algorithm begins at the smallest level, collects all orphan nodes, and clusters them based on their center locations. Nodes in the same cluster have their corresponding areas fused with each other. It is noteworthy that the generated areas containing multiple objects preserve the internal implicit semantic. Based on proper level thresholds, the resulting areas correspond to new higher level nodes. If a node remains single after clustering, we increase its area size to the next level to allow for potential parent nodes. We repeat the above operations on the next level and connect generated nodes to others by suitable edges, until the highest level is reached. More details can be found in the Sec. D of the appendix.

## 4.2 Graphical Area Matching

In this part, we describe the AM process in MESA, which is formulated on the graph, based on two graphical models derived from AG. Given two AGs ( G 0 , G 1 ) of the input image pair ( I 0 , I 1 ) and one area ( a 0 src ∈ I 0 ) corresponding to the node v 0 src ∈G 0 (termed as the source node ), AM involves finding the node v 1 j ∈G 1 with the highest probability of matching its area a 1 j to the source node area a 0 src . However, treating this problem as an independent node matching is inadequate, as which disregards

global structure of areas. Since the global structure is modeled in AG by its edges, considering the graph edges, thus, is essential for accurately matching these areas. Meanwhile, the two edges of AGrespectively derive two graphical models, i.e. Markov Random Fields (undirected edges) and Bayesian Network (directed edges). These observations motivate us to formulate the AM task inside the framework of graphical model.

In the following, we first introduce the undirected graph converted from AG, named Area Markov Random Field (AMRF, Sec. 4.2.1), which is leveraged to formulate the AM into an energy minimization task. To calculate the local matching energy between areas, we propose a learning model in Sec. 4.2.2 to achieve area similarities based on intra-area features. Then, the directed graph converted from AG, termed as Area Bayesian Network (ABN, Sec. 4.2.3) is presented to reduce redundant computation in the energy calculation. Finally, to achieve the best area match, an energy-based refinement is proposed (Sec. 4.2.4), through considering the graph structures of both input images.

## 4.2.1 Area Markov Random Field

By considering the general adjacency relation, which includes the inclusion relations as adjacency too, the G 1 is transformed into an undirected graph. Then, random variables ( x ) are introduced for all nodes to indicate their matching status with the source node. The binary variable x i ∈ x is equal to 1 when v 1 i matches v 0 src and 0 otherwise. Therefore, the AMRF ( G 1 M = ⟨V , E adj ⟩ ) is obtained. As these undirected edges imply the global consistency of matching, AM can be performed by maximizing the joint probability distribution over the AMRF:

$$\arg \max _ { x } P ( x ). \quad \quad \quad ( 5 ) \quad \text{dec} \quad \text{dec}$$

Based on [39], the probability distribution defined by AMRF belongs to the Boltzmann distribution , which is an exponential of negative energy function ( P ( x ) = exp( -E ( x )) ). Therefore, the AM can further be formulated as an energy minimization.

$$\arg \min _ { x } E ( x ). \quad \quad \quad ( 6 ) \ \text{prot} \\ \text{the}$$

The energy can be divided into two parts, including the energy of nodes ( E V ) and edges ( E E ), based on the graph structure.

$$E ( x ) = \sum _ { i } E _ { \mathcal { V } } ( x _ { i } ) + \lambda \sum _ { ( i, j ) \in \mathcal { N } } E _ { \mathcal { E } } ( x _ { i }, x _ { j } ), \quad ( 7 ) \, \begin{array} { c } \text{attentic} \\ \text{Utilizir} \\ \text{$\sigma$} ^ { j } \, = \end{array}$$

where λ is a parameter balancing the terms and N is the set of all pairs of neighboring nodes. For a graph node v 1 i , its energy is expected to be low when its matching probability is high, which can be reflected by the apparent similarity ( S a 0 src a 1 i ) between a 0 src and a 1 i . This energy term corresponds to the intra-area features.

$$E _ { \mathcal { V } } ( x _ { i } ) = | x _ { i } - S _ { a _ { s r c } ^ { 0 } a _ { i } ^ { 1 } } |. \quad \quad ( 8 ) \quad \cdot$$

The edge energy aims to penalize all neighbors with different labels, and the Potts model [40] ( T ) would be a justifiable choice. To better reflect the spatial relation, the Potts interactions are specified by IoU [41] of neighboring areas. This energy term corresponds to the inter-area relations.

̸

$$E _ { \mathcal { E } } ( x _ { i }, x _ { j } ) = I o U ( a _ { i } ^ { 1 }, a _ { j } ^ { 1 } ) \cdot T ( x _ { i } \neq x _ { j } ). \quad \ ( 9 ) \text{ \ \ } \text{Inout}$$

Function T ( ) · is 1 if the argument is true and 0 otherwise. Finally, the AM is formulated as an binary labeling energy minimization. By carefully defining the energy function, the energy minimization problem in Eq. (6) is efficiently solvable via the Graph Cut

Fig. 5. Learning area similarity. The area similarity calculation is formed as the patch-level classification. We predict the probability of each patch in one area appearing on the other to construct activity maps. The similarity is obtained by the product of activity expectations, contributing to our exact AM.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-51f952cc-ac38-4072-92e4-c6267f6af86b.jpg)

algorithm [22], [42]. The obtained minimum cut of the graph G 1 M is the matched node set ( { v 1 h ∣ ∣ h ∈ H} ). Although the set may contain more than one area node, the best matching result can be achieved from this set by our refinement algorithm in Sec. 4.2.4.

## 4.2.2 Learning Area Similarity

The proposed Graph Cut solution relies on energy calculations for graph nodes and edges. Unlike easily available IoU of areas for E E , determining the area apparent similarity for E V is not straightforward. Thus, we turn to the learning-based framework, inspired by recent successes of learning models in PM [10]. A straightforward idea is to calculate the correlation of learning descriptors of two areas [32] as the area similarity. However, the descriptor correlation is too rough for the accurate AM and lacks fine-grained interpretability. To overcome these issues, we decompose the area similarity calculation into two parallel patchlevel classification problems as shown in Fig. 5.

Specifically, for each image in the area image pair { a j ∣ ∣ j ∈ { 0 1 , }} reshaped to the same size, we perform binary classification for each 8 × 8 image patch p j i ( where i is the index of patch and j is the index of area image ) in it, computing the probability of p j i appearing on the other area image, termed as the patch activity σ j i . To accomplish the classification, we first extract patch-wise features from each area image using a Siamese CNN [43]. Then we update these patch features via self and crossattention with normalization [44], resulting in patch activities. Utilizing these patch activities, we construct an activity map ( σ j m = { σ j i ∣ ∣ j ∈ { 0 1 , }} i ) for each area image. When two areas are ideally matched, the corresponding 3D point of every pixel in one area is projected onto the other area. Hence, all the patch activities of both areas should be closed to 1 , revealing the area similarity can be achieved by the product of expectations (EX) of two activity maps.

$$( 8 ) \quad S i m _ { a ^ { 0 }, a ^ { 1 } } = E X ( \sigma _ { m } ^ { 0 } ) \times E X ( \sigma _ { m } ^ { 1 } ) \coloneqq \sigma _ { 0, 1 } \times \sigma _ { 1, 0 }. \quad ( 1 0 )$$

Through this approach, the calculation of area similarity is transformed into the patch-level classification, which enhances the interpretability and accuracy of AM.

## 4.2.3 Area Bayesian Network

Although the Graph Cut can be accomplished in polynomial time [42], the dense energy calculation over G 1 M is time consuming. Furthermore, due to the scale hierarchy in AG, this dense calculation is highly redundant. In particular, if the source area a 0 src is not matched to a 1 j , it won't be matched to any children area of a 1 j . This observation reveals the conditional independence

in the similarity calculation, which involves inclusion edges in G 1 , thus turning G 1 into a Bayesian Network ( G 1 B ) [45]. Based on G 1 B , the redundancy in the similarity calculation can be reduced. In practice, we calculate the dense similarities by constructing a similarity matrix M S ∈ R |V 0 |×|V 1 | . Note not all similarities in M S need calculation, but any similarity can be accessed in M S . We first calculate similarities directly related to all source nodes. Subsequent calculations are saved in M S as well. For M i,j S [ ] that has not been acquired, we calculate it by our learning model:

$$M _ { S } [ i, j ] = S i m _ { a _ { i } ^ { 0 }, a _ { j } ^ { 1 } }. \quad \quad ( 1 1 )$$

If M i,j S [ ] &lt; T as , all children nodes { v 0 h ∣ ∣ h ∈ ch 0 ( ) i } and { v 1 c ∣ ∣ c ∈ ch 1 ( j ) } of v 0 i and v 1 j are found from G 0 B and G 1 B , where ch j ( ) i is the index set of children indices of node v j i from G j B . Based on the conditional independence, we have:

$$M _ { S } [ h, k ] = 0, \, \forall ( h, k ) \in c h ^ { 0 } ( i ) \times c h ^ { 1 } ( j ). \quad ( 1 2 ) \stackrel { \omega y \alpha \Pi } { \text{matche} }$$

This operation effectively reduce the redundancy in similarity calculation, leading to more efficient AM.

## 4.2.4 Bidirectional Matching Energy Minimization

The minimum cut { v 1 h ∣ ∣ h ∈ H} achieved through the Graph Cut may contain more than one area node, indicating further refinement is necessary to obtain the best area match. Moreover, the aforementioned graphical area matching , i.e. finding the corresponding area node in G 1 for v 0 src ∈ G 0 , only considers the structure information of G 1 and ignores the structure of G 0 . To overcome this limitation, we propose a bidirectional matching energy E G for each candidate node v 1 h , consisting of four parts:

$$\vec { \lambda } _ { G } ^ { 1 } ) & = \frac { 1 } { Z } ( \mu \cdot E _ { s e l f } ( v _ { h } ^ { 1 } ) + \alpha \cdot E _ { p a r e n t } ( v _ { h } ^ { 1 } ) \\ & \quad + \beta \cdot E _ { c h i l d r e n } ( v _ { h } ^ { 1 } ) + \gamma \cdot E _ { n e i g h b o r } ( v _ { h } ^ { 1 } ) ) \\ \cdot \quad \, \hat { \lambda } _ { \hat { \lambda } } \cdot \dots \cdot \dots \cdot \hat { \lambda } _ { \hat { \lambda } } \cdot \hat { \lambda } _ { \hat { \lambda } } \cdot \hat { \lambda } _ { \hat { \lambda } }$$

where µ, α, β and γ are weights to balance the terms; Z is the partition function. The E self ( v 1 h ) is the energy related to matching probability between v 0 src and v 1 h :

$$E _ { s e l f } ( v _ { h } ^ { 1 } ) = | 1 - S i m _ { a _ { s r c } ^ { 0 }, a _ { h } ^ { 1 } } |. \quad \quad ( 1 4 ) \ \ m i z a t$$

The E parent ( v 1 h ) is the energy related to matching probability between the parent node pairs of v 0 src and v 1 h :

$$E _ { p a r e n t } ( v _ { h } ^ { 1 } ) = \begin{array} { c } \cdot \\ \min \{ | 1 - S i m _ { a _ { u } ^ { 0 }, a _ { r } ^ { 1 } } | | u \in p ^ { 0 } ( s r c ), r \in p ^ { 1 } ( h ) \}, \end{array} \quad ( 1 5 ) \begin{array} { c } \cdot \\ \text{the ke} \\ \text{to guic} \\ \text{charge} \\ \end{array} \end{array}$$

where p i ( j ) is the index set of parent nodes of v i j in G i . This energy is the minimum matching energy among all parent node pairs of v 1 h and v 0 src . Same as the E parent , the E children and E neighbor are the energy terms of children and neighbor node pairs. Afterwards, the best area match v 1 h ∗ in the set can be found by minimizing E G :

$$h ^ { * } = \arg \min _ { h \in \mathcal { H } } E _ { G } ( v _ { h } ^ { 1 } ). \text{ \quad \ \ } ( 1 6 )$$

If the E G ( v 1 h ∗ ) &gt; T E max (a threshold parameter), the source area node v 0 src is considered to have no matches. To further improve the accuracy of final match, we set an energy range threshold T Er to collect all the candidates within a certain energy range.

$$\{ v _ { \bar { h } } ^ { 1 } | | E _ { G } ( v _ { \bar { h } } ^ { 1 } ) - E _ { G } ( v _ { h ^ { * } } ^ { 1 } ) | \leq T _ { E r }, \bar { h } \in \mathcal { H } \}. \quad ( 1 7 ) \quad p ( x _ { l }$$

Then the final area match is achieved by fusing v 1 h ∗ and all candidates { v 1 ¯ h } ¯ h , using E G as weights, utilizing the method proposed in [32]. This refinement completely considers the structure information of both G 0 and G 1 and achieves exact area matches.

Fig. 6. Overview of DMESA. DMESA derives area matches from dense patch matches between the source area image and the target image, which are obtained through an off-the-shelf coarse matching. We model the patch matches utilizing GMM to generate a matching distribution in the target image, where the cycle-consistency can be introduced by a finite-step EM algorithm for accuracy refinement. Then, the area matches can be efficiently attained by applying a confidence threshold.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-837043f1-4830-4860-95e6-03bcf548e9c8.jpg)

## 5 DENSE AREA MATCHING

The proposed MESA is robust and precise. Nonetheless, its primary drawback is efficiency-related, stemming from the numerous repetitive similarity calculations caused by its sparse nature. To address the limitation, we propose a more flexible and faster AM method, named DMESA (Fig. 6), which matches semantic areas from SAM in a dense manner and requires no training. The core of DMESA involves deriving area matches from patch correspondences, which can be established through a coarse-level matching of an off-the-shelf point matcher [10]. Particularly, after source area image is obtained from AG, DMESA first establishes patch matches between the area and the target image. Then a dense matching distribution is generated on the target image (Sec. 5.1) to guide AM, by formulating the patch matches as a Gaussian Mixture Model (GMM). To further migrate the coarse accuracy issue, the cycle consistency-based [23] refinement is proposed in Sec. 5.2. This refinement employs finite-step Expectation Maximization (EM) algorithm to ultimately enhance the AM precision.

## 5.1 Matching Distribution Generation

The key of DMESA is to generate a dense matching distribution to guide AM, leveraging patch matches. To this end, we first achieve patch matches ( { p k } K k ) between the source area and the target image, along with their confidences . This can be easily accomplished by utilizing a coarse matching stage of an offthe-shelf point matcher [10]. Then, the patch matches can be treated as mulitiple Gaussian distributions in the target image; the patch centers ( { u , v k k } K k ) are the means ( { µ k } K k ) and the match confidence ( { c k } K k ) can be used to generate variance ( { Σ k } K k ):

$$\mu _ { k } = ( u _ { k }, v _ { k } ), \, \Sigma _ { k } = \begin{bmatrix} \frac { w _ { p _ { k } } } { c _ { k } } & 0 \\ 0 & \frac { h _ { p _ { k } } } { c _ { k } } \end{bmatrix}, \quad \quad ( 1 8 )$$

where w p k = h p k = 8 is the size of the patch p k . Afterwards, these Gaussian distributions can represent the matching probabilities of 2D locations ( { x k ∈ p k } k ) inside the patches:

$$( 1 7 ) \quad p ( x _ { k } ) & = \frac { 1 } { 2 \pi | \Sigma _ { k } | ^ { \frac { 1 } { 2 } } } \exp { - \frac { 1 } { 2 } ( x _ { k } - \mu _ { k } ) ^ { T } \Sigma _ { k } ^ { - 1 } ( x _ { k } - \mu _ { k } ) } \quad ( 1 9 ) \\ \intertext { n d a l l } \Phi _ { k } & = \mathcal { N } _ { k } ( x _ { k } | \mu _ { k }, \Sigma _ { k } ).$$

Therefore, we can model the joint matching distribution in the target image as a GMM, by introducing an one-hot K -dimensional

latent variable z and p ( z ) = Π K k π z k k , where z k represents the k -th entry of the vector z and π k is the mixing coefficients [45].

$$p ( x ) = \sum _ { k } ^ { K } \pi _ { k } \, \mathcal { N } ( x _ { k } | \mu _ { k }, \Sigma _ { k } ). \quad \quad ( 2 0 ) \, \stackrel { \text{-row} } { \text{vari} } \,$$

This matching distribution can guide the following AM. By setting a specific confidence threshold T c , the potential boundary points of the area ( p ( x ) = T c ) can be obtained from the distribution. The matched area in the target image, thus, can be acquired as the bounding box of these boundary points.

## 5.2 Cycle Consistency Refinement

Utilizing patch matching is an economical way to obtain area matches, but the inherently coarse nature of patch matches limits their accuracy, subsequently restricting the precision of the resulting area matches. This motivates us to further refine the matching distribution. In particular, we improve the precision of matching distribution by introducing the cycle consistency prior. Cycle consistency, a common constraint in matching [23], [46], asserts that correct matches remain unaffected by the matching direction, which refers to the choice of source and target images. The coarse matching method [10] employed in DMESA operates asymmetrically on the input image pairs. It only searches for correspondences in the target image for patches in the source image. Thus, the cycle-consistency prior can be introduced by exchanging the source and target images in this coarse matching. Specially, following the probability form in Sec. 5.1, coarse matching achieves the joint distribution p ( x s → t ; { µ s → t k } K k , { Σ s → t k } K k ) (Eq. 20) for AM. After modifying the matching direction, another distribution can be obtained: p ( x t → s ; { µ t → s k } K k , { Σ t → s k } K k ) . Since the key insight is the consistency between two matching directions, we can enforce the fusion of above two distributions to enhance the consistent matching results. Therefore, we propose a finite-step EM algorithm [45] to fuse the two distributions.

There are two primary elements in the EM algorithm applied to the GMM: the observed data and the initial parameters. In this case, we can sample data from one distribution p ( x s → t ) as the observation x s → t , and set parameters from the other distribution ( { µ t → s k } K k , { Σ t → s k } K k ) as the initial parameters θ t → s 0 . Then, we can use the EM algorithm to update the parameters:

$$\theta _ { t + 1 } ^ { t \to s } = \arg \max _ { \theta } \int \log p ( \mathbf x ^ { s \to t }, z | \theta ^ { t \to s } ) p ( z | \mathbf x ^ { s \to t }, \theta _ { t } ^ { t \to s } ) d x, \quad \text{The ene} \\ \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \ dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots\dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \delta }$$

where p ( z ) = Π K k π z k k and { π k } K k are initialized as π k = 1 K . After a finite number of update steps ( S EM ), we use the updated parameters θ t → s S EM to generate the refined matching distribution. This distribution has improved consistency in two matching directions, ultimately increase the AM precision. Note the matched patches are established in the source area as well. Thus, we can refine the source area by the above techniques at the same time.

## 6 EXPERIMENTS

In this section, we comprehensively evaluate our methods on feature matching and its downstream tasks. Firstly, the implementation details of our methods are presented in Sec. 6.1. Then, experiment results on the area and point matching tasks are reported respectively in Sec. 6.2 and Sec. 6.3. Extensive pose estimation experiments (Sec. 6.4) are also conducted on various datasets to prove the efficacy of our methods. Additionally, we perform

## TABLE 1

Area matching results. We compare the area matching performance between SGAM, MESA and DMESA, combined with GAM [18] under various ϕ settings. Results of each series are highlighted as best , second and third respectively.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-9232ee6e-eac0-43b0-8928-d77fca95437c.jpg)

† SGAM with only semantic area matching activated.

| Method                |   AOR ↑ |   AMP@ 0 . 6 ↑ |   ACR ↑ |   Pose AUC@ 5 ↑ ↑ |
|-----------------------|---------|----------------|---------|-------------------|
| SGAM † [18]+SP+SG [7] |   50.37 |          46.76 |   80.45 |             19.15 |
| w/ GAM ( ϕ = 0 . 5 )  |   54.87 |          50.22 |   67.54 |             19.32 |
| w/ GAM ( ϕ = 1 . 0 )  |   60.36 |          53.47 |   71.31 |             20.54 |
| w/ GAM ( ϕ = 3 . 5 )  |   59.74 |          52.31 |   73.42 |             20.27 |
| MESA+SP+SG            |   65.12 |          77.89 |   94.93 |             20.33 |
| w/ GAM ( ϕ = 0 . 5 )  |   62.34 |          75.56 |   71.65 |             19.97 |
| w/ GAM ( ϕ = 1 . 0 )  |   67.45 |          80.24 |   85.22 |             21.22 |
| w/ GAM ( ϕ = 3 . 5 )  |   68.44 |          83.25 |   94.57 |             22.72 |
| DMESA+SP+SG           |   71.36 |          82.56 |   85.52 |             19.97 |
| w/ GAM ( ϕ = 0 . 5 )  |   72.46 |          84.33 |   64.5  |             20.14 |
| w/ GAM ( ϕ = 1 . 0 )  |   75.33 |          85.46 |   69.08 |             21.23 |
| w/ GAM ( ϕ = 3 . 5 )  |   78.13 |          86.45 |   79.44 |             22.19 |

visual odometry (Sec. 6.5) to showcase the performance of our methods in driving scenes. The impact of input resolution and PM model fine-tuning is experimentally investigated in Sec. 6.6. Further ablation studies about MESA, DMESA and SAM2 [25] are provided in Sec. 6.7. Cross-domain experimental results of our methods are reported in Sec. C of the appendix as well.

## 6.1 Implementation Details

This section describes the implementation details of our method in three aspects, corresponding to three key elements of the A2PM framework: AM, PM and the integration of these two parts.

## 6.1.1 AM Details

The AM phase contains the proposed MESA and DMESA. We offer the parameter settings of both methods here, along with the training details of the learning area similarity model in MESA.

Parameter settings: For MESA , the common parameters for different scenes are set as follows. In AG construction, the input images are resized to 640 × 480 . The aspect ratio threshold T r =4 and minimal size threshold is T s =80 2 . The number of area size threshold is 4 and specific TL i s are 80 2 , 130 2 , 256 2 , 390 2 , 560 2 . The δ l is 0 1 . and δ h is 0 8 . . In graphical area matching, the λ in Eq. (7) is 0 1 . . The area similarity threshold T as = 0 05 . . The energy balance weights ( µ, α, β, γ ) in Eq. (13) are 4 2 2 2 , , , . The specific area level l a ∗ for point matching is 1 . The T Er in Eq. (17) is 0 1 . . Other parameters specified for different scenes are described in experiment sections. Ablation study about the parameter settings of MESA can be found in Sec. F.2 of the appendix. For DMESA , the confidence threshold is empirically set as T c = e -1 / 2 π and the step number of EM is S EM =1 .

Training details: We propose the learning model for area similarity calculation in MESA, whose training protocol is described as follows. Due to the classification formulation, we use the binary cross entropy [47] of each patch classification to form the loss function of area similarity calculation. Regular area images are generated using AG from both indoor and outdoor datasets [48], [49] as the training data. We train the indoor and outdoor models respectively on 2 NVIDIA RTX 4090 GPUs using AdamW [50].

## 6.1.2 PM Details

As described in Sec. 3.3, model fine-tuning is able to increase matching accuracy in specific input sizes. However, this process

TABLE 2

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-8b327065-71a8-496d-9762-0c13c8bce3fe.jpg)

Point Matching on ScanNet1500. Relative gains are highlighted as subscripts. The best , second and third results are highlighted.

|        |                                   | 640 × 640                                      | 640 × 640                                    | 640 × 640                                    | 640 × 480                                        | 640 × 480                                       | 640 × 480                                       | 480 × 480                                           | 480 × 480                                      | 480 × 480                                     |
|--------|-----------------------------------|------------------------------------------------|----------------------------------------------|----------------------------------------------|--------------------------------------------------|-------------------------------------------------|-------------------------------------------------|-----------------------------------------------------|------------------------------------------------|-----------------------------------------------|
|        | Image Matching                    | MMA@3 ↑                                        | MMA@5 ↑                                      | MMA@7 ↑                                      | MMA@3 ↑                                          | MMA@5 ↑                                         | MMA@7 ↑                                         | MMA@3 ↑                                             | MMA@5 ↑                                        | MMA@7 ↑                                       |
| Sparse | SP [5]+SG [7]                     | 20.50                                          | 38.22                                        | 51.84                                        | 20.61                                            | 38.46                                           | 51.82                                           | 20.53                                               | 38.25                                          | 51.56                                         |
| Sparse | SGAM [18]+SP+SG                   | 21.37 +4 . 24%                                 | 40.85 +6 . 88%                               | 53.61 +3 . 41%                               | 21.75 +5 . 53%                                   | 40.23 +4 . 60%                                  | 52.81 +1 . 91%                                  | 22.71 +10 . 62%                                     | 40.45 +5 . 75%                                 | 52.21 +1 . 26%                                |
| Sparse | MESA+SP+SG DMESA+SP+SG            | 24.62 +20 . 10% 22.89 +11 . 66%                | 43.18 +12 . 98% 41.12 +7 . 59%               | 56.29 +8 . 58% 54.29 +4 . 73%                | 25.79 +25 . 13% 22.89 +11 . 06%                  | 44.86 +16 . 64% 41.13 +6 . 94%                  | 57.81 +11 . 56% 54.17 +4 . 53%                  | 25.34 +23 . 43% 23.46 +14 . 27%                     | 44.02 +15 . 08% 41.96 +9 . 70%                 | 56.87 +10 . 30% 55.03 +6 . 73%                |
|        | ASpan [10]                        | 25.13                                          | 47.02                                        | 62.34                                        | 27.50                                            | 49.13                                           | 63.65                                           | 18.97                                               | 37.80                                          | 52.94                                         |
|        | SGAM+ASpan MESA+ASpan DMESA+ASpan | 25.59 +1 . 83% 26.20 +4 . 26% 28.78 +14 . 52%  | 47.64 +1 . 32% 48.94 +4 . 08% 51.06 +8 . 59% | 62.75 +0 . 66% 63.88 +2 . 47% 65.45 +4 . 99% | 24.51 - 10 . 87% 25.60 - 6 . 91% 26.65 - 3 . 09% | 45.95 - 6 . 47% 46.82 - 4 . 70% 48.47 - 1 . 34% | 62.27 - 2 . 17% 61.63 - 3 . 17% 62.99 - 1 . 04% | 20.97 +10 . 54% 22.19 +16 . 97% 25.76 +35 . 79%     | 38.18 +1 . 01% 42.17 +11 . 56% 46.71 +23 . 57% | 53.19 +0 . 47% 57.14 +7 . 93% 60.97 +15 . 17% |
|        | QT [21]                           | 22.85                                          | 41.78                                        | 53.43                                        |                                                  | 52.78                                           | 67.64                                           | 24.56                                               | 45.91                                          | 61.22                                         |
|        | SGAM+QT MESA+QT                   | 23.35 +2 . 19%                                 | 42.13 +0 . 84% 48.41                         | 55.32 +3 . 54%                               | 29.87 30.14 +0 . 90%                             | 52.41 - 0 . 70%                                 | 66.38 - 1 . 86%                                 | 25.54 +3 . 99%                                      | 46.23 +0 . 70% 48.56                           | 62.45 +2 . 01%                                |
|        | DMESA+QT LoFTR [9]                | 29.32 +28 . 32% 24.47 +7 . 09% 26.47           | +15 . 87% 43.72 +4 . 64% 48.99               | 60.34 +12 . 93% 55.44 +3 . 76% 63.75         | 31.25 +4 . 62% 30.39 +1 . 74% 28.18              | 54.73 +3 . 69% 53.47 +1 . 31% 50.68             | 69.15 +2 . 23% 67.94 +0 . 44% 65.43             | 26.93 +9 . 65% 28.72 +16 . 94% 20.08 21.41 +6 . 62% | +5 . 77% 50.70 +10 . 43% 40.22 42.03           | 63.79 +4 . 20% 65.20 +6 . 50% 55.86           |
|        | SGAM+LoFTR                        |                                                | 49.53 +1 . 10% 52.13 +6 . 41%                | 65.52 +2 . 78% 66.64 +4 . 53%                | 26.22 - 6 . 96% 27.12 - 3 .                      | 49.13 - 3 . 06% 49.63 - 2 . 07%                 | 64.73 - 1 . 07% 64.99 - 0 . 67%                 | 22.55 +12 . 30%                                     | +4 . 50% 43.43 +7 . 98%                        | 56.73 +1 . 56% 58.64 +4 . 98%                 |
|        | MESA+LoFTR DMESA+LoFTR            | 27.15 +2 . 57% 29.97 +13 . 22% 29.86 +12 . 81% | 51.94 +6 . 02%                               | 65.77 +3 . 17%                               | 76% 30.29 +7 . 49%                               | 52.75 +4 . 08%                                  | 66.67 +1 . 90%                                  | 27.07 +34 . 81%                                     | 48.48 +20 . 54%                                | 62.63 +12 . 12%                               |
|        | DKM [11]                          | 26.15                                          | 45.92                                        | 59.12                                        | 26.70                                            | 46.82                                           | 60.16                                           | 26.28                                               | 46.31                                          | 59.61                                         |
|        | SGAM+DKM                          | 27.65 +5 . 74%                                 | 46.58 +1 . 44%                               | 60.88 +2 . 98%                               | 27.12 +1 . 57%                                   | 47.11 +0 . 62%                                  | 62.21 +3 . 41%                                  | 27.25 +3 . 69%                                      | 47.62 +2 . 83%                                 | 60.34 +1 . 22% 60.42                          |
|        | MESA+DKM DMESA+DKM                | 30.15 +15 . 30% 28.30 +8 . 22%                 | 50.21 +9 . 34% 48.81 +6 . 29%                | 64.42 +8 . 96% 62.08 +5 . 01%                | 29.67 +11 . 12% 28.51 +6 . 78%                   | 50.69 +8 . 27% 49.26 +5 . 21%                   | 64.01 +6 . 40% 62.77 +4 . 34%                   | 27.87 +6 . 05% 28.66 +9 . 06%                       | 47.85 +3 . 33% 49.52 +6 . 93%                  | +1 . 36% 63.04 +5 . 75%                       |

† The training size.

incurs additional training costs. Therefore, to demonstrate the efficacy of our methods in a practical manner, we utilize the original models of point matchers provided by their authors in the following experiments, unless explicitly stated otherwise.

## 6.1.3 A2PM Details

The A2PM framework is responsible for the integration between AM and PM, which includes the area image cropping (from AM results to PM input) and match fusion (from inside-area PM results to final matching results).

Area image cropping: As described in Sec. 3.3, we crop areas with a specified aspect ratio ( r a := W/H , usually set as 1 ) by area expansion. We adjust the area size to possess the required aspect ratio, while trying to keep the area center unchanged. Specifically, if the original area respect ratio ( W /H a a ) is larger than r a , we fix the width W a of area image and expand the height H a to W /r a a . Otherwise, we fix the H a and expand the W a to H a × r a . If the expanded area exceeds the original image, we will move its center to keep it inside the image. This cropping operation is experimentally confirmed in Sec. F.1 of the appendix.

Match fusion: The final matches can be obtained by merging the inside-area point matches. Instead of naive fusion, we adopt Geometric Area Matching (GAM) [18] to enhance the matching precision utilizing geometry consistency. Additionally, we also adopt the Global Match Collection [18] and set the occupancy ratio as 0 6 . , which achieves global point matches, guided by inside-area matches, to avoid matching aggregation issue.

## 6.2 Area Matching

Since accurate area matching is the prerequisite for the precise feature matching, we first evaluate our methods for this task on ScanNet1500 [48] benchmark.

## 6.2.1 Experimental setup

Wecompare the area matching precision between our methods ( i.e. MESAand DMESA) and semantic-based SGAM [18]. The T E max in MESA is 0 35 . . The area size is 480 × 480 . The settings of GAM parameter ϕ in all methods are also investigated, which reflects the strictness of outlier rejection. We employ the Area Overlap Ratio (AOR, %) and Area Matching Precision (AMP@ 0 6 . , %) [18] as metrics. The AOR utilizes re-projected Intersection of Union (IoU) of matched areas to measure the AM accuracy. The AMP 0 6 . is the proportion of correct area matches, taking AOR &gt; 0 6 . as the threshold of correct AM. Moreover, we propose the Area Cover Ratio (ACR, %), which is the coverage of the all matched areas on the entire image, to measure the completeness of AM. To reveal the relation between AM and the subsequent geometry task, we combine the sparse point matcher SP+SG [7] with the above AM methods, to evaluate the pose estimation accuracy using Pose AUC@ 5 [9], which is the area under the cumulative error curve (AUC) of the pose error at the threshold of 5 ◦ .

## 6.2.2 Results

The results in Tab. 1 show that our methods outperform SGAM by a large gap, e.g. , 60 36 . AOR for SGAM vs. 68 44 . for MESA and 78 33 . for DMESA. DMESA achieves better area matching precision compared to MESA. However, MESA exhibits a higher ACR ( 94 93 . vs. 85 52 . ), possibly due to its dense area comparison, which, although resource-intensive, leads to a greater number of area matches. The improved coverage of area matches enhances the validity of point matches, crucial for subsequent geometric tasks, ultimately resulting in MESA achieving the highest pose estimation accuracy. Nevertheless, the precision of DMESA is also comparable. Considering its faster speed and flexibility, it offers a better efficiency/accuracy trade-off. Additionally, GAM settings impact the precision of both area and point matches. Notably, in both MESA and DMESA, optimal performance is attained with the most relaxed geometric constraint ( ϕ = 3 5 . ), indicating the high accuracy of most area matches obtained by our methods.

## 6.3 Point Matching

Point matching accuracy is a direct reflection of feature matching performance, which is evaluated on ScanNet1500 as well.

## 6.3.1 Experimental setup

To showcase the versatility and effectiveness of our methods, we incorporate five PM baselines, containing all existing three

TABLE 3

Pose Estimation on ScanNet1500. Relative gains are represented as subscripts. The best , second and third results are highlighted.

| Pose   | Pose                   | 640 × 640                       | 640 × 640                     | 640 × 640                     | 640 × 480                      | 640 × 480                       | 640 × 480                      | 480 × 480                      | 480 × 480                      | 480 × 480                     |
|--------|------------------------|---------------------------------|-------------------------------|-------------------------------|--------------------------------|---------------------------------|--------------------------------|--------------------------------|--------------------------------|-------------------------------|
|        | estimation AUC         | AUC@5 ↑                         | AUC@10 ↑                      | AUC@20 ↑                      | AUC@5 ↑                        | AUC@10 ↑                        | AUC@20 ↑                       | AUC@5 ↑                        | AUC@10 ↑                       | AUC@20 ↑                      |
| Sparse | SP [5]+SG [7]          | 20.22                           | 39.62                         | 57.80                         | 20.20                          | 38.87                           | 56.86                          | 19.27                          | 38.06 38.87                    | 56.26 57.48 +2 . 59.51        |
| Sparse | SGAM [18]+SP+SG        | 21.42 +5 . 93%                  | 40.61 +2 . 50%                | 58.34 +0 . 93%                | 21.97 +8 . 76%                 | 39.94 +2 . 75%                  | 57.91 +1 . 85% 60.04           | 20.54 +6 . 59% 22.72           | +2 . 13%                       | 17%                           |
| Sparse | MESA+SP+SG DMESA+SP+SG | 23.42 +15 . 83% 22.60 +11 . 77% | 42.79 +8 . 00% 41.31 +4 . 27% | 61.49 +6 . 38% 59.07 +2 . 20% | 23.24 +15 . 05% 21.97 +8 . 76% | 42.35 +8 . 95% 40.88 +5 . 17%   | +5 . 59% 58.71 +3 . 25%        | +17 . 90% 22.19 +15 . 15%      | 42.25 +11 . 01% 41.25 +8 . 38% | +5 . 78% 58.79 +4 . 50%       |
|        | ASpan [10]             | 24.48                           | 43.64                         | 60.38                         | 28.37                          | 49.24                           | 66.44                          | 22.43                          | 41.67                          | 60.26                         |
|        | SGAM+ASpan             | 25.13 +2 . 66%                  | 44.27 +1 . 44%                | 60.98 +0 . 99%                | 26.14 - 7 . 86%                | 46.85 - 4 . 85%                 | 62.72 - 5 . 60%                | 23.78 +6 . 02%                 | 42.25 +1 . 39%                 | 60.93 +1 . 11%                |
|        | DMESA+ASpan QT [21]    | 25.75 +5 . 19% 22.40            | 45.19 +3 . 55% 40.10          | 62.18 +2 . 98% 56.90          | 26.36 - 7 . 08% 28.56          | 46.60 - 5 . 36% 49.30           | 63.92 - 3 . 79% 65.78          | 24.25 +8 . 11% 21.56           | 44.07 +5 . 76% 40.95           | 62.20 +3 . 22% 57.93          |
|        | SGAM+QT                | 23.71 +5 . 85%                  | 41.55 +3 . 62%                | 56.13 - 1 . 35%               | 26.25 - 8 . 09%                | 44.63 - 9 . 47%                 | 62.73 - 4 . 64%                | 22.79 +5 . 71%                 | 42.04 +2 . 66%                 | 58.20 +0 . 47%                |
|        | MESA+QT DMESA+QT       | 24.12 +7 . 68% 23.41 +4 . 51%   | 43.03 +7 . 31% 41.70 +3 . 99% | 60.13 +5 . 68% 59.14 +3 . 94% | 28.74 +0 . 63% 26.51 - 7 . 18% | 49.12 - 0 . 37% 46.71 - 5 . 25% | 66.03 +0 . 38% 63.41 - 3 . 60% | 24.72 +14 . 66% 23.57 +9 . 32% | 43.57 +6 . 40% 43.00 +5 . 01%  | 60.41 +4 . 28% 59.98 +3 . 54% |
|        | LoFTR [9]              | 21.61                           | 40.03                         | 55.82                         | 25.68                          | 45.86                           | 62.60                          | 20.36                          | 39.44                          | 57.16                         |
|        | SGAM+LoFTR             | 22.05 +2 . 04%                  | 40.11 +0 . 20%                | 56.65 +1 . 49%                | 23.82 - 7 . 24%                | 44.19 - 3 . 64%                 | 61.51 - 1 . 74%                | 21.94 +7 . 76%                 | 40.42 +2 . 48%                 | 57.42 +0 . 45% 58.34          |
|        | MESA+LoFTR DMESA+LoFTR | 23.41 +8 . 33% 22.57 +4 . 44%   | 42.68 +6 . 62% 40.67 +1 . 60% | 57.68 +3 . 33% 56.22 +0 . 72% | 26.23 +2 . 14% 24.37 - 5 . 10% | 46.06 +0 . 44% 44.42 - 3 . 14%  | 62.90 +0 . 48% 61.34 - 2 . 01% | 22.35 +9 . 77% 21.99 +8 . 01%  | 42.04 +6 . 59% 40.53 +2 . 76%  | +2 . 06% 57.52 +0 . 63%       |
|        | DKM [11]               | 29.20                           | 50.96                         | 68.55                         | 29.76                          | 51.65                           | 69.39 69.54                    | 28.55                          | 49.97                          | 67.82                         |
|        | SGAM+DKM MESA+DKM      | 29.45 +0 . 86% 31.84 +9 . 04%   | 51.74 +1 . 53% 53.07 +4 . 14% | 69.91 +1 . 98% 70.12 +2 . 29% | 30.33 +1 . 92% 32.14 +8 . 00%  | 51.96 +0 . 60% 53.97 +4 . 49%   | +0 . 22% 71.02 +2 . 35%        | 29.57 +3 . 57% 30.12 +5 . 50%  | 50.86 +1 . 78% 51.03 +2 . 12%  | 68.39 +0 . 84% 68.71 +1 . 31% |

† The training size.

matching categories, into the A2PM framework as the PM module. These include a widely-used sparse matcher: SP [5]+SG [7]; three SOTA semi-dense matchers: ASpan [10], QT [21], LoFTR [9]; and a leading dense matcher: DKM [11]. For the AM part, we compare MESA, DMESA, and SGAM [18]. The Mean Matching Accuracy (MMA@ 3 / / 5 7 ) [29] is used to measure the precision.

̸

As described in Sec. 3.3, we adopt three PM input resolutions for impact investigation, including a small size ( 480 × 480 ), a middle size ( 640 × 480 , also the training size of baselines) and a large size ( 640 × 640 ). The smaller one leads to less computational cost, while the larger one possesses more details, ideally resulting in better performance. Note the aspect ratio conflict exists in this dataset (the training aspect ratio =1 ). Thus we also evaluate the performance under the training size of 640 × 480 . The choice of PM input resolution influences both computational requirements and matching accuracy, striking a balance between efficiency and precision in practice. By considering these resolutions, we aim to comprehensively assess the practical value of our approaches.

## 6.3.2 Results

The point matching results are summarized in Tab. 2. These results are analyzed with the categories of PM as the primary focus.

For the sparse matcher , SP+SG, we observe consistent and substantial accuracy improvements achieved by our methods across all input sizes. Our methods surpass SGAM by a large margin. MESA exhibits the best overall performance, with DMESA also delivering impressive results. Particularly, MESA/DMESA+SP+SG gains better results with the small size of 480 × 480 than the large size of 640 × 640 (MESA on MMA@7: 56 87 . vs. 56 29 . ), achieving higher accuracy with less computational cost, proving its resolution robustness.

For three semi-dense matchers , the resolution overfitting is noticeable (cf. Sec. 3.3), as the results with the training size remarkably surpass others. In two square resolutions, our methods gain prominent improvements for all three matchers. In the training size, however, declines in precision are observed for MESA/DMESA+ASpan and MESA+LoFTR. This can partly attribute to that this non-square size leads to excessive area size adjustment, which can introduce matching redundancy into area matches. However, our methods still improve the results of QT and surpass SGAM. DMESA achieves better results than MESA here, due to its higher area matching accuracy (cf. Sec. 6.2).

For the dense matcher , the overfitting issue is relatively minor, thanks to the robustness against resolution of DKM. Our methods consistently improve the performance across all three input sizes, notably outperforming SGAM. Additionally, DMESA demonstrates superior performance in the small input size.

## 6.3.3 Discussion

When comparing between Tab. 1 and Tab. 2, counterintuitive results can be observed. MESA generally achieves better PM precision than DMESA, but DMESA obtains better AOR in Tab. 1. This conflict can be attributed to that MESA can obtain more areas with finer granularity (better ACR of MESA and see Fig. 7) by its multi-level area fusion (cf. Sec. 4.2.4) in this dataset. This leads to more precise PM from more detailed feature comparison within areas. On the other hand, the AM accuracy advantage of DMESA is revealed and discussed in Sec. 6.4.6.

Comparing results across the baselines, our methods combined with DKM achieves the best results. The sparse matcher enhanced by our methods achieves precision comparable to its semi-dense counterparts, at the small resolution of 480 × 480 ( e.g. , MESA+SP+SG on MMA@7: 56 87 . vs. LoFTR: 55 86 . ). This underscores the practical significance of our methods, particularly with constrained computational resources , as the sparse method is much more efficient than the semi-dense one.

## 6.4 Pose estimation

Pose estimation between images is a crucial subsequent task of PM and a basic of many applications [4]. Thus, we extensively evaluate the pose estimation precision of our methods here.

## 6.4.1 Experimental setup

In order to showcase the versatility of our methods, we conduct extensive experiments across four datasets encompassing both

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-0f03da97-4691-4f35-9362-021dd5660f32.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-cb3ccaf3-6022-4be1-8c25-4855808400f6.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-45575ef6-772c-4b9b-b366-a19d055b96e5.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-a79fcca4-baab-47bc-b88c-d0750c6df222.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-50d3e616-89c9-41bd-89f0-7dda3b57f206.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-7499c168-5922-4c23-b494-d70d8f19458a.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-3ee9d053-7297-47fa-a6fb-b457d1ea0fc2.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-a836e3a2-7d90-47b8-9850-2f2744e3a5b1.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-6f3eec72-de46-4267-9b39-349c4aa0ac4f.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-0ecd1b83-1fe5-4351-9046-2b521f2007ff.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-1e729f8e-6883-4787-baa0-e383fb4f6cf8.jpg)

MESA+DKM

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-71a64ea0-e701-4d73-8f78-5be10c7ab758.jpg)

DKM

DMESA+DKM

Fig. 7. The qualitative results of our methods. We provide qualitative results of MESA and DMESA on ScanNet1500 and MegaDepth1500. Our methods significantly improve the point matching and pose estimation performance of DKM, by attaining precise area matches.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-da64e082-1b42-472b-86bb-fb88587a1ce5.jpg)

TABLE 4 Pose Estimation on ETH3D. Relative gains are represented as subscripts. The best , second and third results are highlighted.

| Pose estimation AUC                                                                     | AUC@5 ↑                                                                                                                          | AUC@10 ↑                                                                                                      | AUC@20 ↑                                                                                                                              |    |
|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|----|
| SP [5]+SG [7] SGAM [18]+SP+SG MESA+SP+SG                                                | 19.09 19.73 +3 . 35% 22.79                                                                                                       | 32.89 33.14 +0 . 76% 36.43                                                                                    | 46.59 47.58 +2 . 12% 48.51                                                                                                            |    |
| ASpan [10] SGAM+ASpan MESA+ASpan DMESA+ASpan QT [21] SGAM+QT MESA+QT DMESA+QT LoFTR [9] | 16.92 17.35 +2 . 54% 22.31 +31 . 86% 18.73 +10 . 70% 21.72 +24 . 19.29 +10 . 15.27 15.84 +3 . 73% 19.37 +26 . 85% 15.99 +4 . 72% | 31.06 31.88 +2 . 64% 35.71 +14 . 97% 33.24 +7 . 02% 32.35 32.93 +1 . 79% 29.40 +2 . 44% 52.06 51.53 - 1 . 02% | 45.5 46.12 +1 . 36% 63.53 63.02 - 0 . 80% 66.15 +4 . 12% 63.31 - 0 .                                                                  |    |
| MESA+DKM DMESA+DKM                                                                      | 43.47 +12 . 88% 38.27 - 0 . 62%                                                                                                  | +6 . 26% 51.89 - 0 . 33% 30.41                                                                                | 35% 44.21 44.78                                                                                                                       |    |
| SGAM+LoFTR MESA+LoFTR DMESA+LoFTR SP+SG                                                 | 17.41 17.68 +1 . 55% 76% 80%                                                                                                     | 36.77 +13 . 66% 34.41 +6 . 37% 28.70 29.34 +2 . 23% 32.82 +14 . 36% 55.32                                     | 50.07 +10 . 04% 47.83 +5 . 12% 47.39 47.86 +0 . 99% 50.23 +5 . 99% 49.10 +3 . 61% 42.40 42.85 +1 . 06% 46.71 +10 . 17% 43.00 +1 . 42% |    |
| DKM SGAM+DKM SGAM+SP+SG                                                                 | 38.51 37.42 - 2 . 83%                                                                                                            | 31.33 +3 . 03% 35.68 +17 . 33% 32.39 +6 . 51%                                                                 | +1 . 29% 48.85 +10 . 50% 45.94 +3 . 91%                                                                                               |    |
| MESA+SP+SG ASpan                                                                        | 16.59 17.31 +4 . 34%                                                                                                             | 18.94 19.35 +2 . 16% 28.66 +51 . 32% 26.62 +40 . 55%                                                          | 32.49 33.11 +1 . 91% 42.74 +31 . 55% 40.82                                                                                            |    |
| SGAM+ASpan MESA+ASpan DMESA+ASpan                                                       | 22.45 +35 . 18.60 +12 . 8.61 10.13 +17 .                                                                                         | 23.86                                                                                                         | +25 .                                                                                                                                 |    |
| QT SGAM+QT MESA+QT                                                                      | 32% 12% 65% +80 . 84% +61 . 56%                                                                                                  | 24.24 +1 . 59% 32.33 +35 . 50% 30.97 +29 . 80%                                                                | 64% 38.13 39.05 +2 . 41% 46.75 +22 . 61%                                                                                              |    |
| DMESA+SP+SG                                                                             | 15.57 13.91 11.29                                                                                                                | 19.34 19.97 +3 . 26% 27.43                                                                                    | 45.37 +18 .                                                                                                                           |    |
|                                                                                         | 9.12 10.26 +12 . 50% 15.19 +66 . 56%                                                                                             | +41 . 83% 23.93 +23 . 73%                                                                                     | 33.54 +2 . 29% 40.22 +22 .                                                                                                            |    |
| DMESA+QT LoFTR                                                                          | 12.26 +34 . 43% 36.25                                                                                                            | 49.45                                                                                                         | 37.51 +14 .                                                                                                                           |    |
| MESA+LoFTR DKM                                                                          | 37.13 +2 . 43%                                                                                                                   |                                                                                                               | 60.34 60.57 +0 . 38%                                                                                                                  |    |
| SGAM+DKM                                                                                |                                                                                                                                  | 49.85                                                                                                         |                                                                                                                                       |    |
|                                                                                         | 39.98 +10 . 29%                                                                                                                  | +0 . 52.27 +5 .                                                                                               | 62.74 +3 .                                                                                                                            |    |
| SGAM+LoFTR                                                                              |                                                                                                                                  | 81%                                                                                                           |                                                                                                                                       |    |
|                                                                                         |                                                                                                                                  | 70%                                                                                                           |                                                                                                                                       |    |
|                                                                                         |                                                                                                                                  |                                                                                                               | 98%                                                                                                                                   |    |
|                                                                                         | 11.35 +0 . 53%                                                                                                                   |                                                                                                               |                                                                                                                                       |    |
|                                                                                         | 19.63 +73 . 87%                                                                                                                  |                                                                                                               |                                                                                                                                       |    |
|                                                                                         | 16.96 +50 .                                                                                                                      |                                                                                                               |                                                                                                                                       |    |
|                                                                                         | 22%                                                                                                                              |                                                                                                               |                                                                                                                                       |    |
|                                                                                         |                                                                                                                                  |                                                                                                               | 99%                                                                                                                                   |    |
|                                                                                         |                                                                                                                                  |                                                                                                               | 32.79                                                                                                                                 |    |
| DMESA+LoFTR                                                                             |                                                                                                                                  |                                                                                                               |                                                                                                                                       |    |
|                                                                                         |                                                                                                                                  |                                                                                                               | 66% 39%                                                                                                                               |    |
| MESA+DKM                                                                                |                                                                                                                                  |                                                                                                               |                                                                                                                                       |    |
| DMESA+DKM                                                                               | 36.31 +0 . 17%                                                                                                                   | 50.07 +1 .                                                                                                    | 61.57 +2 .                                                                                                                            |    |
|                                                                                         |                                                                                                                                  | 25%                                                                                                           |                                                                                                                                       |    |
|                                                                                         |                                                                                                                                  |                                                                                                               | 04%                                                                                                                                   |    |

indoor and outdoor scenes. Specifically, we utilize two indoor datasets, ScanNet1500 and ETH3D [51], as well as two outdoor datasets, MegaDepth1500 [49] and YFCC [52]. ScanNet1500 and MegaDepth1500 are both in-domain datasets, each comprising 1500 image pairs [10]. For ETH3D, we use the first 10 sequences to conduct experiments, with 3K image pairs sampled from them at a rate of 6 , following [53]. Evaluations on YFCC have been conducted following [32], including 4K outdoor image pairs. For each dataset, we choose a large size and a small size for complete evaluation. Moreover, for the in-domain datasets (ScanNet1500 and MegaDepth1500), we further evaluate on the training resolution to investigate the overfitting issue.

Consistent with our prior experiments, we first select five point matchers as the baselines. Additionally, another cutting-edge dense point matcher, RoMa [12], is combined with our methods and evaluated on the ScanNet1500 and MegaDepth1500. Due to its unique training resolution and large computational cost, we only investigate its performance in the training size of 560 × 560 .

In the indoor scenes, we include SGAM as a comparison method. In the outdoor scenes, we contrast our methods with another overlap matching technique, OETR [17]. The parameter T E max of MESA is set as 0 35 . for indoor scenes and 0 3 . for outdoor scenes. Other parameters are fixed (cf. Sec. 6.1.1).

Typically, RANSAC [54] is employed to filter outliers and derive camera poses. However, adjusting RANSAC parameters can be cumbersome across diverse datasets. Therefore, in our experiments, we employ MAGSAC++ [55] instead, eliminating the parameter adjustment and enhancing the reproducibility.

To facilitate straightforward result comparisons across various datasets, we adopt a unified evaluation metric, specifically the standard pose estimation AUC [7], throughout all the experiments. This metric represents the AUC of the pose error at the thresholds (AUC@ 5 / 10 20 / ), where the pose error is defined as the maximum of angular error in rotation and translation.

## 6.4.2 Results on ScanNet1500

The pose estimation results on ScanNet1500 are reported in Tab. 3. Same as the point matching experiments, we evaluate the pose estimation accuracy across three PM input resolutions.

For the sparse matcher , our methods are able to enhance pose precision consistently and significantly across all resolutions.

TABLE 5

Pose Estimation on YFCC and MegaDepth1500. The subscripts are relative gains. The best , second and third results are highlighted.

|                 |                                                      | MegaDepth1500                                       | MegaDepth1500                                      | MegaDepth1500                                      | MegaDepth1500                                        | MegaDepth1500                                        | MegaDepth1500                                      |                                                    |                                                    |                                                    |                                                     |                                                    |                                                     |
|-----------------|------------------------------------------------------|-----------------------------------------------------|----------------------------------------------------|----------------------------------------------------|------------------------------------------------------|------------------------------------------------------|----------------------------------------------------|----------------------------------------------------|----------------------------------------------------|----------------------------------------------------|-----------------------------------------------------|----------------------------------------------------|-----------------------------------------------------|
| Pose estimation | Pose estimation                                      | 832 × 832 †                                         | 832 × 832 †                                        | 832 × 832 †                                        | 480                                                  | 480                                                  | 480                                                | 640 ×                                              | 640 ×                                              | 640 ×                                              | 480 × 480                                           | 480 × 480                                          | 480 × 480                                           |
|                 |                                                      | AUC@5 ↑                                             | AUC@10 ↑                                           | AUC@20 ↑                                           | AUC@5 ↑                                              | AUC@10 ↑                                             | AUC@20 ↑                                           | AUC@5 ↑                                            | AUC@10 ↑                                           | AUC@20 ↑                                           | AUC@5 ↑                                             | AUC@10 ↑                                           | AUC@20 ↑                                            |
| Sparse          | SP [5]+SG [7] OETR [17]+SP+SG MESA+SP+SG DMESA+SP+SG | 51.27 52.47 +2 . 34% 56.27 +9 . 75% 57.69 +12 . 52% | 67.29 68.35 +1 . 58% 71.35 +6 . 03% 72.34 +7 . 50% | 79.65 80.24 +0 . 74% 82.11 +3 . 09% 83.10 +4 . 33% | 48.14 51.22 +6 . 40% 55.56 +15 . 41% 58.02 +20 . 52% | 63.71 66.04 +3 . 66% 70.89 +11 . 27% 71.77 +12 . 65% | 76.40 78.43 +2 . 66% 81.78 +7 . 04% 82.49 +7 . 97% | 42.18 43.76 +3 . 75% 45.25 +7 . 28% 42.57 +0 . 92% | 62.17 64.11 +3 . 12% 65.37 +5 . 15% 62.46 +0 . 47% | 77.26 78.13 +1 . 13% 79.78 +3 . 26% 77.47 +0 . 27% | 36.20 36.77 +1 . 57% 40.22 +11 . 10% 38.25 +5 . 66% | 56.41 57.31 +1 . 60% 59.79 +5 . 99% 58.12 +3 . 03% | 72.74 73.52 +1 . 07% 75.37 +3 . 62% 74.15 +1 . 94%  |
| Semi-Dense      | ASpan [10] OETR+ASpan MESA+ASpan DMESA+ASpan         | 62.45 63.38 +1 . 49% 64.56 +3 . 38% 64.78 +3 . 73%  | 75.96 76.89 +1 . 22% 78.23 +2 . 99% 78.00 +2 . 69% | 85.45 86.30 +0 . 99% 87.11 +1 . 94% 86.94 +1 . 74% | 48.66 53.24 +9 . 41% 57.32 +17 . 80% 61.76 +26 . 92% | 64.47 66.37 +2 . 95% 70.96 +10 . 07% 75.15 +16 . 57% | 76.89 77.94 +1 . 37% 81.53 +6 . 03% 84.37 +9 . 73% | 46.67 47.37 +1 . 50% 48.78 +4 . 52% 46.95 +0 . 60% | 65.96 66.42 +0 . 70% 67.32 +2 . 06% 66.08 +0 . 18% | 79.65 79.97 +0 . 40% 81.55 +2 . 39% 80.00 +0 . 44% | 41.65 42.53 +2 . 11% 45.52 +9 . 29% 43.32 +4 . 01%  | 61.39 62.27 +1 . 43% 61.97 +0 . 94% 62.93 +2 . 51% | 76.48 77.15 +0 . 88% 79.11 +3 . 44% 77.85 +1 . 79%  |
| Semi-Dense      | QT [21] OETR+QT MESA+QT                              | 62.46 63.17 +1 . 14% 65.11 +4 . 24% 65.01 +4 . 08%  | 76.18 77.32 +1 . 50% 78.32 +2 . 81% 77.91 +2 . 27% | 85.75 86.24 +0 . 57% 87.29 +1 . 80% 86.74 +1 . 15% | 52.65 53.72 +2 . 03% 57.28 +8 . 79% 62.05 +17 . 85%  | 68.24 69.47 +1 . 80% 71.94 +5 . 42% 75.69 +10 . 92%  | 79.53 80.69 +1 . 46% 83.16 +4 . 56% 84.76 +6 . 58% | 47.62 48.32 +1 . 47% 50.32 +5 . 67% 48.32 +1 . 47% | 66.48 67.17 +1 . 04% 68.31 +2 . 75% 67.04 +0 . 84% | 80.07 80.69 +0 . 77% 81.24 +1 . 46% 80.45 +0 . 47% | 43.90 44.62 +1 . 64% 47.21 +7 . 54% 45.62 +3 . 92%  | 63.46 64.17 +1 . 12% 66.35 +4 . 55% 64.84 +2 . 17% | 78.16 78.88 +0 . 92% 80.13 +2 . 52% 79.08 +1 . 18%  |
| Semi-Dense      | DMESA+QT LoFTR [9] OETR+LoFTR MESA+LoFTR DMESA+LoFTR | 59.00 60.47 +2 . 46% 62.50 +5 . 90% 62.54 +5 . 96%  | 73.30 74.22 +1 . 26% 75.33 +2 . 77% 76.06 +3 . 77% | 83.37 84.28 +1 . 09% 85.01 +1 . 97% 85.50 +2 . 55% | 49.02 51.33 +4 . 71% 55.17 +12 . 55% 60.23 +22 . 87% | 65.14 66.71 +2 . 41% 70.34 +7 . 98% 74.22 +13 . 94%  | 77.24 78.56 +1 . 71% 81.18 +5 . 10% 83.82 +8 . 52% | 46.19 46.67 +1 . 04% 48.52 +5 . 04% 46.63 +0 . 95% | 65.33 65.84 +0 . 78% 67.31 +3 . 03% 65.56 +0 . 35% | 79.36 79.93 +0 . 72% 81.29 +2 . 43% 79.48 +0 . 15% | 43.14 44.15 +2 . 34% 46.23 +7 . 16% 44.60 +3 . 38%  | 63.06 64.17 +1 . 76% 65.94 +4 . 57% 65.06 +3 . 17% | 77.82 79.53 +2 . 20% 80.21 +3 . 07% 78.74 +1 . 18%  |
| Dense           | DKM [11] OETR+DKM MESA+DKM DMESA+DKM                 | 62.37 63.35 +1 . 57% 65.21 +4 . 55% 65.48 +4 . 99%  | 75.80 76.23 +0 . 57% 77.94 +2 . 82% 78.11 +3 . 05% | 85.14 85.57 +0 . 51% 86.93 +2 . 10% 86.63 +1 . 75% | 61.70 63.18 +2 . 40% 64.22 +4 . 08% 66.29 +7 . 44%   | 75.24 76.71 +1 . 95% 77.52 +3 . 03% 78.50 +4 . 33%   | 84.49 85.12 +0 . 75% 86.34 +2 . 19% 86.82 +2 . 76% | 51.07 51.26 +0 . 37% 52.13 +2 . 08% 51.60 +1 . 04% | 68.75 69.31 +0 . 81% 69.84 +1 . 59% 69.08 +0 . 48% | 81.24 81.43 +0 . 24% 81.95 +0 . 87% 81.50 +0 . 32% | 50.95 50.97 +0 . 04% 51.33 +0 . 75% 51.18 +0 . 45%  | 68.73 68.79 +0 . 09% 68.97 +0 . 35% 68.79 +0 . 09% | 81.33 81.24 - 0 . 11% 81.74 +0 . 50% 81.44 +0 . 14% |

† The training size.

TABLE 6

Pose Estimation Results of RoMa. We perform pose estimation experiments for leading dense point matcher RoMa [12] on two standard benchmarks. Its training size is 560 × 560 which is different from other baselines. Our methods significantly improve its precision.

| 560 × 560            | ScanNet1500                   | ScanNet1500                   | ScanNet1500                   | MegaDepth1500                 | MegaDepth1500                 | MegaDepth1500                 |
|----------------------|-------------------------------|-------------------------------|-------------------------------|-------------------------------|-------------------------------|-------------------------------|
|                      | AUC@5 ↑                       | AUC@10 ↑                      | AUC@20 ↑                      | AUC@5 ↑                       | AUC@10 ↑                      | AUC@20 ↑                      |
| RoMa [12]            | 32.37                         | 54.52                         | 71.74                         | 65.49                         | 78.25                         | 86.66                         |
| MESA+RoMa DMESA+RoMa | 33.74 +4 . 23% 33.32 +2 . 93% | 56.33 +3 . 32% 55.26 +1 . 36% | 73.59 +2 . 58% 72.48 +1 . 03% | 67.91 +3 . 70% 68.62 +4 . 78% | 80.17 +2 . 45% 80.43 +2 . 79% | 88.47 +2 . 09% 88.41 +2 . 02% |

Notably, the precision gap across resolutions of SP+SG is minor, indicating its robustness. Thus our methods offer stable improvements across various resolutions.

For the semi-dense matchers within A2PM framework, precision declines are observed at the training resolution, same as the point matching experiments, except for MESA+LoFTR. This possibly results from the excessive area size adjustment at the resolution of 640 × 480 (which is not square, cf. Sec. 3.3), which diminishes the advantages of A2PM. However, both MESA and DMESA do significantly improve the pose precision at other square resolutions. This difference can be attributed to the overfitting issue inherent in Transformer [36] of these baselines. To improve precision, fine-tuning of these matchers on square resolutions can be conducted, which sets a new SOTA on this benchmark [24] and will be discussed later in Sec. 6.6.

For the dense matcher DKM , although the best results are achieved at the training size, the disparity in accuracy across resolutions is relatively minor compared to semi-dense matchers. This indicates the better resolution robustness of DKM. Hence, our methods consistently deliver prominent precision enhancement for DKM across all resolutions. The results of RoMa are reported in Tab. 6. Its square training resolution is compatible with A2PM framework. Our methods remarkably improve its performance.

Overall, MESA+DKM yields the best results, which is consistent with the point matching experiments. SP+SG combined with our methods can surpass its semi-dense counterparts in the two square resolutions, e.g. , AUC@20 of MESA+SP+SG: 61 49 . vs. MESA+LoFTR: 57 68 . , with less computational cost. This proves the efficacy of our methods. MESA performs better than DMESA by finding more area matches (higher ACR in Tab. 1 and see Fig. 7). The completeness of area distribution in images is important for pose estimation. However, at 480 × 480 , this performance gap diminishes, particularly with DMESA+DKM surpassing MESA+DKM, demonstrating the practical value of DMESA under limited computational overhead. In our previous version [24], we achieve advanced results by fine-tuning of PM model and RANSAC parameters, albeit at the expense of time and computational resources. Hence, we provide easily reproducible results here, with original model and MAGSAC++. These outcomes further validate the efficacy of our methods.

## 6.4.3 Results on ETH3D

The image pairs from ETH3D possess severe motion blur, light variation and textureless regions, leading to hard pose estimation. The results are summarized in Tab. 4. According to the resolution range of images in ETH3D [56], we choose 640 × 640 as the large size and 480 × 480 as the small one. To remove the resize distortion, we keep the original aspect ratio and use zero-padding to achieve square size, following [9], [32].

For the sparse matcher , our approaches lead to a substantial increase in accuracy. Particularly noteworthy is the performance of MESA+SPSG, which achieves a superior AUC@20 of 48 85 . at 480 × 480 compared to 48 51 . at 640 × 640 . This proves that our method enhances the resolution robustness of the point matcher.

For the three semi-dense matchers , our approach consistently improve the accuracy of point matching at two different resolutions. With the smaller resolution, the original point matchers experience significant performance degradation, which our method effectively mitigate by restoring much of the lost performance, e.g. , attaining a relative improvement up to 80 84% . .

For the dense matcher , the accuracy improvements brought by MESA remain impressive. DMESA relies on the coarse matching of ASpan for area matching. Due to the generalization issue of ASpan, its area matching accuracy falls short of that of MESA in this dataset. Moreover, dense DKM is more sensitive to the accuracy of area matching. Hence, a slight decrease in accuracy for DMESA+DKM at 640 640 × is observed. However, at 480 480 × , DMESA still delivers performance improvements.

In summary, our approach considerably enhance the pose accuracy and resolution robustness of all point matchers on this dataset, significantly surpassing SGAM. Furthermore, DKM outperforms all other point matchers. Building upon this, MESA

TABLE 7

Visual Odometry on KITTI360. Relative gains are highlighted as subscripts. The best , second and third results are highlighted.

| Visual     | Odometry                               |                   |                |                                     |                   |                |                                     | Seq. 05           | Seq. 05        | Seq. 05                              |                   |                |                                |
|------------|----------------------------------------|-------------------|----------------|-------------------------------------|-------------------|----------------|-------------------------------------|-------------------|----------------|--------------------------------------|-------------------|----------------|--------------------------------|
|            |                                        | R err ↓           | t err ↓        | AUC@5 ↑                             | R err ↓           | t err ↓        | AUC@5 ↑                             | R err ↓           | t err ↓        | AUC@5 ↑                              | R err ↓           | t err ↓        | AUC@5 ↑                        |
| Sparse     | SP [5]+SG [7]                          | 0.053             | 0.99           | 80.41 82.98                         | 0.064             | 1.08 0.92      | 79.63 81.76 +2 . 67%                | 0.056             | 1.11 0.96      | 79.22 81.57 +2 .                     | 0.061 0.054       | 0.95 0.78      | 81.42 84.62 +3 . 93%           |
|            | SGAM [18]+SP+SG                        | 0.036 0.027       | 0.89 0.58      | +3 . 20% 88.89 +10 . 55%            | 0.050 0.041       | 0.82           | 87.33 +9 . 67%                      | 0.042 0.034       |                | 97% 87.62 +10 . 60%                  | 0.037 0.041       | 0.62 0.75      | 88.24 +8 . 38% 85.28           |
|            | MESA+SP+SG DMESA+SP+SG                 | 0.034             | 0.84           | 83.53 +3 . 88%                      | 0.046             | 0.89           | 82.80 +3 . 98%                      | 0.039             | 0.78 0.92      | 82.10 +3 . 64%                       |                   |                | +4 . 74%                       |
| Semi-Dense | ASpan [10] SGAM+ASpan                  | 0.087 0.054 0.068 | 1.47 1.32 1.17 | 71.91 76.22 +5 . 99% 78.25 +8 . 82% | 0.173 0.131 0.121 | 2.34 2.12 2.17 | 61.33 66.35 +8 . 19%                | 0.112 0.083       | 1.67 1.43 1.39 | 67.83 73.46 +8 . 30% 76.72 +13 . 11% | 0.114 0.073 0.078 | 1.32 1.17 0.78 | 74.19 78.52 +5 . 84% 81.11     |
|            | MESA+ASpan DMESA+ASpan QT [21] SGAM+QT | 0.051 0.131       | 1.23 2.97      | 76.45 +6 . 31% 58.10 61.32 +5 . 54% | 0.134 0.164 0.131 | 2.10 3.84      | 66.42 +8 . 30% 66.08 +7 . 74% 55.26 | 0.078 0.064       | 1.26 3.60      | 75.21 +10 . 88% 53.42 56.71          | 0.062 0.153       | 1.01 2.87      | +9 . 33% 80.36 +8 . 32% 60.06  |
|            | MESA+QT DMESA+QT                       | 0.104             | 2.76           | 66.71 +14 . 82% 61.10 +5 . 16%      | 0.113             | 3.42           | 58.23 +5 . 37% 66.21 +19 . 82%      | 0.152 0.144 0.162 | 3.02 2.87      | 64.52 +20 . 78% 60.50 +13 . 25%      | 0.110 0.123       | 2.41 2.33      | 63.21 +5 . 24% 71.22 +18 . 58% |
|            |                                        | 0.094             | 2.43           |                                     | 0.102             | 3.14 3.17      |                                     |                   | 2.59           | +6 . 16%                             | 0.094             | 2.04           | 69.43                          |
|            | LoFTR [9] SGAM+LoFTR                   | 0.080             | 2.49 1.55      | 72.80 74.21                         | 0.110 0.093       | 1.49 1.40      | 61.26 +10 . 86% 74.16               | 0.151             | 1.49           | 71.59 73.25                          | 0.114 0.095       | 1.28 1.22      | +15 . 60% 75.66                |
|            |                                        | 0.112 0.092       | 1.41           | +1 . 94%                            |                   |                | 76.22 +2 . 78%                      | 0.112             | 1.42           | +2 . 32%                             |                   |                | 77.26 +2 . 11%                 |
|            | MESA+LoFTR                             | 0.083             | 1.32           | 75.33 +3 . 48% 78.50                | 0.087             |                | 75.63                               | 0.083             |                | 75.24 +5 . 10%                       | 0.088             | 1.21           | 79.44 +5 . 00%                 |
|            | DMESA+LoFTR                            | 0.057             | 1.22           |                                     | 0.070             | 1.44           | +1 . 98%                            | 0.076             | 1.35 1.09      | 78.46                                | 0.061             | 0.95           | 81.92 +8 . 27%                 |
|            |                                        |                   |                | +7 . 83%                            |                   | 1.18           | 78.66 +6 . 07%                      | 0.064             |                | +9 . 60%                             |                   |                |                                |
|            | DKM [11] SGAM+DKM                      | 0.027             | 0.30           | 94.08                               | 0.099             | 0.49           | 91.52                               | 0.039             | 0.43           | 91.40                                | 0.034             | 0.38           | 92.31                          |
| Dense      |                                        | 0.022             | 0.25           | 95.32 +1 . 32%                      | 0.046             | 0.41           | 92.34 +0 . 90%                      | 0.026             | 0.31           | 92.68 +1 . 40%                       | 0.027             | 0.34           | 93.67 +1 . 47%                 |
|            | MESA+DKM                               | 0.018             | 0.20           | 96.13 +2 . 18%                      | 0.027             |                | 94.32 +3 . 06%                      | 0.022             | 0.25           | 95.18 +4 . 14%                       | 0.022             | 0.26           | 95.31 +3 . 25%                 |
|            | DMESA+DKM                              | 0.022             | 0.29           | 94.13 +0 . 05%                      | 0.034             | 0.44           | 91.94 +0 . 46%                      | 0.028             | 0.41           | 92.34 +1 . 03%                       | 0.026             | 0.35           | 93.05 +0 . 80%                 |
|            |                                        |                   |                |                                     |                   | 0.33           |                                     |                   |                |                                      |                   |                |                                |

further enhance the accuracy of DKM, achieving performance comparable to that of in-domain dataset (ScanNet1500).

## 6.4.5 Results on YFCC

## 6.4.4 Results on MegaDepth1500

MegaDepth serves as the outdoor training dataset for our baselines. In the MegaDepth1500 benchmark, we select a size of 832 × 832 as the large resolution, which is also used in training [9], [10], [21]. A small resolution ( 480 × 480 ) is also adopted for comparison. The resize distortion is avoided by shorter-side padding [7]. The results are reported in Tab. 5.

For the sparse matcher , our approaches yield stable and remarkable improvements in accuracy, overcoming OETR significantly. Moreover, the precision gap between resolutions is notably reduced by MESA/DMESA, demonstrating the effectiveness of our method and their robustness to resolution variations.

For the semi-dense matchers , without the overfitting issue on the indoor training dataset (ScanNet), our methods consistently and considerably improve pose accuracy on the training size. This can be interpreted as the training resolution on this dataset is square, aligning well with the A2PM framework (cf. Sec. 3.3). Thus, the precise AM of our methods effectively reduce the matching redundancy and ultimately increase the performance of these semi-dense point matchers. The performance gap between resolutions is notably narrowed by our methods as well.

For the dense matcher DKM , our methods improve pose accuracy at both resolutions, setting a new SOTA on this benchmark. Considering the AM sensitivity of DKM due to its dense computation, this proves the efficacy of MESA and DMESA. The results of RoMa are reported in Tab. 6. It can be seen that the precision improvement from our methods is prominent as well, setting a new SOTA in this benchmark.

Overall, our methods significantly surpass the previous SOTA, OETR. It is noteworthy that DMESA+DKM achieves superior results with the small resolution compared to the large one (AUC@5: 66 29 . of 480 × 480 vs. 65 48 . of 832 × 832 ), impressively leading to numerous reductions in computational costs. This demonstrates the superior of DMESA in terms of both accuracy and efficiency.

As per [16], [35], the longer sides of YFCC images are typically shorter than 640 . Therefore, in this experiment, we choose 640 × 640 as the larger resolution and 480 × 480 as the smaller one. To prevent aspect ratio distortions, we apply shorter-side padding during resizing [7]. The results are reported in Tab. 5.

For the sparse point matcher , MESA brings about the most noteworthy improvement in accuracy at both resolutions. The performance improvement of DMESA is not as strong as OETR at 640 × 640 , which may be attributed to the generalization issues of the coarse matcher on which DMESA relies. However, at the smaller resolution, DMESA outperforms OETR, highlighting the robustness of our method to resolution variations.

For the semi-dense matchers , MESA also leads to prominent improvement for all matchers at both resolutions. DMESA sacrifices some accuracy but in return gains greater speed and improved flexibility. It also performs better at the smaller resolution, surpassing OETR.

For the dense matcher , our approaches demonstrate consistent accuracy improvements, albeit relatively limited. This can be attributed to the increased difficulty in AM caused by the abundance of repetitiveness in YFCC, as DKM is sensitive to AM accuracy.

In sum, on this dataset, MESA shows the best performance and demonstrates superior generalization. Both of our approaches generally outperform OETR, proving their effectiveness.

## 6.4.6 Discussion

Here, we provide a summary and analysis of the pose estimation results obtained from the above four datasets. Generally, MESA and DMESA each have their own merits.

First, for the indoor datasets, MESA demonstrates superior accuracy compared to DMESA (cf. Tab. 3 and Tab. 4). This superiority can be attributed to the fact that MESA achieves AM results by fusing SAM segments in AG. Consequently, area matches produced by MESA have better ACR in Tab. 1 and contains rich semantic information, usually encompassing complete semantic entities. This proves advantageous for inside-area PM, especially in intricate indoor scenes.

Fig. 8. Experiment Results about Input Size and Model Fine-Tuning. The figure illustrates pose estimation experiments with five point matchers on ScanNet1500, displaying a line graph of pose accuracy concerning input sizes. Two types of dashed lines represent the results of MESA and DMESA. The orange lines indicate the outcomes of the original models trained on the resolution of 640 × 480 , while the blue lines represent the results of models fine-tuned on the resolution of 640 × 640 .

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-c8503091-0a1f-4082-80af-fe29e546360d.jpg)

Conversely, DMESA, which relies on patch matching, achieves area matches with constrained sizes but excels in AM accuracy (cf. Tab. 1). Hence, it performs better in scenes with repetitive patterns and coarser semantic granularity, like MegaDepth (cf. Tab. 5 left). On the other hand, MESA possesses better crossdataset generalization than DMESA (cf. Tab. 5 right), because of the limitation of off-the-shelf patch matching in DMESA. More generalization experiments can be found in Sec. C of the appendix. However, DMESA requires no additional training and is faster than MESA, making it a compelling choice in practice. Overall, both the proposed methods significantly enhance matching accuracy for all PM baselines.

## 6.5 Visual Odometry

To further evaluate the performance of our methods in downstream tasks, we conducted experiments on visual odometry, which densely estimates the camera motion in the driving scene, using the KITTI360 dataset.

## 6.5.1 Experimental setup

According to the static scene assumption [1] of our baselines, we select four sequences from the dataset that contain a small number of moving objects, each comprising 3000 images. The parameter T E max of MESA is set as 0 25 . . The input image size is 640 × 640 . We utilize the same baselines as in other experiments, which are trained on ScanNet [48]. MAGSAC++ is used to estimate poses. Following [57], we report the relative pose errors (RPE), including the rotational error ( R err ) and translation error ( t err ), along with the pose estimation AUC@ 5 for better comparisons.

## 6.5.2 Results

The results are presented in Tab. 7. For the sparse matcher , MESA and DMESA both obtain notable and consistent improvement across all sequences, surpassing SGAM, validating the effectiveness of our methods.

For the semi-dense matchers , the performance improvement brought by our methods are remarkable. MESA and DMESA respectively yield performance boosts of up to 20 78% . and 15 60% . . It is worth noting that when employing LoFTR, DMESA outperforms MESA across all sequences with increased efficiency, making it a more practical choice in this situation.

For the dense matcher , our methods further enhance its accuracy, achieving the best results on this dataset. While the performance of DMESA is inferior to SGAM, it provides an enhancement for DKM. This possibly is caused by the AM sensitivity of DKM and generalization challenge of DMESA.

In this experiment, our method has demonstrated the ability to enhance the accuracy of visual odometry for all point matchers. Notably, when integrated with our approach, SP+SG exhibits substantial improvements. It surpasses semi-dense matchers by a considerable margin, even approaching the performance level of dense matching. Given the efficiency advantage of sparse matching over dense/semi-dense matching, this evidently emphasizes the practical value of our methods.

## 6.6 Study of Input Resolution and Model Fine-tuning

In the experiments conducted in ScanNet1500, the resolution overfitting of PM baselines is observed. Especially for the Transformer-based methods, our methods lead to performance decline at the training resolution (cf. Tab. 2 and Tab. 3). In this section, we show that this issue can be migrated by model finetuning tailored to the square resolution. Moreover, we explore a broader range of resolutions to investigate the resolution robustness of our methods with or without model fine-tuning.

## 6.6.1 Experimental setup

We select four sets of resolutions, including three square sizes ranging from small to large ( [320 2 , 480 2 , 640 ] 2 ) and the training resolution of 640 × 480 . The overfitting issue is absent in the outdoor training dataset, which uses the square resolution in training. Thus, we fine-tune the point matchers at 640 × 640 , obtaining finetuned models identified by a '-FT' suffix. Except for SP+SG, it does not encounter any overfitting issue in previous experiments. The original models are labeled with an '-O' suffix. We evaluate the performance of different methods using the average of pose estimation AUC@5/10/20, referred to as Mean AUC .

## 6.6.2 Results

The results are depicted in Fig. 8. For the sparse matcher , our methods not only significantly improve performance but also reduce the accuracy gap across resolutions. The results of DMESA are particularly strong at 320 × 320 , surpassing those of MESA.

For the semi-dense matchers , we observe that the original models exhibit a consistent performance peak at the training size, indicating overfitting to this training resolution and a high sensitivity to resolution variations. Consequently, our methods show limited advantages over the original model at the training size, but they do improve accuracy at other sizes. For the fine-tuned models, our approaches enhance accuracy across all resolutions, surpassing the performance of original models at the training size. We also note a decrease in performance at 640 × 480 for the fine-tuned models, indicating that fine-tuning may not be the

Fig. 9. The qualitative comparison of Global Energy Refinement. As AG structures of both images are considered by E G , objects with the same apparent can be distinguished according to their neighbors, which are mismatched by arg min E self , revealing the robustness of arg min E G under repetitive patterns.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-6275c8e3-f9ad-4d1a-b34c-fa3facf406c3.jpg)

TABLE 8 Ablation study of MESA. Four variants of MESA+ASpan are evaluated for area matching and pose estimation on the ScanNet1500 to demonstrate the importance of various components.

| Method              |   AOR ↑ |   AMP@0.6 ↑ |   PoseAUC@5 ↑ |   ACR ↑ |
|---------------------|---------|-------------|---------------|---------|
| MESA+ASpan ( Ours ) |   72.75 |       89.09 |         27.5  |   95.8  |
| w/ CSD              |   69.23 |       84.21 |         26.78 |   87.33 |
| w/ DesSim. [32]     |   63.71 |       62.91 |         26.05 |   80.11 |
| w/ SEEMSeg. [58]    |   70.58 |       85.52 |         26.18 |   72.51 |
| w/ arg min E self   |   70.98 |       87.56 |         26.96 |   91.64 |

optimal solution for resolution sensitivity. DMESA demonstrates outstanding performance at the small resolution of 320 × 320 .

For the dense matcher , although the performance peak still exists, the original model exhibits much less sensitivity to resolution compared to the semi-dense matchers (note the scale of the vertical axis). Therefore, our methods significantly improve accuracy for the original model across all resolutions. After fine-tuning, the performance of MESA and DMESA is further enhanced at 640 × 640 . DMESA continues to excel at the small resolution, consistent with its emphasis on efficiency.

Overall, our methods boost the accuracy of all point matchers and enhance their robustness to resolution variations, irrespective of whether the point matcher is fine-tuned or not. However, model fine-tuning at square resolution is effective to address the overfitting issue for Transformer-based matchers. Notably, MESA demonstrates superior accuracy at high resolutions, whereas DMESA stands out at low resolutions. Both approaches are viable for practice based on specific computational resource constraints.

## 6.7 Ablation Study

## 6.7.1 Understanding MESA

To evaluate the effectiveness of our design in MESA, we conduct a comprehensive ablation study here. We use MESA+ASpan as the baseline. The input resolution of PM is 640 × 640 and the model of ASpanFormer is fine-tuned at 640 × 640 as well.

Area Graph Construction. To justify the AG of MESA, we adopt a naive approach to match areas, which is comparing area similarity densely (CSD). In particular, we first select areas with proper size from all SAM areas of two images. The similarity of each area to all areas in the other images is then calculated and area matches with the greatest similarity is obtained. The comparison results are summarized in Tab. 8. As AG can generate more proper areas for matching, MESA w/ CSD gets less area matches. Thus, the area and point matching performance is also decreased by CSD. Moreover, CSD results in a significant increase

TABLE 9 Ablation study of DMESA. We show area matching and pose estimation performance of SP+SG+DMESA on ScanNet1500 w.r.t two parameters of DMESA. The parameters we applied are highlighted .

|             |   AOR ↑ |   AMP@0.6 ↑ |   Pose AUC@5 ↑ |   ACR ↑ |
|-------------|---------|-------------|----------------|---------|
| f (1 / 8) † |   79.11 |       88.02 |          22.13 |   77.12 |
| f (1 / 2) † |   79.26 |       87.54 |          21.68 |   78.02 |
| f (1) †     |   78.13 |       86.45 |          22.19 |   79.44 |
| f (2) †     |   77.41 |       84.13 |          21.56 |   80.22 |
| f (4) †     |   75.26 |       80.55 |          21.28 |   81.39 |
| 0           |   75.82 |       85.97 |          21.68 |   78.84 |
| 1           |   79.38 |       86.52 |          21.37 |   76.53 |
| 3           |   78.13 |       86.45 |          22.19 |   79.44 |
| 5           |   77.3  |       86.59 |          21.57 |   81.13 |
| 7           |   76.14 |       85.74 |          21.69 |   83.66 |

† f ( x ) = 1 2 π e -x in time of area matching (nearly × 10 slower than MESA), due to its inefficient dense comparison.

Area Similarity Calculation. In contrast to our classification formulation for area similarity calculation, another straightforward method [32] involves calculating the distance between learning descriptors of areas. Thus, we replace our learning similarity with descriptor similarity in [32] ( DesSim ) and conduct experiments in ScanNet to investigate the impact. The results are summarized in Tab. 8, including the area number per image, area matching and pose estimation performance. Overall, the performance of DesSim experiences a noticeable decline, due to poor area matching precision, indicating the effectiveness and importance of proposed learning similarity calculation.

Image Segmentation Source. We relay on SAM to achieve areas with implicit semantic, whose outstanding segmentation precision and versatility contribute to our leading matching performance. However, areas can also be obtained from other segmentation methods. Therefore, to measure the impact of different segmentation sources, we exchange the segmentation input from SAM [13] with that from SEEM [58] ( SEEMSeg. ) and evaluate the performances. In Tab. 8, MESA with SEEMSeg. gets a slight precision decline and fewer areas compared with SAM, leading to decreased pose estimation results. These results indicates that the advanced segmentation favors our methods. Notably, MESA with SEEMSeg. also achieves a slight improvement for ASpan, proving the effectiveness of MESA.

Global Energy Refinement. After Graph Cut , the proposed global matching energy for the final area matching refinement considers structures of both AGs of the input image pair. To show the importance of this dual-consideration, we replace the global energy with naive E self in Eq. (14) ( arg min E self ) and evaluate the performance. In Tab. 8, the refinement relying on E self produces decreased area matching precision and a subsequent decline in pose estimation performance, due to inaccurate area matches especially under repetitiveness. The qualitative results shown in Fig. 9 further indicate the better robustness of global energy under repetitiveness due to dual graph structure capture.

## 6.7.2 Understanding DMESA

In contrast to the complex process of MESA, DMESA involves just two parameters from two components necessitating configuration. One parameter is the confidence threshold T c for area extraction from the matching distribution; while the other, the EM algorithm step number S EM , regulates the fusion degree of

TABLE 10

SAM vs. SAM2. We investigate the impact of recent SAM2 on our methods. The experiments are constructed on ScanNet1500. We report the performance of area matching, point matching and pose estimation.

|                      | AOR ↑   | ACR ↑   |   MMA@3 ↑ |   AUC@5 ↑ |
|----------------------|---------|---------|-----------|-----------|
| SP [5]+SG [7]        | -       | -       |     20.53 |     19.27 |
| SAM [13]+MESA+SP+SG  | 68.44   | 94.57   |     25.34 |     22.72 |
| SAM2 [25]+MESA+SP+SG | 70.67   | 85.43   |     25.57 |     22.48 |
| SAM+DMESA+SP+SG      | 78.13   | 79.44   |     23.46 |     22.19 |
| SAM2+DMESA+SP+SG     | 82.15   | 67.23   |     24.77 |     22.11 |

the results from the two matching directions. In this section, we perform ablation study on the two parameters using SP+SG as the point matcher on ScanNet1500, assessing both area matching and pose estimation precision. Given the orthogonal nature of two parameters, during experiments focusing on one parameter, we retain the other at its default setting ( T c = e -1 / (2 π , S ) EM = 3 ).

Confidence Threshold. On the AM distribution, only locations with confidence exceeding the T c contribute to area matching. These confidences are determined by a GMM from the patch matches. Hence, we use the standard Gaussian distribution, N ( x | 0 , I ) = 1 (2 / π ) · exp( -∥ x ∥ 2 / 2) , as a reference to set this threshold T c . Specifically, we choose ∥ x ∥ = [1 / 2 1 , , √ 2 2 2 , , √ 2] , resulting in corresponding confidence thresholds of: [ e -1 / 8 / (2 π , e ) -1 / 2 / (2 π , e ) -1 / (2 π , e ) -2 / (2 π , e ) -4 / (2 π )] . The results are reported in Tab. 9. We observe that AM accuracy increases with T c . However, as the coverage of areas ( ACR ) in the image decreases at the same time, there is a risk of missing valid point matches, harmful to pose estimation accuracy. Therefore, we set T c = e -1 / (2 π ) to strike a balance between AM accuracy and coverage, achieving the best pose accuracy.

Step number of EM. DMESA merges the results from two different matching directions using a finite-step EM algorithm, thus improving the area matching through cycle consistency. Hence, the number of EM algorithm steps should be kept moderate; excessively low or high step counts may bias the refined results towards one matching direction rather than achieving a consistent outcome between the two. We experimented with values of S EM = [0 1 3 5 7] , , , , , and the results are presented in Tab. 9. It is evident that the step count influences both the area matching accuracy ( AOR ) and coverage ( ACR ), thus resulting nonlinear variations in pose estimation precision. A moderate setting of S EM = 3 can yield the best pose estimation accuracy. We also provide qualitative results about the S EM in Fig. 10, further justifying the efficacy of the moderate setting.

## 6.7.3 SAM vs. SAM2

The recent SAM2 [25] enhances segmentation consistency across various video frames, which is particularly beneficial for area matching. Thus, we conduct experiments to assess the impact of substituting SAM with SAM2 in our methods. We opt for the ScanNet1500 dataset, given that its image pairs are sourced from indoor videos. We employ SP+SG as our point matcher with an input resolution of 480 × 480 . The performance metrics for area matching ( AOR ACR , ), point matching ( MMA@3 ), and pose estimation ( AUC@5 ) are presented in Table 10. The results indicate a notable enhancement in area and point matching accuracy when using SAM2, attributed to its improved segmentation consistency. However, there is a substantial decrease in area coverage with SAM2, likely due to its reduced number of masks compared to

TABLE 11

Time Consumption Comparison. The average time cost of area matching per image utilizing different methods is summarised. The experiment is conducted on 500 image pairs sampled from YFCC.

| Method    | Step                                                                           | Time(ms)                          |
|-----------|--------------------------------------------------------------------------------|-----------------------------------|
| MESA      | AG Construction Similarity Calculation Graph Cut Energy Minimization Total     | 384.22 2953.17 3.24 6.15 3346.78  |
| DMESA     | AG Construction Coarse Matching Patch Confidence Rendering EM Refinement Total | 378.13 118.35 84.56 125.39 706.43 |
| SGAM [18] | Total                                                                          | 693.87                            |
| OETR [17] | Total                                                                          | 653.74                            |

SAM, which is a trade-off for achieving segmentation coherence. Consequently, the pose estimation accuracy diminishes when employing SAM2. The degradation is minor though, implying the stability of our methods with various segmentation sources.

## 6.8 Running Time Comparison

In this section, the average time consumption of AM methods on each image pair is recorded, to demonstrate the efficiency.

## 6.8.1 Experimental setup

To facilitate the comparison with other methods [17], [18], we choose the YFCC dataset and randomly sample 500 images ( 480 × 480 ) from it for constructing the experiment. This experiment is conducted on an Intel Xeon Silver 4314 CPU and a GeForce RTX 4090 GPU. Our comparative methods include SGAM, which establishes area matches grounded on explicit semantic, and OETR, which focuses on establishing matches of co-visible areas. In addition, we record the time consumption of the every individual modules of both MESA and DMESA.

## 6.8.2 Results

The results are presented in Tab. 11. From the table, it is evident that MESA incurs the longest time consumption, primarily due to the intensive computation involved in assessing area similarities. This can be further attributed to the sparse AM framework of MESA, which leads to repetitive computation as described in Sec. 5. Therefore, DMESA adopts a dense AM framework, effectively reducing the repetitive computation. By incorporating a coarse matching stage of an off-the-shelf point matcher, the cost of single area matching is also reduced. Ultimately, DMESA achieves a speed approximately 5 times faster than MESA while maintaining competitive accuracy. Furthermore, the speed of DMESA aligns closely with that of other two SOTA methods.

## 7 DISCUSSION AND CONCLUSION

The results presented in Sec. 6 prove the effectiveness of the proposed MESA and DMESA. Both of them consistently and significantly increase precision for six PM baselines on three tasks across five various datasets. DMESA demonstrates a nearly fivefold speed improvement over MESA while maintaining competitive accuracy, offering a superior accuracy/speed trade-off. Besides, our methods substantially improve the matching robustness against variations in data domain and input resolution, benefiting the downstream tasks. However, our methods still suffers from

Fig. 10. The qualitative results of finite-step EM refinement of DMESA. We present the source area along with its corresponding patch matches in the target image across various EM step numbers ( S EM ). The green dots are patch centers and the distributions of GMM are visualized as well. With the increase of S EM , the patches become clustered into image regions with distinct features ( e.g. , the upper-left corner of the laptop in the bottom). These regions exhibit high confidence in both matching directions, thereby enhancing overall accuracy. Additionally, it is evident that an excessively large S EM does not contribute to patch refinement, as the patches are already stabilized in the initial stages.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-07cf2ddf-b0dc-4e74-8d09-9ecba4b61bcf.jpg)

challenges like severe repetitiveness. The utilization of SAM features is also inadequate. Overcoming these limitations is a primary objective for our future work. A detailed analysis of these limitations can be found in Sec. G of the appendix.

- [10] H. Chen, Z. Luo, L. Zhou, Y. Tian, M. Zhen, T. Fang, D. McKinnon, Y. Tsin, and L. Quan, 'Aspanformer: Detector-free image matching with adaptive span transformer,' ECCV , pp. 20-36, 2022. 1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 20

For effective matching redundancy reduction, we propose MESA and DMESA to leverage the general image understanding capability of SAM in this work. While both methods focus on area matching from SAM results, MESA follows a sparse framework, whereas DMESA adopts a dense fashion. Specifically, we first propose a novel graph, named AG, to model the global context of SAM segments and identify areas with prominent semantics. Then, MESA minimizes energy on the graph to match these areas, leveraging graphical models. To overcome the efficiency limitation from the sparse nature of MESA, DMESA is proposed as a dense counterpart. It deduces area matches from off-the-shelf patch matches, by utilizing GMM to generate dense matching distributions for areas. To further refine accuracy, DMESA employs a finite-step EM algorithm to pursuit cycle-consistency. Our methods enable integration with PM baselines belonging to sparse, semi-dense and dense frameworks. In extensive experiments, consistent and prominent precision improvements from our methods for various PM baselines are observed across different datasets, confirming their efficacy.

## REFERENCES

- [1] C. Campos, R. Elvira, J. J. G. Rodr´ ıguez, J. M. Montiel, and J. D. Tard´s, o 'Orb-slam3: An accurate open-source library for visual, visual-inertial, and multimap slam,' IEEE Transactions on Robotics , 2021. 1, 14
- [2] J. L. Schonberger and J.-M. Frahm, 'Structure-from-motion revisited,' in Proceedings of the IEEE conference on computer vision and pattern recognition , 2016, pp. 4104-4113. 1
- [3] P.-E. Sarlin, A. Unagar, M. Larsson, H. Germain, C. Toft, V. Larsson, M. Pollefeys, V. Lepetit, L. Hammarstrand, F. Kahl et al. , 'Back to the feature: Learning robust camera localization from pixels to pose,' in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , 2021, pp. 3247-3257. 1
- [4] J. Ma, X. Jiang, A. Fan, J. Jiang, and J. Yan, 'Image matching from handcrafted to deep features: A survey,' International Journal of Computer Vision , vol. 129, no. 1, pp. 23-79, 2021. 1, 10
- [5] D. DeTone, T. Malisiewicz, and A. Rabinovich, 'Superpoint: Selfsupervised interest point detection and description,' Proceedings of the IEEE conference on computer vision and pattern recognition workshops , pp. 224-236, 2018. 1, 3, 9, 10, 11, 12, 13, 16, 20
- [6] J. Revaud, C. De Souza, M. Humenberger, and P. Weinzaepfel, 'R2d2: Reliable and repeatable detector and descriptor,' Advances in neural information processing systems , vol. 32, 2019. 1, 3
- [7] P.-E. Sarlin, D. DeTone, T. Malisiewicz, and A. Rabinovich, 'Superglue: Learning feature matching with graph neural networks,' Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) , June 2020. 1, 3, 8, 9, 10, 11, 12, 13, 16, 20
- [8] P. Lindenberger, P.-E. Sarlin, and M. Pollefeys, 'LightGlue: Local feature matching at light speed,' ICCV , 2023. 1
- [9] J. Sun, Z. Shen, Y. Wang, H. Bao, and X. Zhou, 'LoFTR: Detector-free local feature matching with transformers,' CVPR , 2021. 1, 2, 3, 9, 10, 11, 12, 13, 19, 20
- [11] J. Edstedt, I. Athanasiadis, M. Wadenb¨ ack, and M. Felsberg, 'DKM: Dense kernelized feature matching for geometry estimation,' CVPR , 2023. 1, 2, 3, 4, 9, 10, 12, 13, 20
- [12] J. Edstedt, Q. Sun, G. B¨kman, M. Wadenb¨ ack, and M. Felsberg, 'Roma: o Robust dense feature matching,' in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) , June 2024, pp. 19 790-19 800. 1, 3, 11, 12
- [13] A. Kirillov, E. Mintun, N. Ravi, H. Mao, C. Rolland, L. Gustafson, T. Xiao, S. Whitehead, A. C. Berg, W.-Y. Lo, P. Doll´ ar, and R. Girshick, 'Segment anything,' ICCV , 2023. 1, 15, 16
- [14] K. T. Giang, S. Song, and S. Jo, 'Topicfm: Robust and interpretable topic-assisted feature matching,' AAAI , vol. 37, no. 2, pp. 2447-2455, 2023. 1, 3
- [15] X. Cai, Y. Wang, L. Luo, M. Wang, D. Li, J. Xu, W. Gu, and R. Ai, 'PRISM: PRogressive dependency maximization for scale-invariant image matching,' in ACM Multimedia 2024 , 2024. [Online]. Available: https://openreview.net/forum?id=QZkHgKqIuG 1, 3
- [16] D. Huang, Y. Chen, Y. Liu, J. Liu, S. Xu, W. Wu, Y. Ding, F. Tang, and C. Wang, 'Adaptive assignment for geometry aware local feature matching,' CVPR , 2023. 1, 13
- [17] Y. Chen and et al, 'Guide local feature matching by overlap estimation,' AAAI , vol. 36, no. 1, pp. 365-373, 2022. 1, 3, 11, 12, 16
- [18] Y. Zhang, X. Zhao, and D. Qian, 'Searching from area to point: A hierarchical framework for semantic-geometric combined feature matching,' arXiv , 2023. 1, 2, 3, 4, 8, 9, 10, 11, 13, 16, 22
- [19] J. Ma and B. Wang, 'Segment anything in medical images,' arXiv preprint arXiv:2304.12306 , 2023. 2
- [20] T. Yu, R. Feng, R. Feng, J. Liu, X. Jin, W. Zeng, and Z. Chen, 'Inpaint anything: Segment anything meets image inpainting,' arXiv preprint arXiv:2304.06790 , 2023. 2
- [21] S. Tang, J. Zhang, S. Zhu, and P. Tan, 'Quadtree attention for vision transformers,' ICLR , 2022. 2, 3, 9, 10, 11, 12, 13, 19, 20
- [22] V. Kolmogorov and R. Zabin, 'What energy functions can be minimized via graph cuts?' IEEE transactions on pattern analysis and machine intelligence , vol. 26, no. 2, pp. 147-159, 2004. 2, 6
- [23] P. Gleize, W. Wang, and M. Feiszli, 'Silk-simple learned keypoints,' ICCV , 2023. 2, 7, 8
- [24] Y. Zhang and X. Zhao, 'Mesa: Matching everything by segmenting anything,' in IEEE Conference on Computer Vision and Pattern Recognition (CVPR) , 2024. 2, 12
- [25] N. Ravi, V. Gabeur, Y.-T. Hu, R. Hu, C. Ryali, T. Ma, H. Khedr, R. R¨ adle, C. Rolland, L. Gustafson, E. Mintun, J. Pan, K. V. Alwala, N. Carion, C.-Y. Wu, R. Girshick, P. Doll´ ar, and C. Feichtenhofer, 'Sam 2: Segment anything in images and videos,' arXiv preprint arXiv:2408.00714 , 2024. [Online]. Available: https://arxiv.org/abs/2408.00714 3, 8, 16
- [26] D. G. Lowe, 'Distinctive image features from scale-invariant keypoints,' International journal of computer vision , vol. 60, no. 2, pp. 91-110, 2004. 3
- [27] E. Rublee, V. Rabaud, K. Konolige, and G. Bradski, 'Orb: An efficient alternative to sift or surf,' 2011 International conference on computer vision , pp. 2564-2571, 2011. 3
- [28] A. Barroso-Laguna, E. Riba, D. Ponsa, and K. Mikolajczyk, 'Key. net: Keypoint detection by handcrafted and learned cnn filters,' Proceedings of the IEEE/CVF International Conference on Computer Vision , pp. 5836-5844, 2019. 3
- [29] M. Dusmanu, I. Rocco, T. Pajdla, M. Pollefeys, J. Sivic, A. Torii, and T. Sattler, 'D2-net: A trainable cnn for joint description and detection of local features,' Proceedings of the ieee/cvf conference on computer vision and pattern recognition , pp. 8092-8101, 2019. 3, 10

- [30] X. Zhao, X. Wu, J. Miao, W. Chen, P. C. Chen, and Z. Li, 'Alike: Accurate and lightweight keypoint detection and descriptor extraction,' IEEE Transactions on Multimedia , 2022. 3
- [31] J. Zhang, D. Sun, Z. Luo, A. Yao, L. Zhou, T. Shen, Y. Chen, L. Quan, and H. Liao, 'Learning two-view correspondences and geometry using order-aware network,' ICCV , October 2019. 3
- [32] Y. L. Junjie Ni, H. B. Zhaoyang Huang, Hongsheng Li, and G. Z. Zhaopeng Cui, 'Pats: Patch area transportation with subdivision for local feature matching,' CVPR , 2023. 3, 6, 7, 11, 12, 15
- [33] W. Jiang, E. Trulls, J. Hosang, A. Tagliasacchi, and K. M. Yi, 'Cotr: Correspondence transformer for matching across images,' Proceedings of the IEEE/CVF International Conference on Computer Vision , pp. 62076217, 2021. 3, 4
- [34] K. Dai, T. Xie, K. Wang, Z. Jiang, R. Li, and L. Zhao, 'Oamatcher: An overlapping areas-based network for accurate local feature matching,' arXiv preprint arXiv:2302.05846 , 2023. 3
- [35] H. Song, Y. Kashiwaba, S. Wu, and C. Wang, 'Efficient and accurate co-visible region localization with matching key-points crop (mkpc): A two-stage pipeline for enhancing image matching performance,' 2023. 3, 13
- [36] M. Dehghani, B. Mustafa, J. Djolonga, J. Heek, M. Minderer, M. Caron, A. Steiner, J. Puigcerver, R. Geirhos, I. Alabdulmohsin, A. Oliver, P. Padlewski, A. Gritsenko, M. Luˇ ci´ c, and N. Houlsby, 'Patch n' pack: Navit, a vision transformer for any aspect ratio and resolution,' 2024. 4, 12, 19
- [37] I. Balazevic, C. Allen, and T. Hospedales, 'Multi-relational poincar´ e graph embeddings,' Advances in Neural Information Processing Systems , vol. 32, 2019. 5
- [38] V. Mart´ ınez, F. Berzal, and J.-C. Cubero, 'A survey of link prediction in complex networks,' ACM Comput. Surv. , vol. 49, no. 4, dec 2016. [Online]. Available: https://doi.org/10.1145/3012704 5
- [39] P. Clifford, 'Markov random fields in statistics,' Disorder in physical systems: A volume in honour of John M. Hammersley , pp. 19-32, 1990. 6
- [40] F.-Y. Wu, 'The potts model,' Reviews of modern physics , vol. 54, no. 1, p. 235, 1982. 6
- [41] J. Yu, Y. Jiang, Z. Wang, Z. Cao, and T. Huang, 'Unitbox: An advanced object detection network,' in Proceedings of the 24th ACM international conference on Multimedia , 2016, pp. 516-520. 6
- [42] Y. Boykov, O. Veksler, and R. Zabih, 'Fast approximate energy minimization via graph cuts,' IEEE Transactions on Pattern Analysis and Machine Intelligence , vol. 23, no. 11, pp. 1222-1239, 2001. 6
- [43] L. Leal-Taix´ e, C. Canton-Ferrer, and K. Schindler, 'Learning by tracking: Siamese cnn for robust target association,' in Proceedings of the IEEE conference on computer vision and pattern recognition workshops , 2016, pp. 33-40. 6
- [44] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, 'Attention is all you need,' Advances in neural information processing systems , vol. 30, 2017. 6
- [45] C. M. Bishop and N. M. Nasrabadi, Pattern recognition and machine learning . Springer, 2006, vol. 4, no. 4. 7, 8
- [46] M. Tyszkiewicz, P. Fua, and E. Trulls, 'Disk: Learning local features with policy gradient,' Advances in Neural Information Processing Systems , vol. 33, pp. 14 254-14 265, 2020. 8
- [47] A. Mao, M. Mohri, and Y. Zhong, 'Cross-entropy loss functions: Theoretical analysis and applications,' in Proceedings of the 40th International Conference on Machine Learning , ser. Proceedings of Machine Learning Research, A. Krause, E. Brunskill, K. Cho, B. Engelhardt, S. Sabato, and J. Scarlett, Eds., vol. 202. PMLR, 23-29 Jul 2023, pp. 23 803-23 828. 8
- [48] A. Dai, A. X. Chang, M. Savva, M. Halber, T. Funkhouser, and M. Nießner, 'Scannet: Richly-annotated 3d reconstructions of indoor scenes,' Proc. Computer Vision and Pattern Recognition (CVPR), IEEE , 2017. 8, 9, 14, 21
- [49] Z. Li and N. Snavely, 'Megadepth: Learning single-view depth prediction from internet photos,' Proceedings of the IEEE conference on computer vision and pattern recognition , pp. 2041-2050, 2018. 8, 11
- [50] I. Loshchilov and F. Hutter, 'Decoupled weight decay regularization,' ICLR , 2019. 8
- [51] T. Sch¨ ops, T. Sattler, and M. Pollefeys, 'BAD SLAM: Bundle adjusted direct RGB-D SLAM,' in Conference on Computer Vision and Pattern Recognition (CVPR) , 2019. 11
- [52] B. Thomee, D. A. Shamma, G. Friedland, B. Elizalde, K. Ni, D. Poland, D. Borth, and L.-J. Li, 'Yfcc100m: the new data in multimedia research,' Commun. ACM , vol. 59, no. 2, p. 64-73, jan 2016. [Online]. Available: https://doi.org/10.1145/2812802 11
- [53] D. Tan, J.-J. Liu, X. Chen, C. Chen, R. Zhang, Y. Shen, S. Ding, and R. Ji, 'Eco-tr: Efficient correspondences finding via coarse-to-fine refinement,' European Conference on Computer Vision , pp. 317-334, 2022. 11
- [54] M. A. Fischler and R. C. Bolles, 'Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography,' Commun. ACM , vol. 24, no. 6, p. 381-395, jun 1981. 11
- [55] D. Barath, J. Noskova, M. Ivashechkin, and J. Matas, 'Magsac++, a fast, reliable and accurate robust estimator,' in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) , June 2020. 11
- [56] J. Nam, G. Lee, S. Kim, H. Kim, H. Cho, S. Kim, and S. Kim, 'Diffmatch: Diffusion model for dense matching,' 2024. 12
- [57] S. Li, Q. Zhao, and Z. Xia, 'Sparse-to-local-dense matching for geometry-guided correspondence estimation,' IEEE Transactions on Image Processing , vol. 32, pp. 3536-3551, 2023. 14
- [58] X. Zou, J. Yang, H. Zhang, F. Li, L. Li, J. Gao, and Y. J. Lee, 'Segment everything everywhere all at once,' Advances in neural information processing systems , 2023. 15
- [59] M. Syakur, B. Khotimah, E. Rochman, and B. D. Satoto, 'Integration kmeans clustering method and elbow method for identification of the best customer profile cluster,' in IOP conference series: materials science and engineering , vol. 336. IOP Publishing, 2018, p. 012017. 20

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-cbf680c2-edd2-4854-8f4d-a311149cc3b7.jpg)

Yesheng Zhang (Student Member, IEEE) received the B.S. and M.S. degrees in biomedical engineering from Shanghai Jiao Tong University (SJTU), Shanghai, China, in 2016 and 2022. He is currently working toward the Ph.D. degree with the Department of Automation, School of Electronic Information and Electrical Engineering, SJTU. His research interests include feature matching, visual SLAM and 3D reconstruction.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-53fb6efb-7863-4fc4-8c7a-b1e28dfdd400.jpg)

Shuhan Shen (Senior Member, IEEE) received the B.S. and M.S. degrees from Southwest Jiaotong University, Chengdu, China, in 2003 and 2006, respectively, and the Ph.D. degree from Shanghai Jiaotong University, Shanghai, China, in 2010. He is currently a Professor with the Institute of Automation, Chinese Academy of Sciences, and an Adjunct Professor with the School of Artificial Intelligence, University of Chinese Academy of Sciences. His research interests include 3D computer vision, in particular 3D recon- struction of large-scale scenes, 3D perception for intelligent robot, and 3D semantic reconstruction.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-43095ead-3c19-4037-95aa-8c81a57181a9.jpg)

Xu Zhao (Member, IEEE) received the Ph.D. degree in pattern recognition and intelligent system from Shanghai Jiao Tong University (SJTU), Shanghai, China, in 2011. He is currently a Full Professor with the Department of Automation, School of Electronic Information and Electrical Engineering, SJTU. He was a Visiting Scholar with the Beckman Institute, University of Illinois Urbana-Champaign, Urbana, IL, USA, from November 2007 to December 2008, and a Postdoc Research Fellow with Northeastern Univer- sity, Boston, MA, USA, from August 2012 to August 2013. His research interests include visual analysis of human motion, machine learning and image/video processing.

## TABLE 12

Experiments of resolution overfitting in Transformer-based methods. The experiments are conducted on ScanNet1500, measuring pose estimation accuracy. We select the training resolution 640 × 480 for PM, along with another resolution 896 × 672 which maintains the aspect ratio but increases the resolution.

| Pose estimation AUC   | 640 × 480 (4 / 3) †   | 640 × 480 (4 / 3) †   | 640 × 480 (4 / 3) †   | 896 × 672 (4 / 3) †   | 896 × 672 (4 / 3) †   | 896 × 672 (4 / 3) †   |
|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|-----------------------|
|                       | AUC@5 ↑               | AUC@10 ↑              | AUC@20 ↑              | AUC@5 ↑               | AUC@10 ↑              | AUC@20 ↑              |
| LoFTR [9]             | 25.68                 | 45.86                 | 62.60                 | 15.48                 | 30.60                 | 45.29                 |
| MESA+LoFTR            | 26.23 +2 . 14%        | 46.06 +0 . 44%        | 62.90 +0 . 48%        | 18.17 +17 . 37%       | 34.02 +11 . 18%       | 49.13 +8 . 48%        |
| DMESA+LoFTR           | 24.37 - 5 . 10%       | 44.42 - 3 . 14%       | 61.34 - 2 . 10%       | 17.58 +13 . 57%       | 33.38 +9 . 08%        | 48.35 +6 . 76%        |
| QT [21]               | 28.56                 | 49.30                 | 65.78                 | 2.88                  | 6.27                  | 11.23                 |
| MESA+QT               | 28.74 +0 . 63%        | 49.12 - 0 . 37%       | 66.03 +0 . 38%        | 5.53 +92 . 01%        | 11.43 +82 . 30%       | 18.62 +65 . 81%       |
| DMESA+QT              | 26.51 - 7 . 18%       | 46.71 - 5 . 25%       | 63.41 - 3 . 60%       | 9.55 +231 . 60%       | 20.20 +221 . 17%      | 31.28 +178 . 54%      |

† Input Resolution (Aspect Ratio) .

## APPENDIX A EXPERIMENTS OF RESOLUTION OVERFITTING ISSUE

In this section, we provide the additional experiments to investigate resolution overfitting issue in Transformer-based methods. Specially, we choose the famous LoFTR [9] and its improved variants QT [21] as the baselines. In ScanNet, their training size is 640 × 480 with the aspect ratio 4 3 / . Intuitively, the resolution overfitting is highly related to the aspect ratio, as which leads to the distortion of image context. Thus, we conduct comparison experiments on another size 896 × 672 , which maintains the same aspect ratio and improves the resolution. Considering the larger resolution brings more details and no distortion with the same aspect ratio, the performance between two sizes should be comparable. However, as we reported in Tab. 12, the performance of the baselines showcase significant descend ( 28 56 . vs. 2 88 . for QT on AUC@ ). This imply the hard resolution overfitting issue 5 of Transformer-based point matchers, which is possibly caused by the positional encoding [36]. On the other hand, our methods can increase the performance of the point matchers at the resolution of 896 × 672 ( 31 28 . of DMESA+QT vs. 11 23 . of QT). Nevertheless, although we set the area image size as the training resolution of 640 × 480 , our methods bring limited improvement (MESA) or even decrease the performance (DMESA). This can be attributed to that the excessive area size adjustment hinders the matching redundancy reduction achieved by our methods, as the training resolution is not square and we have to excessively expand some areas to fit the aspect ratio.

## APPENDIX B BENEFITS OF A2PM

In this section, we provide more detailed description about the benefit of the A2PM framework. See Fig. 11. The A2PM framework leverage the AM to split the original matching task into multiple easier inside-area matching tasks. Due to the reduced matching redundancy, area pair images contain substantial local details benefiting PM, which can be omitted by the original PM during resize operation. Another benefit comes from the cropping operation of A2PM, which can get the PM input with required resolution while maintaining the aspect ratio inherent to the raw image. Conversely, the resize operation widely applied in PM can result in severe distortion due to the aspect ratio variation (see the 'resized input' in the Fig. 11). However, the premise of the above advantages is accurate area matching, which is the pursuit of the proposed MESA and DMESA.

Fig. 11. The benefit of the A2PM framework. Essentially, the A2PM framework changes the input of PM. Based on the accurate AM, the matching redundancy is reduced, thus facilitating the inside-area PM with sufficient local details. Also, the cropping operation can avoid distortion from aspect ratio modification, which can be severe in resize operation (top).

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-52632d16-93ba-40b7-a78d-8a8d34e91491.jpg)

## APPENDIX C STUDY OF CROSS-DOMAIN GENERALIZATION

Given the broad range of application scenarios of feature matching, the ability to generalize across domains is crucial for matching methods. Therefore, in this section, we construct experiments to evaluate the cross-domain generalization of our methods.

## C.0.1 Experimental setup

To establish the cross-domain matching task, we employ models trained in the outdoor dataset (MegaDepth), including both the point matching models and learning models in MESA (learning area similarity) and DMESA (patching matching), to perform feature matching on indoor images (ScanNet1500). The baseline selection, resolution range, and method parameter settings in this experiment are kept consistent with other experiments on the ScanNet1500 dataset (cf. Sec. 6.4).

## C.0.2 Results

We present the results in Tab. 13. For the sparse matcher , our methods result in an overall increase in accuracy, showcasing the prominent generalization. Both MESA and DMESA achieve the best results at the smallest resolution of 480 × 480 , proving the resolution robustness of our methods. This also means our methods can attain better accuracy with less computational cost, which matters in applications with limited computation budget.

For the semi-dense point matchers , the accuracy drop of our methods at the training resolution observed in in-domain experiments is eliminated, replaced by an overall performance improvement. This indicates that our approaches can significantly enhance the generalization of the semi-dense matchers. Moreover, our methods reduce the accuracy gap between different sizes, showcasing resolution robustness.

For the dense matcher , our methods lead to a remarkable increase in accuracy. Particularly at the small size of 480 × 480 , MESA+DKM reaches the precision level of in-domain performance (cross-domain MESA+DKM on AUC@5: 28 89 . vs. 29 76 . of in-domain DKM), demonstrating the enhancement of our method on the cross-domain generalization.

TABLE 13

Cross-Domain Evaluation of Pose Estimation. We apply the learning models (including point matching models in baselines and area matching models in MESA and DMESA) trained on the outdoor scene (MegaDepth) to estimate camera poses in the indoor scene (ScanNet1500). Relative gains are highlighted as subscripts. The best , second and third results are highlighted.

|        |                        | 640 × 640                      | 640 × 640                     | 640 × 640                      | 640 × 480                      | 640 × 480                      | 640 × 480                     | 480 × 480                       | 480 × 480                      | 480 × 480                     |
|--------|------------------------|--------------------------------|-------------------------------|--------------------------------|--------------------------------|--------------------------------|-------------------------------|---------------------------------|--------------------------------|-------------------------------|
|        | Pose estimation AUC    | AUC@5 ↑                        | AUC@10 ↑                      | AUC@20 ↑                       | AUC@5 ↑                        | AUC@10 ↑                       | AUC@20 ↑                      | AUC@5 ↑                         | AUC@10 ↑                       | AUC@20 ↑                      |
| Sparse | SP [5]+SG [7]          | 20.46                          | 38.27                         | 54.92                          | 20.08                          | 38.03                          | 55.02                         | 18.84                           | 36.61                          | 53.49                         |
| Sparse | MESA+SP+SG DMESA+SP+SG | 22.34 +9 . 19% 20.67 +1 . 03%  | 39.95 +4 . 39% 38.27 +0 . 00% | 56.88 +3 . 57% 54.56 - 0 . 66% | 22.43 +11 . 70% 20.60 +2 . 59% | 40.12 +5 . 50% 38.37 +0 . 89%  | 57.04 +3 . 67% 55.28 +0 . 47% | 22.47 +19 . 27% 20.79 +10 . 35% | 41.23 +12 . 62% 38.63 +5 . 52% | 57.89 +8 . 23% 55.25 +3 . 29% |
|        | ASpan [10]             | 21.99                          | 40.21                         | 56.87                          | 24.11                          | 43.61                          | 60.22                         | 22.82                           | 41.78                          | 58.32                         |
|        | MESA+ASpan DMESA+ASpan | 24.21 +10 . 10% 22.91 +4 . 18% | 43.77 +8 . 85% 41.40 +2 . 96% | 60.08 +5 . 64% 57.44 +1 . 00%  | 25.31 +4 . 98% 23.81 - 1 . 24% | 46.18 +5 . 89% 43.46 - 0 . 34% | 62.04 +3 . 02% 60.50 +0 . 46% | 24.22 +6 . 13% 23.96 +5 . 00%   | 44.16 +5 . 70% 43.06 +3 . 06%  | 60.98 +4 . 56% 59.43 +1 . 90% |
|        | QT [21]                | 22.40                          | 40.10                         | 56.90                          | 22.25                          | 41.51                          | 58.51                         | 21.77                           | 40.31                          | 57.02                         |
|        | MESA+QT DMESA+QT       | 24.64 +10 . 00% 23.46 +4 . 73% | 43.91 +9 . 50% 41.98 +4 . 69% | 61.45 +8 . 00% 58.51 +2 . 83%  | 24.32 +9 . 30% 23.06 +3 . 64%  | 43.98 +5 . 95% 42.05 +1 . 30%  | 60.99 +4 . 24% 59.08 +0 . 97% | 24.73 +13 . 60% 22.68 +4 . 18%  | 44.15 +9 . 53% 41.82 +3 . 75%  | 60.84 +6 . 70% 58.65 +2 . 86% |
|        | LoFTR [9]              | 19.79                          | 36.91                         | 52.63                          | 20.94                          | 38.68                          | 54.61                         | 19.82                           | 37.59                          | 53.28                         |
|        | MESA+LoFTR DMESA+LoFTR | 21.34 +7 . 83% 20.99 +6 . 06%  | 39.23 +6 . 29% 38.51 +4 . 33% | 55.12 +4 . 73% 54.23 +3 . 04%  | 22.31 +6 . 54% 21.11 +0 . 81%  | 40.34 +4 . 29% 39.14 +1 . 19%  | 57.12 +4 . 60% 55.29 +1 . 25% | 21.56 +8 . 78% 21.17 +6 . 81%   | 40.07 +6 . 60% 39.49 +5 . 05%  | 57.33 +7 . 60% 55.50 +4 . 17% |
| Dense  | DKM [11]               | 25.67                          | 46.01                         | 63.05                          | 27.00                          | 47.42                          | 64.59                         | 25.75                           | 45.71                          | 62.96                         |
| Dense  | MESA+DKM DMESA+DKM     | 28.91 +12 . 62% 25.92 +0 . 97% | 48.77 +6 . 00% 46.33 +0 . 70% | 65.18 +3 . 38% 62.84 - 0 . 33% | 28.89 +7 . 00% 27.14 +0 . 52%  | 49.34 +4 . 05% 47.39 - 0 . 06% | 66.32 +2 . 68% 64.70 +0 . 17% | 28.12 +9 . 23% 26.11 +1 . 40%   | 48.31 +5 . 00% 46.09 +0 . 83%  | 65.49 +3 . 87% 63.33 +0 . 59% |

Fig. 12. The Area Fusion and Area Expansion. (a) Area fusion is to achieve the smallest area ( C ) containing the input areas ( A and B ). (b) Generally, area expansion is to fix the original area center and expand its size to the smallest size of the next level. When the original area is too close to the image boundary, we will move the area center to keep the expanded area inside the image.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-d6d49bd8-83f1-4678-8e96-4297120b6a73.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-f29c76a6-51d6-4e39-9d13-5aca05e0030e.jpg)

In the experiments, MESA showcases better generalization in contrast to DMESA, as the pre-trained coarse matcher in DMESA suffers from the domain gap. Nonetheless, leveraging the benefits of A2PM and the remarkable versatility of SAM, DMESA still contributes to improving the generalization of point matchers.

## APPENDIX D DETAILS OF AG COMPLETION

In this section, we provide additional details of completing the Area Graph (AG). The initial AG contains few directed edges, due to the splitting nature of SAM, which hinders robust and efficient matching. Thus, we propose to generate more graph nodes to form a tree structure for AG, i.e. the graph completion algorithm. The detailed process for the graph completion is depicted in Algorithm 1, which takes initial AG ( G ini ) as input and outputs the final AG ( G ) with scale hierarchy. Furthermore, we describe the area clustering and two main area operations adopted to generate higher level nodes in the algorithm as follows.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-357c53c7-6096-49b6-a85c-745bbd125ba6.jpg)

## D.1 Area Clustering.

For orphan nodes in each level, we cluster them based on their area centers to decide which operation will be performed on them. We use the k-means algorithm with elbow method [59] to determine the cluster number. The candidate cluster number is set as { 1 , . . . , n } , where n is the number of orphan nodes in the current level. This algorithm is fed with area centers and outputs labeled ones.

## D.2 Area Fusion and Expansion.

Area fusion and expansion are key operations in our graph completion algorithm. Specifically, area fusion is to find the largest outer rectangle of the two areas as the new area, as depicted in Fig. 12 (a). Due to the careful threshold settings of our area level, the fused area size will exceed current level and be awaited for subsequent operations. On the other hand, the expansion operation is to expand the area to the next level size (Fig. 12 (b)). In particular, suppose the lower bound of size for the next level is s 2 , if both of the area width and height are smaller than s , we expand the height and width of the area to s , keeping the area center fixed. Otherwise if area width w ≥ s , we let the area height h = s /w 2 , keeping the area center fixed, and vice versa. The above operations are performed when the expanded area is inside the image. On the other hand, if the expanded area is outside the image, the area center will be moved as shown in Fig. 12 (b).

## APPENDIX E COMPUTATION COMPLEXITY ANALYZE OF MESA

Here, we analyze the computation complexity of proposed graphical area matching, demonstrating the main source of the efficiency issue in MESA.

## E.1 Area Similarity Calculation

Firstly, area similarity calculation is performed to achieve the required node energies in the graph, serving as the prerequisite of our graphical area matching. Suppose we have two AGs, G 0 and G 1 , for the input image pair, G 0 gets N nodes ( |V 0 | = N ) and G 1 gets M nodes ( |V 1 | = M ). Therefore, the dense graph energy calculation needs M × N times similarity calculation. However, owing to the similarity conditional independence of ABN (Sec. 4.2.3), the actual number ( M ′ × N ′ ) of similarity calculation is smaller than M × N , as N &lt; N ′ . Nevertheless, directly setting children pair similarities as 0 is too rough (Eq. (12)), as large scale differences also leads to near-zero similarity between areas. In practise, we only set the related similarities of next level children as 0 for area matching accuracy and the efficiency from ABN is still helpful to our approach. Moreover, we only care about the similarities between source nodes in G 0 and other nodes in G 1 , because we collect source nodes with specific level from G 0 to match, e.g. , usually 3 ∼ 4 areas in indoor scene and less in outdoor scene. Therefore, we have M &lt; M ′ . Similarly, in the case of duality, i.e. , collecting source nodes from G 1 to match, we only need to perform a few supplementary calculations, as similarities are symmetric and reusable. Thus, the real computation complexity of area similarity computation is O M ( ′ × N ′ ) , where M ′ × N &lt; M ′ × N .

## E.2 Edge Energy Calculation

Except the node energy calculation, the edge energy is also needed to be determined for Graph Cut . The computation complexity of edge energy calculation is related to edge number of G 0 and G 1 . Assume |E 0 | = E and |E 1 | = K , the specific computation complexity is O E ( + K ) .

Ablation study of resolution settings. Two different image cropping methods are compared for the proposed MESA. Both semi-dense and dense point matchers are combined for evaluation. We report the pose estimation AUC @5 ◦ / 10 ◦ / 20 ◦ and the best results of two series are highlighted respectively.

| Method     | Cropping Approach   |   AUC@5 ↑ |   AUC@10 ↑ |   AUC@20 ↑ |
|------------|---------------------|-----------|------------|------------|
| MESA+ASpan | C → R               |     24.67 |      43.72 |      61.29 |
|            | E → C               |     27.51 |      47.47 |      65.04 |
| MESA+DKM   | C → R               |     30.19 |      51.49 |      68.79 |
| MESA+DKM   | E → C               |     33.42 |      55.04 |      71.98 |

## E.3 Global Energy Minimization

In our global energy minimization for area matching refinement, the matching energy of parent, children and neighbour pairs all need to be calculated. Taking parent matching energy for example, we derive its computation complexity as follows. Suppose n nodes are achieved as match candidates through Graph Cut and each node gets Q , i i ∈ (0 , n ] parent nodes, there are Q i × V node similarities need to be accessed (as the similarity calculation is finished), where V is the parent node number of the source node. Hence, the total computation complexity for parent matching energy in global energy minimization is O ( ∑ n i Q i × V ) . The children matching energy and neighbour matching energy are similar. As n is the number of node after Graph Cut , it is small in most cases, e.g. , usually &lt; 3 area nodes. Moreover, the number of parent nodes (or children, neighbour nodes) is also limited. Therefore, the computation complexity for global energy minimization is acceptable in practise.

In sum, the efficiency issue of MESA mainly lies in the Area Similarity Calculation part, which contains quadratic computational complexity. This issue comes from the sparse area matching framework in MESA, thus motivating us to design the dense counterpart, DMESA.

## APPENDIX F ADDITIONAL ABLATION STUDY

## F.1 Ablation Study on the Resolution Setting

The resolution setting is non-trivial and important in the A2PM framework, as different settings lead to different image quality and distortions. Here, we construct experiments to investigate the impact of different resolution settings. In practice, different resolution settings correspond to different area image cropping operations. Thus, we compare two different cropping methods: 1) the straightforward cropping method ( C → R ), which crops areas with original aspect ratios and then resizes them to input resolution. It means using arbitrary area image resolution. 2) the E → C cropping method, which first expands the area to correspond with the aspect ratio of the point matcher input and then crops these ares. This corresponds to our setting described in Sec. 3.3.

The experiment is conducted on ScanNet1500 [48] benchmark. We combine MESA with both semi-dense (ASpan) and dense (DKM) point matchers for complete comparison. Results are summarized in Tab. 14. As we can seen that the E → C cropping approach outperforms the C → R approach with a large margin for both MESA+ASpan and MESA+DKM, proving its superiority due to high resolution and less distortion. Therefore, we adopt the E → C approach for area image cropping, which means the area

TABLE 15

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-907f53a9-04e2-49ad-9ede-f6c843b802f5.jpg)

Ablation study of global energy parameters. We compare different parameter settings for global energy refinement in MESA ASpan and report the area matching performance, area number per image (AreaNum), and the pose estimation performance. Results are highlighted as first , second and third .

| E G Parameters                                                                            | T E max                                      | AOR ↑                                                 | AMP@ 0 . 6 ↑                                          | Pose AUC@ 5 ◦ ↑                                       | AreaNum ↑                                    |
|-------------------------------------------------------------------------------------------|----------------------------------------------|-------------------------------------------------------|-------------------------------------------------------|-------------------------------------------------------|----------------------------------------------|
| µ = 5 , α = 2 , β = 2 , γ = 1 µ = 4 , α = 2 , β = 2 , γ = 2 µ = 7 , α = 1 , β = 1 , γ = 1 | 0.35 0.25 0.15 0.35 0.25 0.15 0.35 0.25 0.15 | 61.76 63.91 60.44 67.98 64.94 61.74 65.98 62.32 60.32 | 65.54 71.13 62.57 80.09 72.24 65.50 78.10 66.54 64.38 | 23.57 22.41 21.46 23.74 24.01 23.55 22.71 23.56 22.37 | 4.69 3.47 3.27 5.76 4.62 3.86 3.27 2.92 2.77 |

image resolution shares the same aspect ratio with the input PM resolution.

## F.2 Ablation Study on Global Energy Parameters

̸

The parameters for our global energy refinement in MESA mainly consists of global energy balance parameters ( E G Parameters) in Eq. (13) and the threshold parameter T E max . The four E G Parameters reflect the importance of four energy terms, i.e. , self matching energy, parent, children and neighbour matching energy. The T E max controls the maximum energy of the final match, the smaller it is the stricter the refinement. Here, we construct experiments on ScanNet1500 to investigate the performance impact of these parameters. In particular, we compare three groups of E G Parameters and three groups of T E max to evaluate their impact on MESA ASpan. The input size of ASpan is 480 × 480 . The area matching performance, pose estimation performance and area number per image are summarised in Tab. 15. Generally, if two areas are matched, their parent, children and neighbour nodes should have high similarities due to spatial relationships between them. At the same time, the self matching energy should still be an important reference in matching refinement. Thus we choose three parameter settings including different weights on three kinds of node matching energies and different emphasis on self-matching energy. The experiment results in Tab. 15 show that the weights of three parameter settings set to the same is better for area matching performance ( α = β = γ vs. α = β = γ ). Giving sufficient consideration on global matching leads to accurate area matching along with best point matching performance ( µ =4 vs. µ =7 ). Despite the semi-dense matcher is not sensitive to area matching accuracy, better area matching leads to higher pose estimation precision. Therefore, we choose [ 4 2 2 2 , , , ] as our energy setting. On the other, the T E max is a critical parameter as well. The smaller T E max means stricter global matching energy request, but it may also mistake some accurate area matches when too small. Different E G Parameter settings prefer different values of T E max and 0 35 . suits the best for ours.

## APPENDIX G

## LIMITATION AND FUTURE WORK

One common limitation of MESA and DMESA is the underutilisation of SAM features. As we mentioned before, SAM possesses the high-level image understanding across a wide range of domains due to the massive training dataset and carefully designed models. Therefore, its image embedding is an extremely strong high-level representation, which has the potential to replace

Fig. 13. The Failure case of MESA and DMESA. Top : MESA may produce false area matches when repeated objects and large viewpoint variance occur at the same time. The impact of this kind of erroneous match can be alleviated by post-processing like GAM [18]. Bottom : Area matching (DMESA+SPSG) cannot completely resolve the repetitiveness issues in matching. While detailed feature comparisons within area matches can differentiate some repetitive points, challenges arising from highly repetitive textures and symmetrical objects persist unresolved.

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-0fc5027a-bb13-4c5b-be06-16b8fb9922d4.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-22f25a93-5d8a-44f6-8160-c5b0ab450811.jpg)

![Image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00279v2-figure-b2fb9958-9e26-4b8d-b7b9-90dc1fb4f175.jpg)

our learning similarity model. Then, the computation cost can be reduced as well. However, the naive attempt to use SAM features as descriptors of areas failed, possibly because the SAM segmentation pays more attention on intra-image contexts rather than inter-image ones like feature matching. Hence, the SAM feature needs further distillation for area matching, which will be an objective of our future work.

On the other hand, as MESA fuses image areas based on their 2D distances, which may not be lifted equivalently to 3D. Thus, some inconsistent area fusions between two images arise and lead to inaccurate point matching, e.g. , shown in Fig. 13 top. Although the post-processing like GAM [18] may help, it also introduces extra computation cost. To address this issue, featureguided fusion can be adopted, where the SAM feature can be employed and lead to consistent area fusion.

Moreover, our methods cannot perfectly solve the repetitiveness issues. Some repetitive patterns can be discerned by unique objects within the area matches. However, when the central object, such as the symmetrical pool table in Fig. 13 bottom, does not facilitate the identification of true matches from repetitive patterns, our methods are unable to assist point matchers in managing receptiveness issues.

Finally, there is an optimization space related to efficiency for the A2PM framework. Although the area matching speed of DMESA aligns with the current SOTA, the overall matching process of the A2PM framework is still time-intensive. This can be attributed to that the original single matching task is divided into multiple matching tasks by A2PM. This issue could be addressed by parallel computation and GPU acceleration. On the other hand, considering the significant precision improvement achieved by our methods, they are valuable for some downstream tasks that are not sensitive to time cost, such as SfM.
Yesheng Zhang Shuhan Shen Xu Zhao
MESA: Effective Matching Redundancy Reduction by Semantic Area Segmentation
We propose MESA and DMESA as novel feature matching methods, which utilize
Segment Anything Model (SAM) to effectively mitigate matching redundancy. The
key insight of our methods is to establish implicit-semantic area matching
prior to point matching, based on advanced image understanding of SAM. Then,
informative area matches with consistent internal semantic are able to undergo
dense feature comparison, facilitating precise inside-area point matching.
Specifically, MESA adopts a sparse matching framework and first obtains
candidate areas from SAM results through a novel Area Graph (AG). Then, area
matching among the candidates is formulated as graph energy minimization and
solved by graphical models derived from AG. To address the efficiency issue of
MESA, we further propose DMESA as its dense counterpart, applying a dense
matching framework. After candidate areas are identified by AG, DMESA
establishes area matches through generating dense matching distributions. The
distributions are produced from off-the-shelf patch matching utilizing the
Gaussian Mixture Model and refined via the Expectation Maximization. With less
repetitive computation, DMESA showcases a speed improvement of nearly five
times compared to MESA, while maintaining competitive accuracy. Our methods are
extensively evaluated on five datasets encompassing indoor and outdoor scenes.
The results illustrate consistent performance improvements from our methods for
five distinct point matching baselines across all datasets. Furthermore, our
methods exhibit promise generalization and improved robustness against image
resolution variations. The code is publicly available at
https://github.com/Easonyesheng/A2PM-MESA.