MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
bundler_incremental.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015, Simon Fuhrmann, Fabian Langguth
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_BUNDLER_INCREMENTAL_HEADER
11#define SFM_BUNDLER_INCREMENTAL_HEADER
12
13#include "mve/bundle.h"
14#include "sfm/fundamental.h"
16#include "sfm/ransac_pose_p3p.h"
17#include "sfm/bundler_common.h"
18#include "sfm/camera_pose.h"
19#include "sfm/defines.h"
20
23
28{
29public:
51
52public:
53 explicit Incremental (Options const& options);
54
63 void initialize (ViewportList* viewports, TrackList* tracks,
64 SurveyPointList* survey_points = nullptr);
65
67 bool is_initialized (void) const;
68
70 void find_next_views (std::vector<int>* next_views);
72 bool reconstruct_next_view (int view_id);
74 void try_restore_tracks_for_views (void);
76 void triangulate_new_tracks (int min_num_views);
78 void invalidate_large_error_tracks (void);
80 void bundle_adjustment_full (void);
82 void bundle_adjustment_single_cam (int view_id);
84 void bundle_adjustment_points_only (void);
85
87 void try_registration (void);
89 void print_registration_error (void) const;
90
92 void normalize_scene (void);
94 mve::Bundle::Ptr create_bundle (void) const;
95
96private:
97 void bundle_adjustment_intern (int single_camera_ba);
98
99private:
100 Options opts;
101 ViewportList* viewports;
102 TrackList* tracks;
103 SurveyPointList* survey_points;
104 bool registered = false;
105};
106
107/* ------------------------ Implementation ------------------------ */
108
109inline
110Incremental::Options::Options (void)
111 : track_error_threshold_factor(10.0)
112 , new_track_error_threshold(0.01)
113 , min_triangulation_angle(MATH_DEG2RAD(1.0))
114 , ba_fixed_intrinsics(false)
115 , ba_shared_intrinsics(false)
116 , verbose_output(false)
117 , verbose_ba(false)
118{
119}
120
121inline
123 : opts(options)
124 , viewports(nullptr)
125 , tracks(nullptr)
126{
127}
128
129inline bool
131{
132 return this->viewports != nullptr
133 && this->tracks != nullptr;
134}
135
138
139#endif /* SFM_BUNDLER_INCREMENTAL_HEADER */
std::shared_ptr< Bundle > Ptr
Definition bundle.h:59
Bundler Component: Incremental structure-from-motion.
bool is_initialized(void) const
Returns whether the incremental SfM has been initialized.
Incremental(Options const &options)
#define MATH_DEG2RAD(x)
Definition defines.h:78
std::vector< Viewport > ViewportList
The list of all viewports considered for bundling.
std::vector< Track > TrackList
The list of all tracks.
std::vector< SurveyPoint > SurveyPointList
The list of all survey poins.
#define SFM_BUNDLER_NAMESPACE_END
Definition defines.h:17
#define SFM_BUNDLER_NAMESPACE_BEGIN
Definition defines.h:16
#define SFM_NAMESPACE_END
Definition defines.h:14
#define SFM_NAMESPACE_BEGIN
Definition defines.h:13
bool ba_shared_intrinsics
Bundle Adjustment with shared intrinsics.
bool verbose_ba
Produce detailed BA messages on the console.
double new_track_error_threshold
Reprojection error threshold for newly triangulated tracks.
double track_error_threshold_factor
Threshold (factor of the median error) for large error tracks.
bool verbose_output
Produce status messages on the console.
RansacPoseP3P::Options pose_p3p_opts
Options for computing pose from 2D-3D correspondences.
double min_triangulation_angle
Minimum angle for track triangulation in RAD.
bool ba_fixed_intrinsics
Bundle Adjustment fixed intrinsics.