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_ */
Handles.hpp
BaseVector.hpp
lvr2::Texturizer::m_texelSize
const float m_texelSize
The size of a texture pixel.
Definition: Texturizer.hpp:187
PointsetSurface.hpp
lvr2::Texturizer::keypoints23d
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.
lvr2::BoundingRectangle
A representation of a bounding rectangle.
Definition: BoundingRectangle.hpp:77
lvr2::Texturizer::m_texMaxClusterSize
const int m_texMaxClusterSize
The maximum number of faces a cluster needs to be texturized.
Definition: Texturizer.hpp:191
BaseMesh.hpp
lvr2::Texturizer::getTextures
StableVector< TextureHandle, Texture > getTextures()
Returns all textures.
ClusterTexCoordMapping.hpp
lvr2::Texturizer::calculateTexCoords
TexCoords calculateTexCoords(TextureHandle texH, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect, BaseVecT v)
Calculate texture coordinates for a given 3D point in a texture.
lvr2::Texturizer
Class that performs texture-related tasks.
Definition: Texturizer.hpp:63
Texture.hpp
lvr2::Texturizer::generateTexture
virtual TextureHandle generateTexture(int index, const PointsetSurface< BaseVecT > &surface, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect)
Generates a texture for a given bounding rectangle.
ClusterBiMap.hpp
lvr2::StableVector
A vector which guarantees stable indices and features O(1) deletion.
Definition: StableVector.hpp:104
lvr2::PointsetSurface
An interface class to wrap all functionality that is needed to generate a surface approximation from ...
Definition: PointsetSurface.hpp:61
lvr2::Texturizer::calculateTexCoordsInv
BaseVecT calculateTexCoordsInv(TextureHandle texH, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect, const TexCoords &coords)
Calculate a global 3D position for given texture coordinates.
lvr2::Texturizer::getTextureIndex
int getTextureIndex(TextureHandle h)
Get the texture index to a given texture handle.
lvr2::Texturizer::findKeyPointsInTexture
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.
lvr2
Definition: BaseBufferManipulators.hpp:39
Material.hpp
lvr2::Texturizer::m_texMinClusterSize
const int m_texMinClusterSize
The minimum number of faces a cluster needs to be texturized.
Definition: Texturizer.hpp:189
lvr2::Texture
This class represents a texture.
Definition: Texture.hpp:54
lvr2::Texturizer::saveTextures
void saveTextures()
Calls the save method for each texture.
lvr2::TextureHandle
Handle to access textures of the mesh.
Definition: Handles.hpp:158
lvr2::Texturizer::m_textures
StableVector< TextureHandle, Texture > m_textures
StableVector, that contains all generated textures with texture handles.
Definition: Texturizer.hpp:196
lvr2::Texturizer::Texturizer
Texturizer(float texelSize, int texMinClusterSize, int texMaxClusterSize)
Constructor.
BoundingRectangle.hpp
Normal.hpp
lvr2::Texturizer::getTexture
Texture getTexture(TextureHandle h)
Get the texture to a given texture handle.
lvr2::TexCoords
Texture coordinates.
Definition: ClusterTexCoordMapping.hpp:54


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