8 #ifndef META_OCEAN_TRACKING_MAPBUILDING_DESCRIPTOR_HANDLING_H
9 #define META_OCEAN_TRACKING_MAPBUILDING_DESCRIPTOR_HANDLING_H
147 return descriptorA.distance(descriptorB);
152 unsigned int bestDistance = (
unsigned int)(-1);
156 const unsigned int distance = descriptorA.distance(descriptorB);
158 if (distance < bestDistance)
160 bestDistance = distance;
169 unsigned int bestDistance = (
unsigned int)(-1);
175 const unsigned int distance = descriptorA.distance(descriptorB);
177 if (distance < bestDistance)
179 bestDistance = distance;
189 ocean_assert(descriptorsA !=
nullptr);
191 unsigned int bestDistance = (
unsigned int)(-1);
197 if (distance < bestDistance)
199 bestDistance = distance;
208 ocean_assert(descriptorsA !=
nullptr);
210 unsigned int bestDistance = (
unsigned int)(-1);
216 if (distance < bestDistance)
218 bestDistance = distance;
227 unsigned int bestDistance = (
unsigned int)(-1);
233 if (distance < bestDistance)
235 bestDistance = distance;
244 unsigned int bestDistance = (
unsigned int)(-1);
246 for (
unsigned int n = 0u; n < descriptorA.descriptorLevels(); ++n)
250 if (distance < bestDistance)
252 bestDistance = distance;
261 if (index >= multiDescriptor.descriptorLevels())
271 ocean_assert(multiDescriptorGroup !=
nullptr);
273 if (index >= multiDescriptorGroup->size())
278 return &((*multiDescriptorGroup)[index]);
This class implements the abstract base class for all AnyCamera objects.
Definition: AnyCamera.h:130
static OCEAN_FORCE_INLINE unsigned int calculateHammingDistance(const void *descriptorA, const void *descriptorB)
Determines the hamming distance between two binary descriptors.
Definition: cv/detector/Descriptor.h:250
This class implements a frame pyramid.
Definition: FramePyramid.h:37
This class implements functions necessary when handling descriptors.
Definition: DescriptorHandling.h:32
static bool computeFreakDescriptor(const CV::FramePyramid &yFramePyramid, const AnyCamera &anyCamera, const Vector2 &point, FreakMultiDescriptor256 &freakDescriptor)
Computes the FREAK Multi descriptor for a given 2D location within an image.
static OCEAN_FORCE_INLINE const FreakMultiDescriptor256 * multiDescriptorGroupFunction(const FreakMultiDescriptors256 *const &multiDescriptorGroup, const size_t index)
Returns one FREAK Multi descriptor from a FREAK Multi descriptor group.
Definition: DescriptorHandling.h:269
static OCEAN_FORCE_INLINE unsigned int determineFreakDistance(const FreakMultiDescriptor256 &descriptorA, const FreakMultiDescriptor256 &descriptorB)
Determines the minimal distance between one FREAK multi descriptor and another FREAK multi descriptor...
Definition: DescriptorHandling.h:145
std::unordered_map< Index32, FreakMultiDescriptors256 > FreakMultiDescriptorMap256
Definition of an unordered map mapping FREAK Multi descriptors.
Definition: DescriptorHandling.h:48
static bool replaceDescriptorPyramid(const CV::FramePyramid &yFramePyramid, CV::FramePyramid &yFramePyramidForDescriptors, Worker *worker=nullptr)
Replaces an image pyramid which is intended for FREAK descriptor extraction.
CV::Detector::FREAKDescriptors32 FreakMultiDescriptors256
Definition of a vector holding FREAK Multi Descriptors with 32 bytes or 256 bits.
Definition: DescriptorHandling.h:43
static OCEAN_FORCE_INLINE unsigned int calculateHammingDistance(const FreakMultiDescriptor256 &descriptorA, const UnifiedDescriptor::BinaryDescriptor< 256u > &descriptorB)
Determines the minimal distance between a FREAK descriptors and a binary descriptor.
Definition: DescriptorHandling.h:242
static OCEAN_FORCE_INLINE const UnifiedDescriptor::BinaryDescriptor< 256u > * multiDescriptorFunction(const FreakMultiDescriptor256 &multiDescriptor, const size_t index)
Returns one binary descriptor from a FREAK Multi descriptor.
Definition: DescriptorHandling.h:259
CV::Detector::FREAKDescriptor32 FreakMultiDescriptor256
Definition of a FREAK Multi Descriptor with 32 bytes or 256 bits.
Definition: DescriptorHandling.h:38
ByteDescriptor< tNumberBits/8u > BinaryDescriptor
Definition of a binary descriptor.
Definition: UnifiedDescriptor.h:126
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
std::vector< FREAKDescriptor32 > FREAKDescriptors32
Vector of 32-bytes long FREAK descriptors.
Definition: FREAKDescriptor.h:69
FREAKDescriptorT< 32 > FREAKDescriptor32
Typedef for the 32-bytes long FREAK descriptor.
Definition: FREAKDescriptor.h:66
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15