MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
feature_set.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_FEATURE_SET_HEADER
11#define SFM_FEATURE_SET_HEADER
12
13#include <vector>
14
15#include "math/vector.h"
16#include "util/aligned_memory.h"
17#include "sfm/sift.h"
18#include "sfm/surf.h"
19#include "sfm/defines.h"
20
22
28{
29public:
32 {
33 FEATURE_SIFT = 1 << 0,
34 FEATURE_SURF = 1 << 1,
35 FEATURE_ALL = 0xFF
36 };
37
47
48public:
49 FeatureSet (void);
50 explicit FeatureSet (Options const& options);
51 void set_options (Options const& options);
52
54 void compute_features (mve::ByteImage::Ptr image);
55
57 void normalize_feature_positions (float px, float py);
58
60 void clear_descriptors (void);
61
62public:
64 int width, height;
66 std::vector<math::Vec2f> positions;
68 std::vector<math::Vec3uc> colors;
73
74private:
75 void compute_sift (mve::ByteImage::ConstPtr image);
76 void compute_surf (mve::ByteImage::ConstPtr image);
77
78private:
79 Options opts;
80};
81
82/* ------------------------ Implementation ------------------------ */
83
84inline
85FeatureSet::Options::Options (void)
86 : feature_types(FEATURE_SIFT)
87{
88}
89
90inline
94
95inline
97 : opts(options)
98{
99}
100
101inline void
103{
104 this->opts = options;
105}
106
108
109#endif /* SFM_FEATURE_SET_HEADER */
std::shared_ptr< Image< T > > Ptr
Definition image.h:42
std::shared_ptr< Image< T > const > ConstPtr
Definition image.h:43
The FeatureSet holds per-feature information for a single view, and allows to transparently compute a...
Definition feature_set.h:28
std::vector< math::Vec3uc > colors
Per-feature image color.
Definition feature_set.h:68
std::vector< math::Vec2f > positions
Per-feature image position.
Definition feature_set.h:66
FeatureTypes
Bitmask with feature types.
Definition feature_set.h:32
Surf::Descriptors surf_descriptors
The SURF descriptors.
Definition feature_set.h:72
void set_options(Options const &options)
Sift::Descriptors sift_descriptors
The SIFT descriptors.
Definition feature_set.h:70
std::vector< Descriptor > Descriptors
Definition sift.h:153
std::vector< Descriptor > Descriptors
Definition surf.h:99
#define SFM_NAMESPACE_END
Definition defines.h:14
#define SFM_NAMESPACE_BEGIN
Definition defines.h:13
Options for feature detection and matching.
Definition feature_set.h:40
Sift::Options sift_opts
Definition feature_set.h:44
FeatureTypes feature_types
Definition feature_set.h:43
Surf::Options surf_opts
Definition feature_set.h:45
SIFT options.
Definition sift.h:49
SURF options.
Definition surf.h:47