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
Texturizer.hpp
lvr2::ImageTexturizer
A texturizer that uses images instead of pointcloud colors for creating the textures for meshes.
Definition: ImageTexturizer.hpp:56
lvr2::BoundingRectangle
A representation of a bounding rectangle.
Definition: BoundingRectangle.hpp:77
lvr2::ImageTexturizer::generateTexture
virtual TextureHandle generateTexture(int index, const PointsetSurface< BaseVecT > &surface, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect) override
Generates a Texture for a given Rectangle.
ScanTypes.hpp
lvr2::Texturizer
Class that performs texture-related tasks.
Definition: Texturizer.hpp:63
lvr2::PointsetSurface
An interface class to wrap all functionality that is needed to generate a surface approximation from ...
Definition: PointsetSurface.hpp:61
MatrixTypes.hpp
lvr2::ScanImage
Definition: ScanTypes.hpp:107
lvr2::ScanProject
Definition: ScanTypes.hpp:322
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::TextureHandle
Handle to access textures of the mesh.
Definition: Handles.hpp:158
lvr2::ImageTexturizer::set_project
void set_project(ScanProject &project)
Sets the internal UOS Scanproject to the given one.
Definition: ImageTexturizer.hpp:78
Normal.hpp
lvr2::ImageTexturizer::ImageTexturizer
ImageTexturizer(float texelSize, int minClusterSize, int maxClusterSize)
constructor
Definition: ImageTexturizer.hpp:64
TransformUtils.hpp


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 Wed Mar 2 2022 00:37:23