ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vote_and_verify.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "retrieval/geometry.h"
11 
12 namespace colmap {
13 namespace retrieval {
14 
16  // Number of top transformations to generate.
18 
19  // Number of voting bins in the translation dimension.
20  int num_trans_bins = 64;
21 
22  // Number of voting bins in the scale dimension.
23  int num_scale_bins = 32;
24 
25  // Number of voting bins in the orientation dimension.
26  int num_angle_bins = 8;
27 
28  // Maximum image dimension that bounds the range of the translation bins.
29  int max_image_size = 4096;
30 
31  // Minimum number of votes for a transformation to be considered.
32  int min_num_votes = 1;
33 
34  // RANSAC confidence level used to abort the iteration.
35  double confidence = 0.99;
36 
37  // Thresholds for considering a match an inlier.
38  double max_transfer_error = 100.0 * 100.0;
39  double max_scale_error = 2.0;
40 };
41 
42 // Compute effective inlier count using Vote-and-Verify by estimating an affine
43 // transformation from 2D-2D image matches. The method is described in:
44 // "A Vote­-and­-Verify Strategy for
45 // Fast Spatial Verification in Image Retrieval",
46 // Schönberger et al., ACCV 2016.
47 int VoteAndVerify(const VoteAndVerifyOptions& options,
48  const std::vector<FeatureGeometryMatch>& matches);
49 
50 } // namespace retrieval
51 } // namespace colmap
int VoteAndVerify(const VoteAndVerifyOptions &options, const std::vector< FeatureGeometryMatch > &matches)