MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
bundle.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 MVE_BUNDLE_HEADER
11#define MVE_BUNDLE_HEADER
12
13#include <vector>
14#include <memory>
15
16#include "mve/camera.h"
17#include "mve/mesh.h"
18#include "mve/defines.h"
19
21
27class Bundle
28{
29public:
33 struct Feature2D
34 {
37 float pos[2];
38 };
39
46 struct Feature3D
47 {
49 float pos[3];
51 float color[3];
53 std::vector<Feature2D> refs;
54
55 bool contains_view_id (int id) const;
56 };
57
58public:
59 typedef std::shared_ptr<Bundle> Ptr;
60 typedef std::shared_ptr<Bundle const> ConstPtr;
61 typedef std::vector<CameraInfo> Cameras;
62 typedef std::vector<Feature3D> Features;
63
64public:
65 static Ptr create (void);
66
68 Cameras const& get_cameras (void) const;
70 Cameras& get_cameras (void);
72 Features const& get_features (void) const;
74 Features& get_features (void);
76 std::size_t get_byte_size (void) const;
78 std::size_t get_num_cameras (void) const;
80 std::size_t get_num_valid_cameras (void) const;
82 TriangleMesh::Ptr get_features_as_mesh (void) const;
84 void delete_camera (std::size_t index);
85
86protected:
87 Bundle (void);
88
89private:
90 Cameras cameras;
91 Features features;
92};
93
94/* -------------------------------------------------------------- */
95
96inline
97Bundle::Bundle (void)
98{
99}
100
101inline Bundle::Ptr
102Bundle::create (void)
103{
104 return Ptr(new Bundle);
105}
106
107inline Bundle::Cameras const&
108Bundle::get_cameras (void) const
109{
110 return this->cameras;
111}
112
113inline Bundle::Cameras&
114Bundle::get_cameras (void)
115{
116 return this->cameras;
117}
118
119inline Bundle::Features const&
120Bundle::get_features (void) const
121{
122 return this->features;
123}
124
125inline Bundle::Features&
126Bundle::get_features (void)
127{
128 return this->features;
129}
130
132
133#endif /* MVE_BUNDLE_HEADER */
A simple data structure to represent bundle files.
Definition bundle.h:28
std::vector< Feature3D > Features
Definition bundle.h:62
std::vector< CameraInfo > Cameras
Definition bundle.h:61
std::shared_ptr< Bundle > Ptr
Definition bundle.h:59
std::shared_ptr< Bundle const > ConstPtr
Definition bundle.h:60
std::shared_ptr< TriangleMesh > Ptr
Definition mesh.h:92
#define MVE_NAMESPACE_BEGIN
Definition defines.h:13
#define MVE_NAMESPACE_END
Definition defines.h:14
Representation of a 2D feature.
Definition bundle.h:34
Representation of a 3D feature with position and color.
Definition bundle.h:47
std::vector< Feature2D > refs
References to views that see the feature.
Definition bundle.h:53