kzampog / cilantro

A lean C++ library for working with point cloud data
MIT License
1.01k stars 206 forks source link

transform rgbd image to point cloud #57

Open benchun123 opened 3 years ago

benchun123 commented 3 years ago

Hi,

Thanks for the work, I try to use this library but meet some problem, I will appreciate if you can give me some suggestions:

1, I test the ransac plane estimation function with my own point cloud files (.ply) as following. I want to know if the function works, because it finds the 158492 out of 258733 points that belongs to a plane, the problems maybe the visualization. the original point clouds are shown in other format as fig 2. I also check the header of two files (.ply) image image test.ply format binary_little_endian 1.0 element vertex 573663 property float x property float y property float z property uchar red property uchar green property uchar blue property float nx property float ny property float nz property float radius

0000_pcl.ply format binary_little_endian 1.0 comment PCL generated element vertex 258733 property float x property float y property float z property uchar red property uchar green property uchar blue element camera 1 property float view_px property float view_py property float view_pz property float x_axisx property float x_axisy property float x_axisz property float y_axisx property float y_axisy property float y_axisz property float z_axisx property float z_axisy property float z_axisz property float focal property float scalex property float scaley property float centerx property float centery property int viewportx property int viewporty property float k1 property float k2

  1. it seems different, so I also try to load original rgbd images and want to converse to points cloud, when I just change the uri, I met the error with running, the second element of uri can not find the files...

Warning: Video Channels have unequal number of files terminate called after throwing an instance of 'pangolin::VideoException' what(): No files found for wildcard ' /path/data/depthimgs/depth*.png' Aborted (core dumped)

3, I also try to split the uri try to load them in respectively, load the rgb image firstly, and use following code to load depth image: // std::string uri2 = "/path/data/depthimgs/depth.png"; // std::unique_ptr dok2 = pangolin::OpenVideo(uri2); // unsigned char img2 = new unsigned char[dok2->SizeBytes()]; // pangolin::Image depth_img((unsigned short )img2, w, h, wsizeof(unsigned short)); it works but the result can not read the depth image, Is there anything I do wrong? image

Thanks for your time and suggestions. Best regards, Benchun