ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
utils.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "feature/types.h"
11 
12 namespace colmap {
13 
14 // Convert feature keypoints to vector of points.
15 std::vector<Eigen::Vector2d> FeatureKeypointsToPointsVector(
16  const FeatureKeypoints& keypoints);
17 
18 // L2-normalize feature descriptor, where each row represents one feature.
19 Eigen::MatrixXf L2NormalizeFeatureDescriptors(
20  const Eigen::MatrixXf& descriptors);
21 
22 // L1-Root-normalize feature descriptors, where each row represents one feature.
23 // See "Three things everyone should know to improve object retrieval",
24 // Relja Arandjelovic and Andrew Zisserman, CVPR 2012.
25 Eigen::MatrixXf L1RootNormalizeFeatureDescriptors(
26  const Eigen::MatrixXf& descriptors);
27 
28 // Convert normalized floating point feature descriptor to unsigned byte
29 // representation by linear scaling from range [0, 0.5] to [0, 255]. Truncation
30 // to a maximum value of 0.5 is used to avoid precision loss and follows the
31 // common practice of representing SIFT vectors.
33  const Eigen::MatrixXf& descriptors);
34 
35 // Extract the descriptors corresponding to the largest-scale features.
38  const size_t num_features);
39 
40 } // namespace colmap
Eigen::MatrixXf L1RootNormalizeFeatureDescriptors(const Eigen::MatrixXf &descriptors)
Definition: utils.cc:52
void ExtractTopScaleFeatures(FeatureKeypoints *keypoints, FeatureDescriptors *descriptors, const size_t num_features)
Definition: utils.cc:79
Eigen::Matrix< uint8_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > FeatureDescriptors
Definition: types.h:79
FeatureDescriptors FeatureDescriptorsToUnsignedByte(const Eigen::MatrixXf &descriptors)
Definition: utils.cc:65
Eigen::MatrixXf L2NormalizeFeatureDescriptors(const Eigen::MatrixXf &descriptors)
Definition: utils.cc:47
std::vector< Eigen::Vector2d > FeatureKeypointsToPointsVector(const FeatureKeypoints &keypoints)
Definition: utils.cc:38
std::vector< FeatureKeypoint > FeatureKeypoints
Definition: types.h:77
CorePointDescSet * descriptors