Ocean
Loading...
Searching...
No Matches
Observation.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_TRACKING_SLAM_OBSERVATION_H
9#define META_OCEAN_TRACKING_SLAM_OBSERVATION_H
10
12
13#include "ocean/math/Vector2.h"
14
15namespace Ocean
16{
17
18namespace Tracking
19{
20
21namespace SLAM
22{
23
24// Forward declaration.
25class Observation;
26
27/**
28 * Definition of a vector holding observations.
29 * @ingroup trackingslam
30 */
31using Observations = std::vector<Observation>;
32
33/**
34 * This class implements an observation of a 3D feature point in a camera frame.
35 * The observation is defined by the 2D position of the 3D feature point and the corresponding frame index.
36 * @ingroup trackingslam
37 */
39{
40 public:
41
42 /**
43 * Default constructor creating an invalid observation.
44 */
45 Observation() = default;
46
47 /**
48 * Creates a new observation.
49 * @param frameIndex The index of the camera frame in which the observation was made, with range [0, infinity)
50 * @param imagePoint The image point of the observation
51 */
52 inline Observation(const Index32 frameIndex, const Vector2& imagePoint);
53
54 /**
55 * Returns the index of the camera frame in which the observation was made.
56 * @return The observation's frame index
57 */
58 inline Index32 frameIndex() const;
59
60 /**
61 * Returns the image point of this observation.
62 * @return The observation's image point
63 */
64 inline const Vector2& imagePoint() const;
65
66 protected:
67
68 /// The index of the camera frame in which the observation was made.
70
71 /// The image point of the observation.
73};
74
75inline Observation::Observation(const Index32 frameIndex, const Vector2& imagePoint) :
76 frameIndex_(frameIndex),
77 imagePoint_(imagePoint)
78{
79 // nothing to do here
80}
81
83{
84 return frameIndex_;
85}
86
87inline const Vector2& Observation::imagePoint() const
88{
89 return imagePoint_;
90}
91
92}
93
94}
95
96}
97
98#endif // META_OCEAN_TRACKING_SLAM_OBSERVATION_H
This class implements an observation of a 3D feature point in a camera frame.
Definition Observation.h:39
Index32 frameIndex_
The index of the camera frame in which the observation was made.
Definition Observation.h:69
Observation()=default
Default constructor creating an invalid observation.
Vector2 imagePoint_
The image point of the observation.
Definition Observation.h:72
Index32 frameIndex() const
Returns the index of the camera frame in which the observation was made.
Definition Observation.h:82
const Vector2 & imagePoint() const
Returns the image point of this observation.
Definition Observation.h:87
uint32_t Index32
Definition of a 32 bit index value.
Definition Base.h:84
std::vector< Observation > Observations
Definition of a vector holding observations.
Definition Observation.h:31
The namespace covering the entire Ocean framework.
Definition Accessor.h:15