rangeImage is always empty when using createFromPointCloud()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

rangeImage is always empty when using createFromPointCloud()

Hi there!

I want to convert an unorganized point cloud to a rangeImage. I've basically followed the tutorial ( http://pointclouds.org/documentation/tutorials/range_image_creation.php ). If I use the exact code from the tutorial or when i read in my own point cloud, the result is the same. All ZERO.

There are no compiler or run-time problems / crashes, but when I output the point cloud information (e.g. cout the width and height and size, everything is zero.

Can someone shed some light on it please?

Also, how can i visualize and save the rangeImage?
For saving I have tried pcl::io::savePNGFile() but it  fails of course as there is no data inside the rangeImage. But would that be the way to do it?


Reply | Threaded
Open this post in threaded view

Re: rangeImage is always empty when using createFromPointCloud()

This post was updated on .
So I found this tutorial now: http://pointclouds.org/documentation/tutorials/range_image_visualization.php

and following it, I can see that it works, principally at least. The resulting rangeImage is, however, only 10 x 11 pixels large or 15 x 12, depending how I vary the angularResulution. Here is a screenshot...

However, It appears that the output image renders the rangeImage from the default position of the pcl_viewer. When I press "c" to get the camera parameters of the viewer i get these values:

Clipping plane [near,far] 73.2078, 118.489
Focal point [x,y,z] 56.431, 29.711, 15.6045  
Position [x,y,z] 56.431, 29.711, 108.759  // lets call this p0
View up [x,y,z] 0, 1, 0                             // lets call this view0
Camera view angle [degrees] 49.1311

here is the default view. Its a top-down view which for a plane / facade is not very useful.

however, i would need a generated image from this point of view, a front-view.

Clipping plane [near,far] 0.131234, 131.234
Focal point [x,y,z] 58.3524, 31.0412, 15.0909
Position [x,y,z] 83.5202, -4.28648, 17.7529      // lets cal lthis p1
View up [x,y,z] -0.0197777, 0.0611065, 0.997935   // lets call this view1
Camera view angle [degrees] 49.1311

Is there a way to get this done automatically?
I suppose I can rotate the point cloud into this position by multiplying it with a rotation matrix. But how do I get this matrix?
Do I have to translate the point cloud first using: t_vec = p1-p0 ?
And then I would need to rotate it by R = ?? .  How would I get a proper R here using view0 and view1? Do I need to SLERP those two vectors to obtain the difference of rotationVectors and then construct the proper R from this?