MEPP2 Project
cloud.h
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as
6 // published by the Free Software Foundation; either version 3 of
7 // the License, or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 
12 // -------------------------------------------------------------------------------------
13 // Iterative weighted PCA for robust and edge-aware normal vector estimation
14 //--------------------------------------------------------------------------------------
15 // Julia Sanchez, Florence Denis, David Coeurjolly, Florent dupont, Laurent Trassoudaine, Paul Checchin
16 // Liris (Lyon), Institut Pascal (Clermont Ferrand)
17 // Région Auvergne Rhône Alpes ARC6
18 // Private use for reviewers only
19 // --------------------------------------------------------------------------------------
20 
21 
22 #include <vector>
23 #include <fstream>
24 #include <math.h>
25 #include <algorithm>
26 #include <utility>
27 
28 #include <Eigen/Core>
29 #include <Eigen/Dense>
30 #include <Eigen/Eigenvalues>
31 
32 #if defined _MSC_VER
33 #pragma warning(push)
34 #pragma warning(disable: 4267 4244)
35 #endif
36 
37 #include <flann/flann.hpp>
38 
39 #if defined _MSC_VER
40 #pragma warning(pop)
41 #endif
42 
43 using namespace std;
44 
45 class RawCloud{
46  public:
48  int Read(std::string filepath);
49  void buildTree();
50  Eigen::Matrix<float, Eigen::Dynamic, 3> * getPC(){return pointcloud_;}
51  flann::Index<flann::L2<float>>* getTree(){return tree_;}
52  float getResolution ();
53  void rescale();
54 
55  Eigen::Matrix<float, Eigen::Dynamic, 3> *pointcloud_;
56 
57  private:
58  int ReadCSV(std::string filepath);
60  flann::Index<flann::L2<float>>* tree_;
61  float getNearestNeighborDistance(Eigen::Vector3f pt);
62  void SearchFLANNTree(flann::Index<flann::L2<float>>* index,
63  Eigen::Vector3f& input,
64  std::vector<int>& indices,
65  std::vector<float>& dists,
66  int nn);
67 
68 };
69 
70 #include "cloud.inl"
RawCloud::getTree
flann::Index< flann::L2< float > > * getTree()
Definition: cloud.h:51
RawCloud::pointcloud_
Eigen::Matrix< float, Eigen::Dynamic, 3 > * pointcloud_
Definition: cloud.h:55
FEVV::PMapsContainer
std::map< std::string, boost::any > PMapsContainer
Definition: properties.h:99
RawCloud::pmaps_bag
FEVV::PMapsContainer pmaps_bag
Definition: cloud.h:59
RawCloud::tree_
flann::Index< flann::L2< float > > * tree_
Definition: cloud.h:60
RawCloud::Read
int Read(std::string filepath)
RawCloud::getPC
Eigen::Matrix< float, Eigen::Dynamic, 3 > * getPC()
Definition: cloud.h:50
cloud.inl
RawCloud
Definition: cloud.h:45
RawCloud::RawCloud
RawCloud()
Definition: cloud.h:47