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

Function main

tools/image_viewer.cpp:46–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44#include <vector>
45
46int
47main (int, char ** argv)
48{
49 pcl::PointCloud<pcl::PointXYZ> xyz;
50 pcl::io::loadPCDFile(argv[1], xyz);
51
52 pcl::visualization::ImageViewer depth_image_viewer_;
53 float* img = new float[xyz.width * xyz.height];
54
55 for (int i = 0; i < static_cast<int> (xyz.size ()); ++i)
56 img[i] = xyz[i].z;
57
58 depth_image_viewer_.showFloatImage (img,
59 xyz.width, xyz.height,
60 std::numeric_limits<float>::min (),
61 // Scale so that the colors look brighter on screen
62 std::numeric_limits<float>::max () / 10,
63 true);
64 depth_image_viewer_.spin ();
65 return (0);
66}

Callers

nothing calls this directly

Calls 6

loadPCDFileFunction · 0.85
showFloatImageMethod · 0.80
minFunction · 0.50
maxFunction · 0.50
sizeMethod · 0.45
spinMethod · 0.45

Tested by

no test coverage detected