Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Converting Mat of point cloud mesh to vector<cv::point3d>

My task is to project a point cloud of a scene to a plane image. I have 3D point cloud of scene represented as PLY mesh. I have found a way to project point cloud to image here. So far I load PLY model to cv::Mat using function loadPLYSimple from ppf_match_3d.

Mat scene_mat = loadPLYSimple("a_cloud.ply", 1);

I need to convert Mat representing the scene clout to vector<cv::point3d>. My Mat has size: [6 x 180768]. How I can do it?

Converting Mat of point cloud mesh to vector<cv::point3d>

My task is to project a point cloud of a scene to a plane image. I have 3D point cloud of scene represented as PLY mesh. mesh. Here is header an d few data lines in this PLY file:

ply
format ascii 1.0
comment PCL generated
element vertex 180768
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 curvature
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
end_header
0.021613657 0.60601699 -1.5027865 120 89 71 -0.92790836 -0.26353598 0.26369458 0.00016434079
-1.1746287 -1.7522405 -1.4859273 193 128 72 0.093781963 -0.043701902 0.99463314 0.048953384

I have found a way to project point cloud to image here. So far I load PLY model to cv::Mat using function loadPLYSimple from ppf_match_3d.

Mat scene_mat = loadPLYSimple("a_cloud.ply", 1);

I need to convert Mat representing the scene clout to vector<cv::point3d>. My Mat scene_mat has size: [6 x 180768]. How I can do it?