Point Cloud Library (PCL)  1.11.0
texture_mapping.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2011, Willow Garage, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of Willow Garage, Inc. nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  * $Id$
37  *
38  */
39 
40 #pragma once
41 
42 #include <pcl/memory.h>
43 #include <pcl/pcl_macros.h>
44 #include <pcl/surface/reconstruction.h>
45 #include <pcl/common/transforms.h>
46 #include <pcl/TextureMesh.h>
47 
48 
49 namespace pcl
50 {
51  namespace texture_mapping
52  {
53 
54  /** \brief Structure to store camera pose and focal length.
55  *
56  * One can assign a value to focal_length, to be used along
57  * both camera axes or, optionally, axis-specific values
58  * (focal_length_w and focal_length_h). Optionally, one can
59  * also specify center-of-focus using parameters
60  * center_w and center_h. If the center-of-focus is not
61  * specified, it will be set to the geometric center of
62  * the camera, as defined by the width and height parameters.
63  */
64  struct Camera
65  {
67  center_w (-1), center_h (-1), height (), width () {}
68  Eigen::Affine3f pose;
69  double focal_length;
70  double focal_length_w; // optional
71  double focal_length_h; // optinoal
72  double center_w; // optional
73  double center_h; // optional
74  double height;
75  double width;
76  std::string texture_file;
77 
79  };
80 
81  /** \brief Structure that links a uv coordinate to its 3D point and face.
82  */
83  struct UvIndex
84  {
85  UvIndex () : idx_cloud (), idx_face () {}
86  int idx_cloud; // Index of the PointXYZ in the camera's cloud
87  int idx_face; // Face corresponding to that projection
88  };
89 
90  using CameraVector = std::vector<Camera, Eigen::aligned_allocator<Camera> >;
91 
92  }
93 
94  /** \brief The texture mapping algorithm
95  * \author Khai Tran, Raphael Favier
96  * \ingroup surface
97  */
98  template<typename PointInT>
100  {
101  public:
102 
103  using Ptr = shared_ptr<TextureMapping<PointInT> >;
104  using ConstPtr = shared_ptr<const TextureMapping<PointInT> >;
105 
107  using PointCloudPtr = typename PointCloud::Ptr;
109 
111  using OctreePtr = typename Octree::Ptr;
113 
116 
117  /** \brief Constructor. */
119  f_ ()
120  {
121  }
122 
123  /** \brief Destructor. */
125  {
126  }
127 
128  /** \brief Set mesh scale control
129  * \param[in] f
130  */
131  inline void
132  setF (float f)
133  {
134  f_ = f;
135  }
136 
137  /** \brief Set vector field
138  * \param[in] x data point x
139  * \param[in] y data point y
140  * \param[in] z data point z
141  */
142  inline void
143  setVectorField (float x, float y, float z)
144  {
145  vector_field_ = Eigen::Vector3f (x, y, z);
146  // normalize vector field
147  vector_field_ /= std::sqrt (vector_field_.dot (vector_field_));
148  }
149 
150  /** \brief Set texture files
151  * \param[in] tex_files list of texture files
152  */
153  inline void
154  setTextureFiles (std::vector<std::string> tex_files)
155  {
156  tex_files_ = tex_files;
157  }
158 
159  /** \brief Set texture materials
160  * \param[in] tex_material texture material
161  */
162  inline void
164  {
165  tex_material_ = tex_material;
166  }
167 
168  /** \brief Map texture to a mesh synthesis algorithm
169  * \param[in] tex_mesh texture mesh
170  */
171  void
172  mapTexture2Mesh (pcl::TextureMesh &tex_mesh);
173 
174  /** \brief Map texture to a mesh UV mapping
175  * \param[in] tex_mesh texture mesh
176  */
177  void
179 
180  /** \brief Map textures acquired from a set of cameras onto a mesh.
181  * \details With UV mapping, the mesh must be divided into NbCamera + 1 sub-meshes.
182  * Each sub-mesh corresponding to the faces visible by one camera. The last submesh containing all non-visible faces
183  * \param[in] tex_mesh texture mesh
184  * \param[in] cams cameras used for UV mapping
185  */
186  void
189 
190  /** \brief computes UV coordinates of point, observed by one particular camera
191  * \param[in] pt XYZ point to project on camera plane
192  * \param[in] cam the camera used for projection
193  * \param[out] UV_coordinates the resulting uv coordinates. Set to (-1.0,-1.0) if the point is not visible by the camera
194  * \returns false if the point is not visible by the camera
195  */
196  inline bool
197  getPointUVCoordinates (const PointInT &pt, const Camera &cam, Eigen::Vector2f &UV_coordinates)
198  {
199  // if the point is in front of the camera
200  if (pt.z > 0)
201  {
202  // compute image center and dimension
203  double sizeX = cam.width;
204  double sizeY = cam.height;
205  double cx, cy;
206  if (cam.center_w > 0)
207  cx = cam.center_w;
208  else
209  cx = (sizeX) / 2.0;
210  if (cam.center_h > 0)
211  cy = cam.center_h;
212  else
213  cy = (sizeY) / 2.0;
214 
215  double focal_x, focal_y;
216  if (cam.focal_length_w > 0)
217  focal_x = cam.focal_length_w;
218  else
219  focal_x = cam.focal_length;
220  if (cam.focal_length_h>0)
221  focal_y = cam.focal_length_h;
222  else
223  focal_y = cam.focal_length;
224 
225  // project point on image frame
226  UV_coordinates[0] = static_cast<float> ((focal_x * (pt.x / pt.z) + cx) / sizeX); //horizontal
227  UV_coordinates[1] = 1.0f - static_cast<float> (((focal_y * (pt.y / pt.z) + cy) / sizeY)); //vertical
228 
229  // point is visible!
230  if (UV_coordinates[0] >= 0.0 && UV_coordinates[0] <= 1.0 && UV_coordinates[1] >= 0.0 && UV_coordinates[1]
231  <= 1.0)
232  return (true);
233  }
234 
235  // point is NOT visible by the camera
236  UV_coordinates[0] = -1.0;
237  UV_coordinates[1] = -1.0;
238  return (false);
239  }
240 
241  /** \brief Check if a point is occluded using raycasting on octree.
242  * \param[in] pt XYZ from which the ray will start (toward the camera)
243  * \param[in] octree the octree used for raycasting. It must be initialized with a cloud transformed into the camera's frame
244  * \returns true if the point is occluded.
245  */
246  inline bool
247  isPointOccluded (const PointInT &pt, const OctreePtr octree);
248 
249  /** \brief Remove occluded points from a point cloud
250  * \param[in] input_cloud the cloud on which to perform occlusion detection
251  * \param[out] filtered_cloud resulting cloud, containing only visible points
252  * \param[in] octree_voxel_size octree resolution (in meters)
253  * \param[out] visible_indices will contain indices of visible points
254  * \param[out] occluded_indices will contain indices of occluded points
255  */
256  void
257  removeOccludedPoints (const PointCloudPtr &input_cloud,
258  PointCloudPtr &filtered_cloud, const double octree_voxel_size,
259  std::vector<int> &visible_indices, std::vector<int> &occluded_indices);
260 
261  /** \brief Remove occluded points from a textureMesh
262  * \param[in] tex_mesh input mesh, on witch to perform occlusion detection
263  * \param[out] cleaned_mesh resulting mesh, containing only visible points
264  * \param[in] octree_voxel_size octree resolution (in meters)
265  */
266  void
267  removeOccludedPoints (const pcl::TextureMesh &tex_mesh, pcl::TextureMesh &cleaned_mesh, const double octree_voxel_size);
268 
269 
270  /** \brief Remove occluded points from a textureMesh
271  * \param[in] tex_mesh input mesh, on witch to perform occlusion detection
272  * \param[out] filtered_cloud resulting cloud, containing only visible points
273  * \param[in] octree_voxel_size octree resolution (in meters)
274  */
275  void
276  removeOccludedPoints (const pcl::TextureMesh &tex_mesh, PointCloudPtr &filtered_cloud, const double octree_voxel_size);
277 
278 
279  /** \brief Segment faces by camera visibility. Point-based segmentation.
280  * \details With N camera, faces will be arranged into N+1 groups: 1 for each camera, plus 1 for faces not visible from any camera.
281  * \param[in] tex_mesh input mesh that needs sorting. Must contain only 1 sub-mesh.
282  * \param[in] sorted_mesh resulting mesh, will contain nbCamera + 1 sub-mesh.
283  * \param[in] cameras vector containing the cameras used for texture mapping.
284  * \param[in] octree_voxel_size octree resolution (in meters)
285  * \param[out] visible_pts cloud containing only visible points
286  */
287  int
289  pcl::TextureMesh &sorted_mesh,
290  const pcl::texture_mapping::CameraVector &cameras,
291  const double octree_voxel_size, PointCloud &visible_pts);
292 
293  /** \brief Colors a point cloud, depending on its occlusions.
294  * \details If showNbOcclusions is set to True, each point is colored depending on the number of points occluding it.
295  * Else, each point is given a different a 0 value is not occluded, 1 if occluded.
296  * By default, the number of occlusions is bounded to 4.
297  * \param[in] input_cloud input cloud on which occlusions will be computed.
298  * \param[out] colored_cloud resulting colored cloud showing the number of occlusions per point.
299  * \param[in] octree_voxel_size octree resolution (in meters).
300  * \param[in] show_nb_occlusions If false, color information will only represent.
301  * \param[in] max_occlusions Limit the number of occlusions per point.
302  */
303  void
304  showOcclusions (const PointCloudPtr &input_cloud,
306  const double octree_voxel_size,
307  const bool show_nb_occlusions = true,
308  const int max_occlusions = 4);
309 
310  /** \brief Colors the point cloud of a Mesh, depending on its occlusions.
311  * \details If showNbOcclusions is set to True, each point is colored depending on the number of points occluding it.
312  * Else, each point is given a different a 0 value is not occluded, 1 if occluded.
313  * By default, the number of occlusions is bounded to 4.
314  * \param[in] tex_mesh input mesh on which occlusions will be computed.
315  * \param[out] colored_cloud resulting colored cloud showing the number of occlusions per point.
316  * \param[in] octree_voxel_size octree resolution (in meters).
317  * \param[in] show_nb_occlusions If false, color information will only represent.
318  * \param[in] max_occlusions Limit the number of occlusions per point.
319  */
320  void
321  showOcclusions (pcl::TextureMesh &tex_mesh,
323  double octree_voxel_size,
324  bool show_nb_occlusions = true,
325  int max_occlusions = 4);
326 
327  /** \brief Segment and texture faces by camera visibility. Face-based segmentation.
328  * \details With N camera, faces will be arranged into N+1 groups: 1 for each camera, plus 1 for faces not visible from any camera.
329  * The mesh will also contain uv coordinates for each face
330  * \param mesh input mesh that needs sorting. Should contain only 1 sub-mesh.
331  * \param[in] cameras vector containing the cameras used for texture mapping.
332  */
333  void
335  const pcl::texture_mapping::CameraVector &cameras);
336 
337  protected:
338  /** \brief mesh scale control. */
339  float f_;
340 
341  /** \brief vector field */
342  Eigen::Vector3f vector_field_;
343 
344  /** \brief list of texture files */
345  std::vector<std::string> tex_files_;
346 
347  /** \brief list of texture materials */
349 
350  /** \brief Map texture to a face
351  * \param[in] p1 the first point
352  * \param[in] p2 the second point
353  * \param[in] p3 the third point
354  */
355  std::vector<Eigen::Vector2f, Eigen::aligned_allocator<Eigen::Vector2f> >
356  mapTexture2Face (const Eigen::Vector3f &p1, const Eigen::Vector3f &p2, const Eigen::Vector3f &p3);
357 
358  /** \brief Returns the circumcenter of a triangle and the circle's radius.
359  * \details see http://en.wikipedia.org/wiki/Circumcenter for formulas.
360  * \param[in] p1 first point of the triangle.
361  * \param[in] p2 second point of the triangle.
362  * \param[in] p3 third point of the triangle.
363  * \param[out] circumcenter resulting circumcenter
364  * \param[out] radius the radius of the circumscribed circle.
365  */
366  inline void
367  getTriangleCircumcenterAndSize (const pcl::PointXY &p1, const pcl::PointXY &p2, const pcl::PointXY &p3, pcl::PointXY &circumcenter, double &radius);
368 
369 
370  /** \brief Returns the centroid of a triangle and the corresponding circumscribed circle's radius.
371  * \details yield a tighter circle than getTriangleCircumcenterAndSize.
372  * \param[in] p1 first point of the triangle.
373  * \param[in] p2 second point of the triangle.
374  * \param[in] p3 third point of the triangle.
375  * \param[out] circumcenter resulting circumcenter
376  * \param[out] radius the radius of the circumscribed circle.
377  */
378  inline void
379  getTriangleCircumcscribedCircleCentroid ( const pcl::PointXY &p1, const pcl::PointXY &p2, const pcl::PointXY &p3, pcl::PointXY &circumcenter, double &radius);
380 
381 
382  /** \brief computes UV coordinates of point, observed by one particular camera
383  * \param[in] pt XYZ point to project on camera plane
384  * \param[in] cam the camera used for projection
385  * \param[out] UV_coordinates the resulting UV coordinates. Set to (-1.0,-1.0) if the point is not visible by the camera
386  * \returns false if the point is not visible by the camera
387  */
388  inline bool
389  getPointUVCoordinates (const PointInT &pt, const Camera &cam, pcl::PointXY &UV_coordinates);
390 
391  /** \brief Returns true if all the vertices of one face are projected on the camera's image plane.
392  * \param[in] camera camera on which to project the face.
393  * \param[in] p1 first point of the face.
394  * \param[in] p2 second point of the face.
395  * \param[in] p3 third point of the face.
396  * \param[out] proj1 UV coordinates corresponding to p1.
397  * \param[out] proj2 UV coordinates corresponding to p2.
398  * \param[out] proj3 UV coordinates corresponding to p3.
399  */
400  inline bool
401  isFaceProjected (const Camera &camera,
402  const PointInT &p1, const PointInT &p2, const PointInT &p3,
403  pcl::PointXY &proj1, pcl::PointXY &proj2, pcl::PointXY &proj3);
404 
405  /** \brief Returns True if a point lays within a triangle
406  * \details see http://www.blackpawn.com/texts/pointinpoly/default.html
407  * \param[in] p1 first point of the triangle.
408  * \param[in] p2 second point of the triangle.
409  * \param[in] p3 third point of the triangle.
410  * \param[in] pt the querry point.
411  */
412  inline bool
413  checkPointInsideTriangle (const pcl::PointXY &p1, const pcl::PointXY &p2, const pcl::PointXY &p3, const pcl::PointXY &pt);
414 
415  /** \brief Class get name method. */
416  std::string
417  getClassName () const
418  {
419  return ("TextureMapping");
420  }
421 
422  public:
424  };
425 }
pcl::TextureMapping::checkPointInsideTriangle
bool checkPointInsideTriangle(const pcl::PointXY &p1, const pcl::PointXY &p2, const pcl::PointXY &p3, const pcl::PointXY &pt)
Returns True if a point lays within a triangle.
Definition: texture_mapping.hpp:1052
pcl::TextureMapping::tex_material_
TexMaterial tex_material_
list of texture materials
Definition: texture_mapping.h:348
pcl_macros.h
Defines all the PCL and non-PCL macros used.
pcl::texture_mapping::Camera::width
double width
Definition: texture_mapping.h:75
pcl::texture_mapping::Camera::focal_length_w
double focal_length_w
Definition: texture_mapping.h:70
pcl
Definition: convolution.h:46
pcl::texture_mapping::Camera::pose
Eigen::Affine3f pose
Definition: texture_mapping.h:68
pcl::TextureMapping::getTriangleCircumcscribedCircleCentroid
void getTriangleCircumcscribedCircleCentroid(const pcl::PointXY &p1, const pcl::PointXY &p2, const pcl::PointXY &p3, pcl::PointXY &circumcenter, double &radius)
Returns the centroid of a triangle and the corresponding circumscribed circle's radius.
Definition: texture_mapping.hpp:992
pcl::texture_mapping::UvIndex
Structure that links a uv coordinate to its 3D point and face.
Definition: texture_mapping.h:83
pcl::TextureMapping::mapTexture2MeshUV
void mapTexture2MeshUV(pcl::TextureMesh &tex_mesh)
Map texture to a mesh UV mapping.
Definition: texture_mapping.hpp:201
pcl::TextureMapping::textureMeshwithMultipleCameras
void textureMeshwithMultipleCameras(pcl::TextureMesh &mesh, const pcl::texture_mapping::CameraVector &cameras)
Segment and texture faces by camera visibility.
Definition: texture_mapping.hpp:718
pcl::TextureMapping::setTextureFiles
void setTextureFiles(std::vector< std::string > tex_files)
Set texture files.
Definition: texture_mapping.h:154
pcl::texture_mapping::Camera::focal_length_h
double focal_length_h
Definition: texture_mapping.h:71
pcl::PointCloud< PointInT >
pcl::texture_mapping::UvIndex::idx_face
int idx_face
Definition: texture_mapping.h:87
pcl::TextureMapping::isFaceProjected
bool isFaceProjected(const Camera &camera, const PointInT &p1, const PointInT &p2, const PointInT &p3, pcl::PointXY &proj1, pcl::PointXY &proj2, pcl::PointXY &proj3)
Returns true if all the vertices of one face are projected on the camera's image plane.
Definition: texture_mapping.hpp:1078
pcl::texture_mapping::Camera::height
double height
Definition: texture_mapping.h:74
pcl::TextureMapping::isPointOccluded
bool isPointOccluded(const PointInT &pt, const OctreePtr octree)
Check if a point is occluded using raycasting on octree.
Definition: texture_mapping.hpp:367
pcl::texture_mapping::Camera::Camera
Camera()
Definition: texture_mapping.h:66
pcl::TexMaterial
Definition: TextureMesh.h:49
pcl::texture_mapping::Camera::focal_length
double focal_length
Definition: texture_mapping.h:69
pcl::TextureMapping::vector_field_
Eigen::Vector3f vector_field_
vector field
Definition: texture_mapping.h:342
pcl::texture_mapping::Camera
Structure to store camera pose and focal length.
Definition: texture_mapping.h:64
pcl::TextureMapping::OctreePtr
typename Octree::Ptr OctreePtr
Definition: texture_mapping.h:111
pcl::TextureMapping
The texture mapping algorithm.
Definition: texture_mapping.h:99
pcl::TextureMapping::getPointUVCoordinates
bool getPointUVCoordinates(const PointInT &pt, const Camera &cam, Eigen::Vector2f &UV_coordinates)
computes UV coordinates of point, observed by one particular camera
Definition: texture_mapping.h:197
pcl::texture_mapping::Camera::texture_file
std::string texture_file
Definition: texture_mapping.h:76
pcl::TextureMapping::removeOccludedPoints
void removeOccludedPoints(const PointCloudPtr &input_cloud, PointCloudPtr &filtered_cloud, const double octree_voxel_size, std::vector< int > &visible_indices, std::vector< int > &occluded_indices)
Remove occluded points from a point cloud.
Definition: texture_mapping.hpp:406
pcl::TextureMapping::OctreeConstPtr
typename Octree::ConstPtr OctreeConstPtr
Definition: texture_mapping.h:112
pcl::texture_mapping::Camera::center_w
double center_w
Definition: texture_mapping.h:72
pcl::texture_mapping::CameraVector
std::vector< Camera, Eigen::aligned_allocator< Camera > > CameraVector
Definition: texture_mapping.h:90
pcl::TextureMapping::setTextureMaterials
void setTextureMaterials(TexMaterial tex_material)
Set texture materials.
Definition: texture_mapping.h:163
pcl::TextureMapping::mapTexture2Mesh
void mapTexture2Mesh(pcl::TextureMesh &tex_mesh)
Map texture to a mesh synthesis algorithm.
Definition: texture_mapping.hpp:145
pcl::octree::OctreePointCloudSearch::Ptr
shared_ptr< OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT > > Ptr
Definition: octree_search.h:70
PCL_MAKE_ALIGNED_OPERATOR_NEW
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Definition: memory.h:63
pcl::octree::OctreePointCloudSearch::ConstPtr
shared_ptr< const OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT > > ConstPtr
Definition: octree_search.h:72
pcl::TextureMapping::TextureMapping
TextureMapping()
Constructor.
Definition: texture_mapping.h:118
pcl::TextureMapping::getClassName
std::string getClassName() const
Class get name method.
Definition: texture_mapping.h:417
pcl::PointXY
A 2D point structure representing Euclidean xy coordinates.
Definition: point_types.hpp:744
pcl::TextureMapping::setVectorField
void setVectorField(float x, float y, float z)
Set vector field.
Definition: texture_mapping.h:143
pcl::TextureMapping::mapTexture2Face
std::vector< Eigen::Vector2f, Eigen::aligned_allocator< Eigen::Vector2f > > mapTexture2Face(const Eigen::Vector3f &p1, const Eigen::Vector3f &p2, const Eigen::Vector3f &p3)
Map texture to a face.
Definition: texture_mapping.hpp:47
pcl::PointCloud< PointInT >::Ptr
shared_ptr< PointCloud< PointInT > > Ptr
Definition: point_cloud.h:428
pcl::TextureMapping::PointCloudConstPtr
typename PointCloud::ConstPtr PointCloudConstPtr
Definition: texture_mapping.h:108
pcl::TextureMapping::showOcclusions
void showOcclusions(const PointCloudPtr &input_cloud, pcl::PointCloud< pcl::PointXYZI >::Ptr &colored_cloud, const double octree_voxel_size, const bool show_nb_occlusions=true, const int max_occlusions=4)
Colors a point cloud, depending on its occlusions.
Definition: texture_mapping.hpp:627
pcl::TextureMesh
Definition: TextureMesh.h:88
pcl::texture_mapping::UvIndex::UvIndex
UvIndex()
Definition: texture_mapping.h:85
pcl::TextureMapping::setF
void setF(float f)
Set mesh scale control.
Definition: texture_mapping.h:132
pcl::PointCloud< PointInT >::ConstPtr
shared_ptr< const PointCloud< PointInT > > ConstPtr
Definition: point_cloud.h:429
pcl::TextureMapping::f_
float f_
mesh scale control.
Definition: texture_mapping.h:339
pcl::texture_mapping::Camera::center_h
double center_h
Definition: texture_mapping.h:73
pcl::TextureMapping::mapMultipleTexturesToMeshUV
void mapMultipleTexturesToMeshUV(pcl::TextureMesh &tex_mesh, pcl::texture_mapping::CameraVector &cams)
Map textures acquired from a set of cameras onto a mesh.
Definition: texture_mapping.hpp:287
pcl::TextureMapping::ConstPtr
shared_ptr< const TextureMapping< PointInT > > ConstPtr
Definition: texture_mapping.h:104
pcl::TextureMapping::getTriangleCircumcenterAndSize
void getTriangleCircumcenterAndSize(const pcl::PointXY &p1, const pcl::PointXY &p2, const pcl::PointXY &p3, pcl::PointXY &circumcenter, double &radius)
Returns the circumcenter of a triangle and the circle's radius.
Definition: texture_mapping.hpp:959
pcl::TextureMapping::PointCloudPtr
typename PointCloud::Ptr PointCloudPtr
Definition: texture_mapping.h:107
pcl::octree::OctreePointCloudSearch
Octree pointcloud search class
Definition: octree_search.h:57
pcl::TextureMapping::tex_files_
std::vector< std::string > tex_files_
list of texture files
Definition: texture_mapping.h:345
pcl::TextureMapping::Ptr
shared_ptr< TextureMapping< PointInT > > Ptr
Definition: texture_mapping.h:103
pcl::TextureMapping::~TextureMapping
~TextureMapping()
Destructor.
Definition: texture_mapping.h:124
memory.h
Defines functions, macros and traits for allocating and using memory.
pcl::TextureMapping::sortFacesByCamera
int sortFacesByCamera(pcl::TextureMesh &tex_mesh, pcl::TextureMesh &sorted_mesh, const pcl::texture_mapping::CameraVector &cameras, const double octree_voxel_size, PointCloud &visible_pts)
Segment faces by camera visibility.
Definition: texture_mapping.hpp:541
pcl::texture_mapping::UvIndex::idx_cloud
int idx_cloud
Definition: texture_mapping.h:86