本文整理汇总了C++中PCDWriter类的典型用法代码示例。如果您正苦于以下问题:C++ PCDWriter类的具体用法?C++ PCDWriter怎么用?C++ PCDWriter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PCDWriter类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
/* ---[ */
int
main (int argc, char** argv)
{
print_info ("Convert a simple XYZ file to PCD format. For more information, use: %s -h\n", argv[0]);
if (argc < 3)
{
printHelp (argc, argv);
return (-1);
}
// Parse the command line arguments for .pcd and .ply files
vector<int> pcd_file_indices = parse_file_extension_argument (argc, argv, ".pcd");
vector<int> xyz_file_indices = parse_file_extension_argument (argc, argv, ".xyz");
if (pcd_file_indices.size () != 1 || xyz_file_indices.size () != 1)
{
print_error ("Need one input XYZ file and one output PCD file.\n");
return (-1);
}
// Load the first file
PointCloud<PointXYZ> cloud;
if (!loadCloud (argv[xyz_file_indices[0]], cloud))
return (-1);
// Convert to PCD and save
PCDWriter w;
w.writeBinaryCompressed (argv[pcd_file_indices[0]], cloud);
}
示例2: saveCloud
void
saveCloud (const string &filename, const pcl::PCLPointCloud2 &output,
const Eigen::Vector4f &translation, const Eigen::Quaternionf &orientation)
{
PCDWriter w;
w.writeBinaryCompressed (filename, output, translation, orientation);
}
示例3: cloud_cb
void
cloud_cb (const CloudConstPtr& cloud)
{
PCDWriter w;
sprintf (buf, "frame_%06d.pcd", i);
w.writeBinaryCompressed (buf, *cloud);
PCL_INFO ("Wrote a cloud with %zu (%ux%u) points in %s.\n",
cloud->size (), cloud->width, cloud->height, buf);
++i;
}
示例4: save
void
save (const std::string &object_file, const std::string &plane_file)
{
PCDWriter w;
if (object_ && !object_->empty ())
{
w.writeBinaryCompressed (object_file, *object_);
w.writeBinaryCompressed (plane_file, *plane_);
print_highlight ("Object successfully segmented. Saving results in: %s, and %s.\n", object_file.c_str (), plane_file.c_str ());
}
}
示例5: saveCloud
void
saveCloud (const string &filename, const pcl::PCLPointCloud2 &output)
{
TicToc tt;
tt.tic ();
print_highlight ("Saving "); print_value ("%s ", filename.c_str ());
PCDWriter w;
w.writeBinaryCompressed (filename, output, translation, orientation);
print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms : "); print_value ("%d", output.width * output.height); print_info (" points]\n");
}
示例6: saveCloud
void
saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output)
{
TicToc tt;
tt.tic ();
print_highlight ("Saving "); print_value ("%s ", filename.c_str ());
PCDWriter w;
w.writeBinaryCompressed (filename, output);
printElapsedTimeAndNumberOfPoints (tt.toc (), output.width, output.height);
}
示例7: saveCloud
void
saveCloud (const std::string &filename, CloudLT::Ptr &output)
{
TicToc tt;
tt.tic ();
print_highlight ("Saving "); print_value ("%s ", filename.c_str ());
PCDWriter w;
w.write (filename, *output);
print_info ("[done, ");
print_value ("%g", tt.toc ()); print_info (" ms : ");
print_value ("%d", output->width * output->height); print_info (" points]\n");
}
示例8: computeFeatures
// TODO Enum for is_test_phase
PointCloud<Signature>::Ptr
Detector::obtainFeatures(Scene &scene, PointCloud<PointNormal>::Ptr keypoints, bool is_test_phase, bool cache)
{
if (cache == false)
{
PointCloud<Signature>::Ptr features = computeFeatures(scene.cloud, keypoints);
return features;
}
else
{
std::string name_str = std::string(feature_est_->name_) + scene.id;
if (is_test_phase) {
name_str += "_test";
}
else {
name_str += "_train";
}
name_str += ".pcd";
const char *name = name_str.c_str();
if (ifstream(name)) {
PointCloud<Signature>::Ptr features (new PointCloud<Signature>());
PCDReader r;
r.readEigen(std::string(name), *features);
//*features = *tmp;
//io::loadPCDFile(name, *features);
if (features->size() != keypoints->size())
assert(false);
cout << "got " << features->size() << " features from " << keypoints->size() << " points" << endl;
return features;
} else {
PointCloud<Signature>::Ptr features = computeFeatures(scene.cloud, keypoints);
PCDWriter w;
w.writeASCIIEigen(std::string(name), *features);
return features;
}
}
}