Looking for c / c++ library to generate a PointCloud ot an Depth Image / Ranged Map

509 views Asked by At

I am looking a c / c++ library where I can throw in an depth image and a few camera parameters and get a point cloud out it. Does someone know such a library?

Like:

cv::Mat depthImage;
glm::vec3 cameraPosition(x,y,z);
glm::vec3 cameraUpVector(x,y,z);
glm::vec3 cameraViewingDirection,y,z);

float focalLength;
int resolutionX;
int resolutionY;

Pointcloud pcloud = library::pointcloudFromDepthImage(depthImage, cameraPosition,  cameraUpVector, cameraViewingDirection, focalLength, resolutionX, resolutionY);
1

There are 1 answers

0
stupidstudent On BEST ANSWER

Not a library but the pcl (point cloud library) has some handy tools:

pcl_pcd2png --field z --scale auto cart_near.pcd output.png

And image to pointcloud:

pcl_png2pcd

Here is the pcd format for lookup:

http://pointclouds.org/documentation/tutorials/pcd_file_format.php

Important: you need an ordered point cloud. Means you must use in the pcd file: Width: 640 Height: 480

And not Width:307200 #640*480 Height: 1