Texturing: add distanceToCamPolicy option

This commit is contained in:
matlabbe
2020-11-03 16:11:37 -05:00
parent 596cd10b69
commit e269067d4c
7 changed files with 61 additions and 28 deletions
@@ -1055,7 +1055,8 @@ pcl::TextureMapping<PointInT>::textureMeshwithMultipleCameras2 (
pcl::TextureMesh &mesh,
const pcl::texture_mapping::CameraVector &cameras,
const rtabmap::ProgressState * state,
std::vector<std::map<int, pcl::PointXY> > * vertexToPixels)
std::vector<std::map<int, pcl::PointXY> > * vertexToPixels,
bool distanceToCamPolicy)
{
if (mesh.tex_polygons.size () != 1)
@@ -1386,10 +1387,15 @@ pcl::TextureMapping<PointInT>::textureMeshwithMultipleCameras2 (
//UDEBUG("Process polygon %d cam =%d distanceToCam=%f", idx_face, current_cam, distanceToCam);
if(distanceToCenter <= smallestWeight || (!depthSet && currentDepthSet))
float distance = distanceToCenter;
if(distanceToCamPolicy)
{
distance = distanceToCam;
}
if(distance <= smallestWeight || (!depthSet && currentDepthSet))
{
cameraIndex = current_cam;
smallestWeight = distanceToCenter;
smallestWeight = distance;
uv_coords[0] = iter->second.uv_coord1;
uv_coords[1] = iter->second.uv_coord2;
uv_coords[2] = iter->second.uv_coord3;
+2 -1
View File
@@ -366,7 +366,8 @@ namespace pcl
textureMeshwithMultipleCameras2 (pcl::TextureMesh &mesh,
const pcl::texture_mapping::CameraVector &cameras,
const rtabmap::ProgressState * callback = 0,
std::vector<std::map<int, pcl::PointXY> > * vertexToPixels = 0);
std::vector<std::map<int, pcl::PointXY> > * vertexToPixels = 0,
bool distanceToCamPolicy = false);
protected:
/** \brief mesh scale control. */