MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
ransac_homography.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_HOMOGRAPHY_HEADER
11#define SFM_RANSAC_HOMOGRAPHY_HEADER
12
13#include <vector>
14
15#include "sfm/homography.h"
16
18
28{
29public:
30 struct Options
31 {
32 Options (void);
33
40
45 double threshold;
46
51 };
52
53 struct Result
54 {
60
65 std::vector<int> inliers;
66 };
67
68public:
69 explicit RansacHomography (Options const& options);
70 void estimate (Correspondences2D2D const& matches, Result* result);
71
72private:
73 void compute_homography (Correspondences2D2D const& matches,
74 HomographyMatrix* homography);
75 void evaluate_homography (Correspondences2D2D const& matches,
76 HomographyMatrix const& homography, std::vector<int>* inliers);
77
78private:
79 Options opts;
80};
81
82/* ------------------------ Implementation ------------------------ */
83
84inline
85RansacHomography::Options::Options (void)
86 : max_iterations(1000)
87 , threshold(0.005)
88 , verbose_output(false)
89{
90}
91
93
94#endif /* SFM_RANSAC_HOMOGRAPHY_HEADER */
RANSAC homography 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
double threshold
Threshold used to determine inliers.
int max_iterations
The number of RANSAC iterations.
bool verbose_output
Produce status messages on the console.
HomographyMatrix homography
The resulting homography matrix which led to the inliers.
std::vector< int > inliers
The indices of inliers in the correspondences which led to the homography matrix.