zgojcic/3DSmoothNet

LRF/SDV computation returning all zeros

Closed this issue · 3 comments

Hi,

I'm attempting to generate the LRF/SDV values from a .ply file (saved from open3d) and I'm receiving all zeros in the output .csv file. There were no errors in the output of ./3DSmoothNet:

File: ./datums/temp/target.ply
Number of Points: 3788
Size of the voxel grid: 0.3
Number of Voxels: 16
Smoothing Kernel: 1.75
Number of keypoints:3788

Starting SDV computation!
8 threads will be used!!
Saving Features to a CSV file:
./datums/temp/sdv/target.ply_0.150000_16_1.750000.csv

---------------------------------------------------------
LRF computation took 1080 miliseconds
SDV computation took 2427 miliseconds
---------------------------------------------------------

I then load the resultant .csv file and print out some stats related to it. As you can see, there are no non-zero values in the loaded numpy data:

evaluation_features = np.fromfile(fp, dtype=np.float32).reshape(-1, 4096)
print(evaluation_features.shape)
print(np.where(evaluation_features != 0.0))
print(evaluation_features)

(3788, 4096)
(array([], dtype=int64), array([], dtype=int64))
[[0. 0. 0. ... 0. 0. 0.]
 [0. 0. 0. ... 0. 0. 0.]
 [0. 0. 0. ... 0. 0. 0.]
 ...
 [0. 0. 0. ... 0. 0. 0.]
 [0. 0. 0. ... 0. 0. 0.]
 [0. 0. 0. ... 0. 0. 0.]]

I have tried a variety of -r, -h & -n parameters, but with no effect. Is there anything I should keep in mind or anything to look out for when trying to generate LRF/SDV values for a point cloud?

Hello, I run to the same problem, have you solved it? @DustinReagan

Hey, I solved this problem by encoding my .ply file in ascii instead of binary and removing the color information. @DustinReagan
I am not sure which one do the trick.

The issue might be caused by:

  1. Open3D saves XYZ as double, but PCL assumes float. Thus in main.cpp PLY might not read the ply file correctly.
  2. Also in main.cpp (link) PCL reads the point cloud as pcl::PointXYZ, thus if your ply file has other properties, PCL may not read it correctly. I'm not 100% sure about this one though.

Cheers!