Texturizer.hpp
Go to the documentation of this file.
1 
28 /*
29 * Texturizer.hpp
30 *
31 * @date 15.09.2017
32 * @author Jan Philipp Vogtherr <jvogtherr@uni-osnabrueck.de>
33 * @author Kristin Schmidt <krschmidt@uni-osnabrueck.de>
34 */
35 
36 #ifndef LVR2_ALGORITHM_TEXTURIZER_H_
37 #define LVR2_ALGORITHM_TEXTURIZER_H_
38 
39 #include <boost/shared_ptr.hpp>
40 #include <boost/smart_ptr/make_shared.hpp>
41 
45 #include "lvr2/geometry/Normal.hpp"
49 #include "lvr2/texture/Texture.hpp"
52 
53 #include <opencv2/features2d.hpp>
54 
55 namespace lvr2
56 {
57 
62 template<typename BaseVecT>
64 {
65 
66 public:
67 
75  Texturizer(
76  float texelSize,
77  int texMinClusterSize,
78  int texMaxClusterSize
79  );
80 
89 
96 
105 
115  void findKeyPointsInTexture(const TextureHandle texH,
117  const cv::Ptr<cv::Feature2D>& detector,
118  std::vector<cv::KeyPoint>&
119  keypoints, cv::Mat& descriptors);
120 
129  std::vector<BaseVecT> keypoints23d(const std::vector<cv::KeyPoint>&
130  keypoints, const BoundingRectangle<typename BaseVecT::CoordType>& boundingRect, const TextureHandle& h);
131 
146  int index,
147  const PointsetSurface<BaseVecT>& surface,
149  );
150 
161  TextureHandle texH,
163  BaseVecT v
164  );
165 
175  BaseVecT calculateTexCoordsInv(
176  TextureHandle texH,
178  const TexCoords& coords
179  );
180 
184  void saveTextures();
185 
187  const float m_texelSize;
192 
193 protected:
194 
197 
198 };
199 
200 
201 } // namespace lvr2
202 
203 #include "lvr2/algorithm/Texturizer.tcc"
204 
205 #endif /* LVR2_ALGORITHM_TEXTURIZER_H_ */
StableVector< TextureHandle, Texture > getTextures()
Returns all textures.
Texturizer(float texelSize, int texMinClusterSize, int texMaxClusterSize)
Constructor.
A vector which guarantees stable indices and features O(1) deletion.
virtual TextureHandle generateTexture(int index, const PointsetSurface< BaseVecT > &surface, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect)
Generates a texture for a given bounding rectangle.
TexCoords calculateTexCoords(TextureHandle texH, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect, BaseVecT v)
Calculate texture coordinates for a given 3D point in a texture.
void findKeyPointsInTexture(const TextureHandle texH, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect, const cv::Ptr< cv::Feature2D > &detector, std::vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors)
Discover keypoints in a texture.
int getTextureIndex(TextureHandle h)
Get the texture index to a given texture handle.
Texture coordinates.
An interface class to wrap all functionality that is needed to generate a surface approximation from ...
const int m_texMinClusterSize
The minimum number of faces a cluster needs to be texturized.
Definition: Texturizer.hpp:189
const int m_texMaxClusterSize
The maximum number of faces a cluster needs to be texturized.
Definition: Texturizer.hpp:191
A representation of a bounding rectangle.
Handle to access textures of the mesh.
Definition: Handles.hpp:158
StableVector< TextureHandle, Texture > m_textures
StableVector, that contains all generated textures with texture handles.
Definition: Texturizer.hpp:196
This class represents a texture.
Definition: Texture.hpp:54
std::vector< BaseVecT > keypoints23d(const std::vector< cv::KeyPoint > &keypoints, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect, const TextureHandle &h)
Compute 3D coordinates for texture-relative keypoints.
void saveTextures()
Calls the save method for each texture.
Class that performs texture-related tasks.
Definition: Texturizer.hpp:63
Texture getTexture(TextureHandle h)
Get the texture to a given texture handle.
const float m_texelSize
The size of a texture pixel.
Definition: Texturizer.hpp:187
BaseVecT calculateTexCoordsInv(TextureHandle texH, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect, const TexCoords &coords)
Calculate a global 3D position for given texture coordinates.


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:09