MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
ransac_fundamental.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015, Simon Fuhrmann
3 * TU Darmstadt - Graphics, Capture and Massively Parallel Computing
4 * All rights reserved.
5 *
6 * This software may be modified and distributed under the terms
7 * of the BSD 3-Clause license. See the LICENSE.txt file for details.
8 */
9
10#ifndef SFM_RANSAC_FUNDAMENTAL_HEADER
11#define SFM_RANSAC_FUNDAMENTAL_HEADER
12
13#include "math/matrix.h"
14#include "sfm/defines.h"
15#include "sfm/correspondence.h"
16#include "sfm/fundamental.h"
17
19
31{
32public:
33 struct Options
34 {
35 Options (void);
36
43
48 double threshold;
49
54 };
55
56 struct Result
57 {
63
68 std::vector<int> inliers;
69 };
70
71public:
72 explicit RansacFundamental (Options const& options);
73 void estimate (Correspondences2D2D const& matches, Result* result);
74
75private:
76 void estimate_8_point (Correspondences2D2D const& matches,
77 FundamentalMatrix* fundamental);
78 void find_inliers (Correspondences2D2D const& matches,
79 FundamentalMatrix const& fundamental, std::vector<int>* result);
80
81private:
82 Options opts;
83};
84
85/* ------------------------ Implementation ------------------------ */
86
87inline
88RansacFundamental::Options::Options (void)
89 : max_iterations(1000)
90 , threshold(0.0015)
91 , verbose_output(false)
92{
93}
94
96
97#endif /* SFM_RANSAC_FUNDAMENTAL_HEADER */
RANSAC pose estimation from noisy 2D-2D image correspondences.
std::vector< Correspondence2D2D > Correspondences2D2D
#define SFM_NAMESPACE_END
Definition defines.h:14
#define SFM_NAMESPACE_BEGIN
Definition defines.h:13
bool verbose_output
Produce status messages on the console.
double threshold
Threshold used to determine inliers.
int max_iterations
The number of RANSAC iterations.
FundamentalMatrix fundamental
The resulting fundamental matrix which led to the inliers.
std::vector< int > inliers
The indices of inliers in the correspondences which led to the homography matrix.