8 #ifndef META_OCEAN_CV_DETECTOR_ORB_FEATURE_H
9 #define META_OCEAN_CV_DETECTOR_ORB_FEATURE_H
74 inline size_t numberDescriptors()
const;
127 template <
typename T>
128 static ORBFeatures features2ORBFeatures(
const std::vector<T>& features);
140 template <
typename T>
141 static ORBFeatures features2ORBFeatures(
const std::vector<T>& features,
const unsigned int width,
const unsigned int height,
const unsigned int border = 31u,
Indices32* validIndices =
nullptr);
200 template <
typename T>
204 result.resize(features.size());
206 for (
const T& feature : features)
208 result.emplace_back(feature.observation(), feature.distortionState(), feature.strength());
214 template <
typename T>
218 result.reserve(features.size());
220 if (validIndices !=
nullptr)
222 validIndices->clear();
223 validIndices->reserve(features.size());
230 for (
size_t i = 0; i < features.size(); i++)
232 const T& feature = features[i];
234 const Scalar x = feature.observation().x();
235 const Scalar y = feature.observation().y();
237 if (x >= borderLeftTop && y >= borderLeftTop && x < borderRight && y < borderBottom)
239 result.emplace_back(feature.observation(), feature.distortionState(), feature.strength());
241 if (validIndices !=
nullptr)
243 validIndices->emplace_back(
Index32(i));
This class implement the descriptor for ORB features.
Definition: ORBDescriptor.h:41
This class implements a ORB feature.
Definition: ORBFeature.h:40
FeatureDescriptorType
Definition of the ORB descriptor type for this feature.
Definition: ORBFeature.h:47
@ FDT_UNDESCRIBED
Undescribed descriptor.
Definition: ORBFeature.h:49
void setDescriptorType(const FeatureDescriptorType type)
Sets or changes the type of all descriptors of this feature.
Definition: ORBFeature.h:195
static ORBFeatures features2ORBFeatures(const std::vector< T > &features)
Converts a vector of point features to ORB feature points.
Definition: ORBFeature.h:201
size_t numberDescriptors() const
Returns the number of descriptors holding by this feature point.
Definition: ORBFeature.h:158
void addDescriptor(const ORBDescriptor &descriptor)
Adds a given descriptor to this feature.
Definition: ORBFeature.h:185
FeatureDescriptorType descriptorType_
Feature descriptor type.
Definition: ORBFeature.h:146
ORBFeature()=default
Creates a new empty ORB feature object.
const ORBDescriptor & firstDescriptor() const
Returns the first descriptor of this feature.
Definition: ORBFeature.h:163
const ORBDescriptors & descriptors() const
Returns a vector of all descriptors of this feature.
Definition: ORBFeature.h:175
ORBDescriptors descriptors_
Feature descriptor.
Definition: ORBFeature.h:149
FeatureDescriptorType descriptorType() const
Returns the type of all descriptors of this feature.
Definition: ORBFeature.h:190
This class implements the base class for all computer vision features mainly basing on points width a...
Definition: OrientedPointFeature.h:39
DistortionState
Definition of individual distortion states.
Definition: PointFeature.h:51
const T & front() const
Returns the first elements of this vector.
Definition: StaticVector.h:455
size_t size() const
Returns the size of this vector.
Definition: StaticVector.h:340
bool empty() const
Returns whether this vector hold no element.
Definition: StaticVector.h:487
void pushBack(const T &value)
Adds a new element to this vector.
Definition: StaticVector.h:352
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition: Base.h:96
uint32_t Index32
Definition of a 32 bit index value.
Definition: Base.h:84
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