PointCloud-pipeline icon indicating copy to clipboard operation
PointCloud-pipeline copied to clipboard

Segmentation fault with createFromPointCloud

Open wassryan opened this issue 4 years ago • 9 comments

I met the same problem as you mentioned in the github of PointCloudLibrary/pcl, a problem that throws segmentation fault at range_image.createFromPointCloud, when I want to get range image from pcd file using createFromPointCloud. How did you solve the problem? And I notice that you use the .bin file instead of pcd file? does this matter? @tcxxxx

wassryan avatar Oct 12 '19 13:10 wassryan

I met the same problem as you mentioned in the github of PointCloudLibrary/pcl, a problem that throws segmentation fault at range_image.createFromPointCloud, when I want to get range image from pcd file using createFromPointCloud. How did you solve the problem? And I notice that you use the .bin file instead of pcd file? does this matter? @tcxxxx

Hi, could you post here or send me ([email protected]) in person the piece of code that throws the error? Thanks!

In terms of whether it is an issue of using .bin or .pcd, my first thought is that as long as you create the Point Cloud class instance correctly with the data, that shouldn't be a problem.

tcxxxx avatar Oct 12 '19 14:10 tcxxxx

I met the same problem as you mentioned in the github of PointCloudLibrary/pcl, a problem that throws segmentation fault at range_image.createFromPointCloud, when I want to get range image from pcd file using createFromPointCloud. How did you solve the problem? And I notice that you use the .bin file instead of pcd file? does this matter? @tcxxxx

I encountered the same problem when I tried to call createFromPointCloud, how can I solve it?

Shang-cl avatar Sep 14 '21 09:09 Shang-cl

Hi @LoveStorys, 
 I didn’t see this issue when I ran the code, but I have two guesses maybe you can try. Also it would be great if you could post your point cloud for me to reproduce the error.

  1. Can you verify that there are no illegal points in the created PointCloud? Like nan values.
  2. Can you try to tune the parameters for “range_image.createFromPointCloud” if you use a point cloud significantly different from KITTI? 
 Best regards, Boyuan Tian

Boyuan-Tian avatar Sep 15 '21 18:09 Boyuan-Tian

Hi @LoveStorys, 
 I didn’t see this issue when I ran the code, but I have two guesses maybe you can try. Also it would be great if you could post your point cloud for me to reproduce the error.

1. Can you verify that there are no illegal points in the created PointCloud? Like nan values.

2. Can you try to tune the parameters for “range_image.createFromPointCloud” if you use a point cloud significantly different from KITTI?
   
   
   Best regards,
   Boyuan Tian

Thank you very much for your reply. The point cloud I used was generated after getting the depth image with my own depth camera, so I think your first suggestion is very good, and I will try it. In addition, I have another very puzzled question. My camera is an RGB-D depth camera. When I collect images, I can get RGB images and Depth images at the same time. The Depth image is saved in Mat type 16UC1, I think Do you know that I can directly convert Mat type images to RangeImage type? Because I think that converting from a depth image to a point cloud and then to a depth image again seems to be a waste of effort, and my RangeImage image is only used for the input of the subsequent NARF algorithm, thank you again for your reply!

Shang-cl avatar Sep 16 '21 01:09 Shang-cl

Hi @LoveStorys,

Your intuition makes sense.

Generally, a range image contains distances of points to a specific viewpoint, while distances in a depth image are relative to a plane (e.g., focal point vs. focal plane).

Those two images will look very close but not equivalent. I believe the NARF algorithm also works on depth images since they fundamentally carry the relative distances between points.

FYI, this link shows an example to estimate NARF key points from depth images.

Best regards, Boyuan Tian

Boyuan-Tian avatar Sep 16 '21 03:09 Boyuan-Tian

Hi @LoveStorys,

Your intuition makes sense.

Generally, a range image contains distances of points to a specific viewpoint, while distances in a depth image are relative to a plane (e.g., focal point vs. focal plane).

Those two images will look very close but not equivalent. I believe the NARF algorithm also works on depth images since they fundamentally carry the relative distances between points.

FYI, this link shows an example to estimate NARF key points from depth images.

Best regards, Boyuan Tian

Thank you again for your reply. I have tested the program you linked to. It generates a depth image directly from a random 3D point cloud, but the result is still the same, so I am now very familiar with the PCL I installed and the system environment. I doubt it. Besides, what should I do if I want to directly input the Depth depth image as the RangeImage of the NARF algorithm? The depth image type accepted by the algorithm is RangeImage type, but my depth image is Mat type, how can I convert it? thanks

Shang-cl avatar Sep 16 '21 07:09 Shang-cl

Hi @LoveStorys, Your intuition makes sense. Generally, a range image contains distances of points to a specific viewpoint, while distances in a depth image are relative to a plane (e.g., focal point vs. focal plane). Those two images will look very close but not equivalent. I believe the NARF algorithm also works on depth images since they fundamentally carry the relative distances between points. FYI, this link shows an example to estimate NARF key points from depth images. Best regards, Boyuan Tian

Thank you again for your reply. I have tested the program you linked to. It generates a depth image directly from a random 3D point cloud, but the result is still the same, so I am now very familiar with the PCL I installed and the system environment. I doubt it. Besides, what should I do if I want to directly input the Depth depth image as the RangeImage of the NARF algorithm? The depth image type accepted by the algorithm is RangeImage type, but my depth image is Mat type, how can I convert it? thanks

Shang-cl avatar Sep 17 '21 09:09 Shang-cl

Hi @LoveStorys, Your intuition makes sense. Generally, a range image contains distances of points to a specific viewpoint, while distances in a depth image are relative to a plane (e.g., focal point vs. focal plane). Those two images will look very close but not equivalent. I believe the NARF algorithm also works on depth images since they fundamentally carry the relative distances between points. FYI, this link shows an example to estimate NARF key points from depth images. Best regards, Boyuan Tian

Thank you again for your reply. I have tested the program you linked to. It generates a depth image directly from a random 3D point cloud, but the result is still the same, so I am now very familiar with the PCL I installed and the system environment. I doubt it. Besides, what should I do if I want to directly input the Depth depth image as the RangeImage of the NARF algorithm? The depth image type accepted by the algorithm is RangeImage type, but my depth image is Mat type, how can I convert it? thanks

Hello, after my constant testing, it is now available. I reinstalled Opencv, VTK, PCL, and then used cmake to compile and test the official routines. The output results are completely correct, but when I build the same project on QtCreator, the same problem still occurs. I think it’s because of QtCreator. The reason for the use of qmake. Thanks again for your answers!

Shang-cl avatar Sep 17 '21 12:09 Shang-cl

Hi @LoveStorys ,

I don’t fully understand your situation now regarding the “problem” you are referring to, but I am glad to hear that you have a hypothesis.

If you still encounter the segfault error and think posting the code and data for me to debug would be helpful, please feel free to do so.

Best regards, Boyuan Tian

Boyuan-Tian avatar Sep 19 '21 00:09 Boyuan-Tian