Texturing: using depth image to filter wrongly projected textures

This commit is contained in:
matlabbe
2017-06-06 11:42:42 -04:00
parent fa95ede3e9
commit 7a0a82bcb4
6 changed files with 376 additions and 131 deletions
+20 -1
View File
@@ -78,6 +78,7 @@ namespace pcl
double width;
std::string texture_file;
std::vector<double> roi; // [x, y, width, height]
cv::Mat depth;
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
@@ -120,7 +121,7 @@ namespace pcl
/** \brief Constructor. */
TextureMapping () :
f_ (), vector_field_ (), tex_files_ (), tex_material_ (), max_distance_(0.0f), min_cluster_size_(50)
f_ (), vector_field_ (), tex_files_ (), tex_material_ (), max_distance_(0.0f), max_depth_error_(0.0f), max_angle_(0.0f), min_cluster_size_(50)
{
}
@@ -175,6 +176,18 @@ namespace pcl
max_distance_ = maxDistance;
}
inline void
setMaxDepthError(float maxDepthError)
{
max_depth_error_ = maxDepthError;
}
inline void
setMaxAngle(float maxAngle)
{
max_angle_ = maxAngle;
}
inline void
setMinClusterSize(int size)
{
@@ -371,6 +384,12 @@ namespace pcl
/** \brief maximum distance between camera and polygon to apply a texture */
float max_distance_;
/** \brief maximum depth error between projected point and corresponding depth of the camera to apply a texture */
float max_depth_error_;
/** \brief maximum angle (rad) between camera and polygon to apply a texture */
float max_angle_;
/** \brief Remove texture from small polygon clusters */
int min_cluster_size_;