Ocean
Loading...
Searching...
No Matches
OrientedPointFeature.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_CV_DETECTOR_ORIENTED_POINT_FEATURE_H
9#define META_OCEAN_CV_DETECTOR_ORIENTED_POINT_FEATURE_H
10
13
14namespace Ocean
15{
16
17namespace CV
18{
19
20namespace Detector
21{
22
23// Forward declaration.
25
26/**
27 * Definition of a vector holding oriented point features.
28 * @ingroup cvdetector
29 */
30using OrientedPointFeatures = std::vector<OrientedPointFeature>;
31
32/**
33 * This class implements the base class for all computer vision features mainly basing on points width an orientation.
34 * The feature observation is the 2D position the feature can observed e.g. on an image plane.<br>
35 * In contrast the feature position is the real 3D position of the feature.
36 * @ingroup cvdetector
37 */
38class OCEAN_CV_DETECTOR_EXPORT OrientedPointFeature : public PointFeature
39{
40 public:
41
42 /**
43 * Creates a new feature object
44 */
45 inline OrientedPointFeature();
46
47 /**
48 * Creates a new feature object by a given 2D observation point.
49 * @param observation Feature 2D observation position
50 * @param distortionState Distortion state of the 2D feature position
51 * @param strength Feature strength
52 * @param orientation Feature orientation in radian, range [0, 2*PI)
53 */
55
56 /**
57 * Creates a new feature object by a given position.
58 * @param position Feature 3D position
59 * @param strength Feature strength
60 * @param orientation Feature orientation in radian, range [0, 2*PI)
61 */
62 inline explicit OrientedPointFeature(const Vector3& position, const Scalar strength = 0, const Scalar orientation = 0);
63
64 /**
65 * Returns the orientation of this feature in radian.
66 * @return Feature orientation
67 */
68 inline Scalar orientation() const;
69
70 /**
71 * Sets the orientation of this features in radian.
72 * @param orientation Feature orientation to set
73 */
74 inline void setOrientation(const Scalar orientation);
75
76 protected:
77
78 // Feature orientation in radian, range [0, 2*PI)
80
81};
82
86{
87 // nothing to do here
88}
89
96
105
110
112{
113 ocean_assert_accuracy(orientation >= 0 && orientation < Numeric::pi2());
115}
116
117}
118
119}
120
121}
122
123#endif // META_OCEAN_CV_DETECTOR_ORIENTED_POINT_FEATURE_H
This class implements the base class for all computer vision features mainly basing on points width a...
Definition OrientedPointFeature.h:39
Scalar featureOrientation
Definition OrientedPointFeature.h:79
OrientedPointFeature()
Creates a new feature object.
Definition OrientedPointFeature.h:83
void setOrientation(const Scalar orientation)
Sets the orientation of this features in radian.
Definition OrientedPointFeature.h:111
Scalar orientation() const
Returns the orientation of this feature in radian.
Definition OrientedPointFeature.h:106
const Vector3 & position() const
Returns the 3D position of this feature e.g.
Definition PointFeature.h:205
PointFeature()
Creates a new feature object.
Definition PointFeature.h:171
Scalar strength() const
Returns the strength of this feature.
Definition PointFeature.h:210
DistortionState
Definition of individual distortion states.
Definition PointFeature.h:51
@ DS_INVALID
Invalid distortion state.
Definition PointFeature.h:53
@ DS_UNKNOWN
Unknown distortion state.
Definition PointFeature.h:55
const Vector2 & observation() const
Returns the 2D observation position of this feature e.g.
Definition PointFeature.h:200
DistortionState featureDistortionState
Holds the distortion state of the observation position.
Definition PointFeature.h:168
DistortionState distortionState() const
Returns the distortion state of the feature point.
Definition PointFeature.h:215
static constexpr Scalar pi2()
std::vector< OrientedPointFeature > OrientedPointFeatures
Definition of a vector holding oriented point features.
Definition OrientedPointFeature.h:30
VectorT2< Scalar > Vector2
Definition of a 2D vector.
Definition Vector2.h:28
VectorT3< Scalar > Vector3
Definition of a 3D vector.
Definition Vector3.h:29
float Scalar
Definition of a scalar type.
Definition Math.h:129
Namespace of the CV Detector library.
Definition Barcode.h:19
Namespace of the CV library.
Definition Advanced.h:17
The namespace covering the entire Ocean framework.
Definition Accessor.h:15