未验证 提交 b65e6439 编写于 作者: L Lars Glud 提交者: GitHub

Merge pull request #4562 from SunBlack/replace_stringstream_apps

[Apps] Replace std::stringstream by std::string, part 2
......@@ -181,30 +181,28 @@ pcl::rec_3d_framework::GlobalNNPipeline<Distance, PointInT, FeatureT>::initializ
if (!bf::exists(desc_dir))
bf::create_directory(desc_dir);
std::stringstream path_view;
path_view << path << "/view_" << v << ".pcd";
pcl::io::savePCDFileBinary(path_view.str(), *processed);
std::stringstream path_pose;
path_pose << path << "/pose_" << v << ".txt";
PersistenceUtils::writeMatrixToFile(path_pose.str(),
models->at(i).poses_->at(v));
std::stringstream path_entropy;
path_entropy << path << "/entropy_" << v << ".txt";
PersistenceUtils::writeFloatToFile(path_entropy.str(),
const std::string path_view = path + "/view_" + std::to_string(v) + ".pcd";
pcl::io::savePCDFileBinary(path_view, *processed);
const std::string path_pose = path + "/pose_" + std::to_string(v) + ".txt";
PersistenceUtils::writeMatrixToFile(path_pose, models->at(i).poses_->at(v));
const std::string path_entropy =
path + "/entropy_" + std::to_string(v) + ".txt";
PersistenceUtils::writeFloatToFile(path_entropy,
models->at(i).self_occlusions_->at(v));
// save signatures and centroids to disk
for (std::size_t j = 0; j < signatures.size(); j++) {
std::stringstream path_centroid;
path_centroid << path << "/centroid_" << v << "_" << j << ".txt";
const std::string path_centroid = path + "/centroid_" + std::to_string(v) +
"_" + std::to_string(j) + ".txt";
Eigen::Vector3f centroid(centroids[j][0], centroids[j][1], centroids[j][2]);
PersistenceUtils::writeCentroidToFile(path_centroid.str(), centroid);
PersistenceUtils::writeCentroidToFile(path_centroid, centroid);
std::stringstream path_descriptor;
path_descriptor << path << "/descriptor_" << v << "_" << j << ".pcd";
pcl::io::savePCDFileBinary(path_descriptor.str(), signatures[j]);
const std::string path_descriptor = path + "/descriptor_" +
std::to_string(v) + "_" +
std::to_string(j) + ".pcd";
pcl::io::savePCDFileBinary(path_descriptor, signatures[j]);
}
}
}
......
......@@ -153,12 +153,11 @@ pcl::rec_3d_framework::GlobalNNCVFHRecognizer<Distance, PointInT, FeatureT>::
flann_models_.push_back(descr_model);
if (use_cache_) {
std::stringstream dir_pose;
dir_pose << path << "/pose_" << descr_model.view_id << ".txt";
const std::string dir_pose =
path + "/pose_" + std::to_string(descr_model.view_id) + ".txt";
Eigen::Matrix4f pose_matrix;
PersistenceUtils::readMatrixFromFile(dir_pose.str(), pose_matrix);
PersistenceUtils::readMatrixFromFile(dir_pose, pose_matrix);
std::pair<std::string, int> pair_model_view =
std::make_pair(models->at(i).id_, descr_model.view_id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册