scan_test.cpp
Go to the documentation of this file.
00001 
00002 
00003 #include <iostream>
00004 #include <pcl17/point_types.h>
00005 #include <pcl17/point_cloud.h>
00006 #include <pcl17/io/vtk_lib_io.h>
00007 #include <pcl17/io/pcd_io.h>
00008 #include <pcl17/common/transforms.h>
00009 #include <pcl17/visualization/pcl_visualizer.h>
00010 #include <pcl17/console/print.h>
00011 
00012 
00013 int main(int argc, char ** argv) {
00014   vtkSmartPointer<vtkPLYReader> readerQuery = vtkSmartPointer<vtkPLYReader>::New();
00015   readerQuery->SetFileName (argv[1]);
00016   vtkSmartPointer<vtkPolyData> polydata = readerQuery->GetOutput();
00017   polydata->Update();
00018 
00019   pcl17::visualization::PCLVisualizer vis("Visualizer");
00020 
00021   vis.addModelFromPolyData (polydata, "mesh1", 0);
00022 
00023   vis.camera_.window_size[0] = 480;
00024   vis.camera_.window_size[1] = 480;
00025   vis.camera_.pos[0] = 0;
00026   vis.camera_.pos[1] = 5;
00027   vis.camera_.pos[2] = 5;
00028   vis.camera_.focal[0] = 0;
00029   vis.camera_.focal[1] = 0;
00030   vis.camera_.focal[2] = 0;
00031   vis.camera_.view[0] = 0;
00032   vis.camera_.view[1] = 1;
00033   vis.camera_.view[2] = 0;
00034 
00035   vis.updateCamera();
00036   vis.resetCamera();
00037 
00038   vis.setRepresentationToSurfaceForAllActors();
00039   vis.spin();
00040 
00041   //call render in the visualizer to obtain a point cloud of the scene
00042   pcl17::PointCloud<pcl17::PointXYZ>::Ptr cloud_out (new pcl17::PointCloud<pcl17::PointXYZ> ());
00043   vis.renderView(256,256, cloud_out);
00044 
00045   pcl17::io::savePCDFileBinary("scene.pcd",*cloud_out);
00046 
00047   return 0;
00048 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


furniture_classification
Author(s): Vladyslav Usenko
autogenerated on Thu May 23 2013 18:32:29