export tool: added --camera_projection_keep_all option

This commit is contained in:
matlabbe
2021-08-03 13:46:39 -04:00
parent a5685c3e31
commit eeecb21793

View File

@@ -68,6 +68,7 @@ void showUsage()
" --texture_depth_error # Maximum depth error between reprojected mesh and depth image to texture a face (-1=disabled, 0=edge length is used, default=0).\n"
" --texture_d2c Distance to camera policy.\n"
" --cam_projection Camera projection on assembled cloud and export node ID on each point (in PointSourceId field).\n"
" --cam_projection_keep_all Keep not colored points from cameras (node ID will be 0 and color will be red).\n"
" --poses Export optimized poses of the robot frame (e.g., base_link).\n"
" --poses_camera Export optimized poses of the camera frame (e.g., optical frame).\n"
" --poses_scan Export optimized poses of the scan frame.\n"
@@ -150,6 +151,7 @@ int main(int argc, char * argv[])
int lowBrightnessGain = 0;
int highBrightnessGain = 10;
bool camProjection = false;
bool camProjectionKeepAll = false;
bool exportPoses = false;
bool exportPosesCamera = false;
bool exportPosesScan = false;
@@ -267,6 +269,10 @@ int main(int argc, char * argv[])
{
camProjection = true;
}
else if(std::strcmp(argv[i], "--cam_projection_keep_all") == 0)
{
camProjectionKeepAll = true;
}
else if(std::strcmp(argv[i], "--poses") == 0)
{
exportPoses = true;
@@ -1064,6 +1070,14 @@ int main(int argc, char * argv[])
pointToCamId[oi] = exportedId;
assembledCloudValidPoints->at(oi++) = pt;
}
else if(camProjectionKeepAll)
{
pointToCamId[oi] = 0; // invalid
pt.b = 0;
pt.g = 0;
pt.r = 255;
assembledCloudValidPoints->at(oi++) = pt; // red
}
}
assembledCloudValidPoints->resize(oi);