Euclid
Geometry Processing and Shape Analysis in C++
SpinImage.h
1 #pragma once
2 
3 #include <vector>
4 #include <Eigen/Core>
5 #include <Euclid/MeshUtil/MeshDefs.h>
6 #include <Euclid/Util/Memory.h>
7 
8 namespace Euclid
9 {
26 template<typename Mesh>
27 class SpinImage
28 {
29 public:
30  using Vector_3 = Vector_3_t<Mesh>;
31  using FT = FT_t<Mesh>;
32 
33 public:
42  void build(const Mesh& mesh,
43  const std::vector<Vector_3>* vnormals = nullptr,
44  FT resolution = 0.0);
45 
57  template<typename Derived>
58  void compute(Eigen::ArrayBase<Derived>& spin_img,
59  float bin_scale = 1.0f,
60  int image_width = 16,
61  float support_angle = 90.0f);
62 
63 public:
67  const Mesh* mesh = nullptr;
68 
73 
77  FT resolution = 0.0;
78 };
79 
81 } // namespace Euclid
82 
83 #include "src/SpinImage.cpp"
A potentially resource owning pointer.
Definition: Memory.h:27
void build(const Mesh &mesh, const std::vector< Vector_3 > *vnormals=nullptr, FT resolution=0.0)
Build up the necessary computational components.
Definition: SpinImage.cpp:13
The spin image descriptor.
Definition: SpinImage.h:27
Definition: AABB.h:6
void compute(Eigen::ArrayBase< Derived > &spin_img, float bin_scale=1.0f, int image_width=16, float support_angle=90.0f)
Compute the spin image descriptor for all vertices.
Definition: SpinImage.cpp:42
FT resolution
The mesh resolution.
Definition: SpinImage.h:77
const Mesh * mesh
The mesh being processed.
Definition: SpinImage.h:67
ProPtr< const std::vector< Vector_3 > > vnormals
The vertex normals.
Definition: SpinImage.h:72