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

Method load

apps/in_hand_scanner/src/offline_integration.cpp:250–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248////////////////////////////////////////////////////////////////////////////////
249
250bool
251pcl::ihs::OfflineIntegration::load(const std::string& filename,
252 CloudXYZRGBNormalPtr& cloud,
253 Eigen::Matrix4f& T) const
254{
255 if (!cloud) {
256 cloud = CloudXYZRGBNormalPtr(new CloudXYZRGBNormal());
257 }
258
259 // Load the cloud.
260 CloudXYZRGBAPtr cloud_input(new CloudXYZRGBA());
261
262 pcl::PCDReader reader;
263 if (reader.read(filename, *cloud_input) < 0) {
264 std::cerr << "ERROR in offline_integration.cpp: Could not read the pcd file.\n";
265 return (false);
266 }
267
268 // Normal estimation.
269 normal_estimation_->setInputCloud(cloud_input);
270 normal_estimation_->compute(*cloud);
271
272 pcl::copyPointCloud(*cloud_input, *cloud);
273
274 // Change the file extension of the file.
275 // Load the transformation.
276 std::string fn_transform = filename;
277
278 std::size_t pos = fn_transform.find_last_of('.');
279 if (pos == std::string::npos || pos == (fn_transform.size() - 1)) {
280 std::cerr << "ERROR in offline_integration.cpp: No file extension\n";
281 return (false);
282 }
283
284 fn_transform.replace(pos, std::string::npos, ".transform");
285
286 if (!this->loadTransform(fn_transform, T)) {
287 std::cerr
288 << "ERROR in offline_integration.cpp: Could not load the transformation.\n";
289 return (false);
290 }
291
292 return (true);
293}
294
295////////////////////////////////////////////////////////////////////////////////
296

Callers 1

computationThreadMethod · 0.95

Calls 6

loadTransformMethod · 0.95
copyPointCloudFunction · 0.85
readMethod · 0.45
setInputCloudMethod · 0.45
computeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected