36 #ifndef LVR2_ALGORITHM_TEXTURIZER_H_ 37 #define LVR2_ALGORITHM_TEXTURIZER_H_ 39 #include <boost/shared_ptr.hpp> 40 #include <boost/smart_ptr/make_shared.hpp> 53 #include <opencv2/features2d.hpp> 62 template<
typename BaseVecT>
77 int texMinClusterSize,
117 const cv::Ptr<cv::Feature2D>& detector,
118 std::vector<cv::KeyPoint>&
119 keypoints, cv::Mat& descriptors);
129 std::vector<BaseVecT>
keypoints23d(
const std::vector<cv::KeyPoint>&
203 #include "lvr2/algorithm/Texturizer.tcc"
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.
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.
const int m_texMaxClusterSize
The maximum number of faces a cluster needs to be texturized.
A representation of a bounding rectangle.
Handle to access textures of the mesh.
StableVector< TextureHandle, Texture > m_textures
StableVector, that contains all generated textures with texture handles.
This class represents a texture.
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.
Texture getTexture(TextureHandle h)
Get the texture to a given texture handle.
const float m_texelSize
The size of a texture pixel.
BaseVecT calculateTexCoordsInv(TextureHandle texH, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect, const TexCoords &coords)
Calculate a global 3D position for given texture coordinates.