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

Function compute

tools/train_linemod_template.cpp:202–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void
203compute (const PointCloudXYZRGBA::ConstPtr & input, float min_depth, float max_depth, float max_height,
204 const std::string & template_pcd_filename, const std::string & template_sqmmt_filename)
205{
206 // Segment the foreground object
207 std::vector<bool> foreground_mask = maskForegroundPoints (input, min_depth, max_depth, max_height);
208
209 // Save the masked template cloud (masking with NaNs to preserve its organized structure)
210 PointCloudXYZRGBA template_cloud (*input);
211 for (std::size_t i = 0; i < foreground_mask.size (); ++i)
212 {
213 if (!foreground_mask[i])
214 {
215 pcl::PointXYZRGBA & p = template_cloud[i];
216 p.x = p.y = p.z = std::numeric_limits<float>::quiet_NaN ();
217 }
218 }
219 pcl::io::savePCDFile (template_pcd_filename, template_cloud);
220
221 // Create a LINEMOD template
222 pcl::LINEMOD linemod;
223 trainTemplate (input, foreground_mask, linemod);
224
225 // Save the LINEMOD template
226 linemod.saveTemplates (template_sqmmt_filename.c_str());
227}
228
229/* ---[ */
230int

Callers 1

mainFunction · 0.70

Calls 5

maskForegroundPointsFunction · 0.85
savePCDFileFunction · 0.85
trainTemplateFunction · 0.85
saveTemplatesMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected