Public Member Functions | Public Attributes | Protected Attributes | List of all members
lvr2::Texturizer< BaseVecT > Class Template Reference

Class that performs texture-related tasks. More...

#include <Texturizer.hpp>

Inheritance diagram for lvr2::Texturizer< BaseVecT >:
Inheritance graph
[legend]

Public Member Functions

TexCoords calculateTexCoords (TextureHandle texH, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect, BaseVecT v)
 Calculate texture coordinates for a given 3D point in a texture. More...
 
BaseVecT calculateTexCoordsInv (TextureHandle texH, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect, const TexCoords &coords)
 Calculate a global 3D position for given texture coordinates. More...
 
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. More...
 
virtual TextureHandle generateTexture (int index, const PointsetSurface< BaseVecT > &surface, const BoundingRectangle< typename BaseVecT::CoordType > &boundingRect)
 Generates a texture for a given bounding rectangle. More...
 
Texture getTexture (TextureHandle h)
 Get the texture to a given texture handle. More...
 
int getTextureIndex (TextureHandle h)
 Get the texture index to a given texture handle. More...
 
StableVector< TextureHandle, TexturegetTextures ()
 Returns all textures. More...
 
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. More...
 
void saveTextures ()
 Calls the save method for each texture. More...
 
 Texturizer (float texelSize, int texMinClusterSize, int texMaxClusterSize)
 Constructor. More...
 

Public Attributes

const float m_texelSize
 The size of a texture pixel. More...
 
const int m_texMaxClusterSize
 The maximum number of faces a cluster needs to be texturized. More...
 
const int m_texMinClusterSize
 The minimum number of faces a cluster needs to be texturized. More...
 

Protected Attributes

StableVector< TextureHandle, Texturem_textures
 StableVector, that contains all generated textures with texture handles. More...
 

Detailed Description

template<typename BaseVecT>
class lvr2::Texturizer< BaseVecT >

Class that performs texture-related tasks.

Definition at line 63 of file Texturizer.hpp.

Constructor & Destructor Documentation

◆ Texturizer()

template<typename BaseVecT >
lvr2::Texturizer< BaseVecT >::Texturizer ( float  texelSize,
int  texMinClusterSize,
int  texMaxClusterSize 
)

Constructor.

Parameters
texelSizeThe size of one texture pixel, relative to the coordinate system of the point cloud
texMinClusterSizeThe minimum number of faces a cluster needs to be texturized
texMaxClusterSizeThe maximum number of faces a cluster needs to be texturized

Member Function Documentation

◆ calculateTexCoords()

template<typename BaseVecT >
TexCoords lvr2::Texturizer< BaseVecT >::calculateTexCoords ( TextureHandle  texH,
const BoundingRectangle< typename BaseVecT::CoordType > &  boundingRect,
BaseVecT  v 
)

Calculate texture coordinates for a given 3D point in a texture.

Parameters
texHThe texture handle
boundingRectThe bounding rectangle of the texture
vThe 3D point
Returns
The texture coordinates

◆ calculateTexCoordsInv()

template<typename BaseVecT >
BaseVecT lvr2::Texturizer< BaseVecT >::calculateTexCoordsInv ( TextureHandle  texH,
const BoundingRectangle< typename BaseVecT::CoordType > &  boundingRect,
const TexCoords coords 
)

Calculate a global 3D position for given texture coordinates.

Parameters
texHThe texture handle
boundingRectThe bounding rectangle of the texture
coordsThe texture coordinates
Returns
The 3D point

◆ findKeyPointsInTexture()

template<typename BaseVecT >
void lvr2::Texturizer< BaseVecT >::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.

Parameters
[in]texHTexture handle
[in]boundingRectBounding rectangle computed for the texture
[in]detectorFeature detector to use (any of cv::Feature2D)
[out]keypointsVector of keypoints
[out]descriptorsMatrix of descriptors for the keypoint

◆ generateTexture()

template<typename BaseVecT >
virtual TextureHandle lvr2::Texturizer< BaseVecT >::generateTexture ( int  index,
const PointsetSurface< BaseVecT > &  surface,
const BoundingRectangle< typename BaseVecT::CoordType > &  boundingRect 
)
virtual

Generates a texture for a given bounding rectangle.

Create a grid, based on given information (texel size, bounding rectangle). For each cell in the grid (which represents a texel), let the PointsetSurface find the closest point in the point cloud and use that point's color as color for the texel.

Parameters
indexThe index the texture will get
surfaceThe point cloud
boundingRectThe bounding rectangle of the cluster
Returns
Texture handle of the generated texture

Reimplemented in lvr2::ImageTexturizer< BaseVecT >.

◆ getTexture()

template<typename BaseVecT >
Texture lvr2::Texturizer< BaseVecT >::getTexture ( TextureHandle  h)

Get the texture to a given texture handle.

Parameters
hThe texture handle
Returns
The texture

◆ getTextureIndex()

template<typename BaseVecT >
int lvr2::Texturizer< BaseVecT >::getTextureIndex ( TextureHandle  h)

Get the texture index to a given texture handle.

Parameters
hThe texture handle
Returns
The texture index

◆ getTextures()

template<typename BaseVecT >
StableVector<TextureHandle, Texture> lvr2::Texturizer< BaseVecT >::getTextures ( )

Returns all textures.

Returns
A StableVector containing all textures

◆ keypoints23d()

template<typename BaseVecT >
std::vector<BaseVecT> lvr2::Texturizer< BaseVecT >::keypoints23d ( const std::vector< cv::KeyPoint > &  keypoints,
const BoundingRectangle< typename BaseVecT::CoordType > &  boundingRect,
const TextureHandle h 
)

Compute 3D coordinates for texture-relative keypoints.

Parameters
[in]keypointsKeypoints in image coordinates
[in]boundingRectBounding rectangle of the texture embedded in 3D
Returns
Vector of 3D coordinates of all keypoints

◆ saveTextures()

template<typename BaseVecT >
void lvr2::Texturizer< BaseVecT >::saveTextures ( )

Calls the save method for each texture.

Member Data Documentation

◆ m_texelSize

template<typename BaseVecT >
const float lvr2::Texturizer< BaseVecT >::m_texelSize

The size of a texture pixel.

Definition at line 187 of file Texturizer.hpp.

◆ m_texMaxClusterSize

template<typename BaseVecT >
const int lvr2::Texturizer< BaseVecT >::m_texMaxClusterSize

The maximum number of faces a cluster needs to be texturized.

Definition at line 191 of file Texturizer.hpp.

◆ m_texMinClusterSize

template<typename BaseVecT >
const int lvr2::Texturizer< BaseVecT >::m_texMinClusterSize

The minimum number of faces a cluster needs to be texturized.

Definition at line 189 of file Texturizer.hpp.

◆ m_textures

template<typename BaseVecT >
StableVector<TextureHandle, Texture> lvr2::Texturizer< BaseVecT >::m_textures
protected

StableVector, that contains all generated textures with texture handles.

Definition at line 196 of file Texturizer.hpp.


The documentation for this class was generated from the following file:


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