ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvFeature.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 "CV_db.h"
11 
12 // LOCAL
13 #include <Optional.h>
14 
15 #include "ecvKDTreeSearchParam.h"
16 
17 // EIGEN
18 #include <Eigen.h>
19 
20 class ccPointCloud;
21 namespace cloudViewer {
22 namespace utility {
23 
24 typedef std::vector<Eigen::Vector2i> CorrespondenceSet;
25 
30 public:
35  void Resize(int dim, int n) {
36  data_.resize(dim, n);
37  data_.setZero();
38  }
40  size_t Dimension() const { return data_.rows(); }
42  size_t Num() const { return data_.cols(); }
43 
49  std::shared_ptr<Feature> SelectByIndex(const std::vector<size_t> &indices,
50  bool invert = false) const;
51 
52 public:
54  Eigen::MatrixXd data_;
55 };
56 
63 std::shared_ptr<Feature> CV_DB_LIB_API
65  const geometry::KDTreeSearchParam &search_param =
67  const utility::optional<std::vector<size_t>> &indices =
69 
87 CorrespondencesFromFeatures(const Feature &source_features,
88  const Feature &target_features,
89  bool mutual_filter = false,
90  float mutual_consistency_ratio = 0.1);
91 
92 } // namespace utility
93 } // namespace cloudViewer
#define CV_DB_LIB_API
Definition: CV_db.h:15
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
KDTree search parameters for pure KNN search.
Base class for KDTree search parameters.
Class to store featrues for registration.
Definition: ecvFeature.h:29
std::shared_ptr< Feature > SelectByIndex(const std::vector< size_t > &indices, bool invert=false) const
Selects features from input Feature group, with indices in indices, and returns a new Feature group w...
size_t Dimension() const
Returns feature dimensions per point.
Definition: ecvFeature.h:40
void Resize(int dim, int n)
Definition: ecvFeature.h:35
size_t Num() const
Returns number of points.
Definition: ecvFeature.h:42
Eigen::MatrixXd data_
Data buffer storing features.
Definition: ecvFeature.h:54
std::vector< Eigen::Vector2i > CorrespondenceSet
Definition: ecvFeature.h:24
constexpr nullopt_t nullopt
Definition: Optional.h:136
std::shared_ptr< Feature > ComputeFPFHFeature(const ccPointCloud &input, const geometry::KDTreeSearchParam &search_param=geometry::KDTreeSearchParamKNN(), const utility::optional< std::vector< size_t >> &indices=utility::nullopt)
CorrespondenceSet CorrespondencesFromFeatures(const Feature &source_features, const Feature &target_features, bool mutual_filter=false, float mutual_consistency_ratio=0.1)
Function to find correspondences via 1-nearest neighbor feature matching. Target is used to construct...
Generic file read and write utility for python interface.