MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / main

Function main

tools/virtual_scanner.cpp:109–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109int
110main (int argc, char** argv)
111{
112 if (argc < 2)
113 {
114 PCL_INFO ("Usage %s [options] <model.ply | model.vtk>\n", argv[0]);
115 PCL_INFO (" * where options are:\n"
116 " -object_coordinates <0|1> : save the dataset in object coordinates (1) or camera coordinates (0)\n"
117 " -single_view <0|1> : take a single snapshot (1) or record a lot of camera poses on a view sphere (0)\n"
118 " -view_point <x,y,z> : set the camera viewpoint from where the acquisition will take place\n"
119 " -target_point <x,y,z> : the target point that the camera should look at (default: 0, 0, 0)\n"
120 " -organized <0|1> : create an organized, grid-like point cloud of width x height (1), or keep it unorganized with height = 1 (0)\n"
121 " -scale <double> : scaling factor to the points XYZ (default 1(m), 1000(mm))\n"
122 " -noise <0|1> : add gaussian noise (1) or keep the model noiseless (0)\n"
123 " -noise_std <x> : use X times the standard deviation\n"
124 "");
125 return (-1);
126 }
127
128 // Parse the command line arguments for .vtk or .ply files
129 std::vector<int> p_file_indices_vtk = console::parse_file_extension_argument (argc, argv, ".vtk");
130 std::vector<int> p_file_indices_ply = console::parse_file_extension_argument (argc, argv, ".ply");
131 bool object_coordinates = true;
132 console::parse_argument (argc, argv, "-object_coordinates", object_coordinates);
133 bool single_view = false;
134 console::parse_argument (argc, argv, "-single_view", single_view);
135 double vx = 0, vy = 0, vz = 0;
136 console::parse_3x_arguments (argc, argv, "-view_point", vx, vy, vz);
137 double tx = 0, ty = 0, tz = 0;
138 console::parse_3x_arguments (argc, argv, "-target_point", tx, ty, tz);
139 int organized = 0;
140 console::parse_argument (argc, argv, "-organized", organized);
141 double scale = 1;
142 console::parse_argument (argc, argv, "-scale", scale);
143
144 if (organized)
145 PCL_INFO ("Saving an organized dataset.\n");
146 else
147 PCL_INFO ("Saving an unorganized dataset.\n");
148
149 vtkSmartPointer<vtkPolyData> data;
150 // Loading PLY/VTK file
151 if (p_file_indices_ply.empty () && p_file_indices_vtk.empty ())
152 {
153 PCL_ERROR ("Error: no .PLY or .VTK files given!\n");
154 return (-1);
155 }
156
157 std::string filename;
158 if (!p_file_indices_ply.empty ())
159 filename = argv[p_file_indices_ply.at (0)];
160 else
161 filename = argv[p_file_indices_vtk.at (0)];
162
163 data = loadDataSet (filename.c_str ());
164
165 PCL_INFO ("Loaded model with %d vertices/points.\n", data->GetNumberOfPoints ());
166

Callers

nothing calls this directly

Calls 15

parse_argumentFunction · 0.85
loadDataSetFunction · 0.85
NewFunction · 0.85
absFunction · 0.85
splitFunction · 0.85
setLeafSizeMethod · 0.80
SetToleranceMethod · 0.80
IdentityMethod · 0.80
emptyMethod · 0.45
atMethod · 0.45
clearMethod · 0.45
GetPointMethod · 0.45

Tested by

no test coverage detected