40 #ifndef PCL_SURFACE_TEXTURE_MAPPING_H_
41 #define PCL_SURFACE_TEXTURE_MAPPING_H_
50 namespace texture_mapping
63 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
75 typedef std::vector<Camera, Eigen::aligned_allocator<Camera> >
CameraVector;
83 template<
typename Po
intInT>
88 typedef boost::shared_ptr< PointInT >
Ptr;
89 typedef boost::shared_ptr< const PointInT >
ConstPtr;
104 f_ (), vector_field_ (), tex_files_ (), tex_material_ ()
130 vector_field_ = Eigen::Vector3f (x, y, z);
132 vector_field_ = vector_field_ /
std::sqrt (vector_field_.dot (vector_field_));
141 tex_files_ = tex_files;
150 tex_material_ = tex_material;
188 double sizeX = cam.
width;
189 double sizeY = cam.
height;
190 double cx = (sizeX) / 2.0;
191 double cy = (sizeY) / 2.0;
197 UV_coordinates[0] =
static_cast<float> ((focal_x * (pt.x / pt.z) + cx) / sizeX);
198 UV_coordinates[1] = 1.0f -
static_cast<float> (((focal_y * (pt.y / pt.z) + cy) / sizeY));
201 if (UV_coordinates[0] >= 0.0 && UV_coordinates[0] <= 1.0 && UV_coordinates[1] >= 0.0 && UV_coordinates[1]
207 UV_coordinates[0] = -1.0;
208 UV_coordinates[1] = -1.0;
229 PointCloudPtr &filtered_cloud,
const double octree_voxel_size,
230 std::vector<int> &visible_indices, std::vector<int> &occluded_indices);
262 const double octree_voxel_size,
PointCloud &visible_pts);
277 const double octree_voxel_size,
278 const bool show_nb_occlusions =
true,
279 const int max_occlusions = 4);
294 double octree_voxel_size,
295 bool show_nb_occlusions =
true,
296 int max_occlusions = 4);
313 Eigen::Vector3f vector_field_;
316 std::vector<std::string> tex_files_;
326 std::vector<Eigen::Vector2f>
327 mapTexture2Face (
const Eigen::Vector3f &p1,
const Eigen::Vector3f &p2,
const Eigen::Vector3f &p3);
359 isFaceProjected (
const Camera &camera,
375 getClassName ()
const
377 return (
"TextureMapping");
381 EIGEN_MAKE_ALIGNED_OPERATOR_NEW