Ocean
ORBFeatureOrientation.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_ORB_FEATURE_ORIENTATION_H
9 #define META_OCEAN_CV_DETECTOR_ORB_FEATURE_ORIENTATION_H
10 
13 
14 #include "ocean/base/Worker.h"
15 
17 
18 namespace Ocean
19 {
20 
21 namespace CV
22 {
23 
24 namespace Detector
25 {
26 
27 /**
28  * This class implements all necessary functions to calculate the orientation of an ORB features.
29  * @ingroup cvdetector
30  */
31 class OCEAN_CV_DETECTOR_EXPORT ORBFeatureOrientation
32 {
33  public:
34 
35  /**
36  * Determines the orientation for all given feature points based on the intensity centroid of a patch around the feature positions.
37  * A image patch with size 31x31 pixels is used to calculate the orientation.
38  * @param linedIntegralFrame Pointer to the lined integral frame of the frame where the feature points were detected; must be an integral frame for an 8 bit frame
39  * @param width The width of the original frame in pixel (not the width of the lined-integral frame), with range [31, infinity)
40  * @param height The height of the original frame in pixel (not the height of the lined-integral frame), with range [31, infinity)
41  * @param featurePoints Feature points to determine the orientation for
42  * @param worker Optional worker object to distribute the computation to several CPU cores
43  */
44  static void determineFeatureOrientation(const unsigned int* linedIntegralFrame, const unsigned int width, const unsigned int height, ORBFeatures& featurePoints, Worker* worker = nullptr);
45 
46  protected:
47 
48  /**
49  * Determines the orientation for all given feature points based on the intensity centroid of a patch around the feature positions.
50  * A image patch with size 31x31 pixels is used to calculate the orientation.
51  * @param linedIntegralFrame Pointer to the lined integral frame of the frame where the feature points were detected; must be an integral frame for an 8 bit frame
52  * @param width The width of the original frame in pixel (not the width of the lined-integral frame), with range [31, infinity)
53  * @param height The height of the original frame in pixel (not the height of the lined-integral frame), with range [31, infinity)
54  * @param featurePoints Feature points to determine the orientation for
55  * @param startIndex First index of the feature point vector to be handled
56  * @param range Number of feature points to be handled
57  */
58  static void determineFeatureOrientationSubset(const unsigned int* linedIntegralFrame, const unsigned int width, const unsigned int height, ORBFeatures* const featurePoints, const unsigned int startIndex, const unsigned int range);
59 
60  /**
61  * Determines the orientation for a given feature point based on the intensity centroid of a patch around the feature position.
62  * A image patch with size 31x31 pixels is used to calculate the orientation.
63  * @param linedIntegralFrame Pointer to the lined integral frame of the frame where the feature points were detected; must be an integral frame for an 8 bit frame
64  * @param width The width of the original frame in pixel (not the width of the lined-integral frame), with range [31, infinity)
65  * @param height The height of the original frame in pixel (not the height of the lined-integral frame), with range [31, infinity)
66  * @param position The 2D position of the feature, with pixel center PC_CENTER, with range (15, width - 15)x(15, height - 15)
67  * @return Orientation angle in radian with range [0, 2*PI)
68  */
69  static Scalar determineFeatureOrientation31(const unsigned int* linedIntegralFrame, const unsigned int width, const unsigned int height, const Vector2& position);
70 };
71 
72 }
73 
74 }
75 
76 }
77 
78 #endif // META_OCEAN_CV_DETECTOR_ORB_FEATURE_ORIENTATION_H
This class implements all necessary functions to calculate the orientation of an ORB features.
Definition: ORBFeatureOrientation.h:32
static void determineFeatureOrientationSubset(const unsigned int *linedIntegralFrame, const unsigned int width, const unsigned int height, ORBFeatures *const featurePoints, const unsigned int startIndex, const unsigned int range)
Determines the orientation for all given feature points based on the intensity centroid of a patch ar...
static void determineFeatureOrientation(const unsigned int *linedIntegralFrame, const unsigned int width, const unsigned int height, ORBFeatures &featurePoints, Worker *worker=nullptr)
Determines the orientation for all given feature points based on the intensity centroid of a patch ar...
static Scalar determineFeatureOrientation31(const unsigned int *linedIntegralFrame, const unsigned int width, const unsigned int height, const Vector2 &position)
Determines the orientation for a given feature point based on the intensity centroid of a patch aroun...
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
std::vector< ORBFeature > ORBFeatures
Definition of a vector holding ORB features.
Definition: ORBFeature.h:26
float Scalar
Definition of a scalar type.
Definition: Math.h:128
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15