ImageTexturizer.hpp
Go to the documentation of this file.
1 
28 /*
29  * ImageTexturizer.hpp
30  *
31  * @date 01.11.2018
32  * @author Alexander Loehr (aloehr@uos.de)
33  */
34 
35 #ifndef LVR2_ALGORITHM_IMAGETEXTURIZER_HPP
36 #define LVR2_ALGORITHM_IMAGETEXTURIZER_HPP
37 
39 #include "lvr2/geometry/Normal.hpp"
40 
43 #include "lvr2/types/ScanTypes.hpp"
44 
45 #include <opencv2/core.hpp>
46 #include <opencv2/imgcodecs.hpp>
47 
48 namespace lvr2
49 {
50 
55 template<typename BaseVecT>
56 class ImageTexturizer : public Texturizer<BaseVecT>
57 {
58 
59 public:
60 
65  float texelSize,
66  int minClusterSize,
67  int maxClusterSize
68  ) : Texturizer<BaseVecT>(texelSize, minClusterSize, maxClusterSize)
69  {
70  image_data_initialized = false;
71  }
72 
78  void set_project(ScanProject& project)
79  {
80  this->project = project;
81  }
82 
95  int index,
96  const PointsetSurface<BaseVecT>& surface,
98  ) override;
99 
100 private:
102  ScanProject project;
103 
104  bool image_data_initialized;
105  std::vector<ScanImage> images;
106 
107  void init_image_data();
108 
109  template<typename ValueType>
110  void undistorted_to_distorted_uv(ValueType &u, ValueType &v, const ScanImage &img);
111 
112  bool exclude_image(BaseVecT pos, const ScanImage &image_data);
113 
114  bool point_behind_camera(BaseVecT pos, const ScanImage &image_data);
116 };
117 
118 } // namespace lvr2
119 
120 #include "ImageTexturizer.tcc"
121 
122 #endif
virtual TextureHandle generateTexture(int index, const PointsetSurface< BaseVecT > &surface, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect) override
Generates a Texture for a given Rectangle.
An interface class to wrap all functionality that is needed to generate a surface approximation from ...
A representation of a bounding rectangle.
Handle to access textures of the mesh.
Definition: Handles.hpp:158
void set_project(ScanProject &project)
Sets the internal UOS Scanproject to the given one.
ImageTexturizer(float texelSize, int minClusterSize, int maxClusterSize)
constructor
Class that performs texture-related tasks.
Definition: Texturizer.hpp:63
A texturizer that uses images instead of pointcloud colors for creating the textures for meshes...


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:06