pyntcloud
pyntcloud copied to clipboard
Voxel Grid: ValueError: Number of samples, -9223372036854775807, must be non-negative.
The bug
I am trying to create a voxel grid from point clouds. I have created the instance of cloud succesfully.
cloud = PyntCloud(pd.DataFrame(data=temp_01, columns=["x", "y", "z"]))
Also, I have verfied with this two commands:
print((cloud.points.min(0)))
print((cloud.points.max(0)))
and the output is:
x -275.906379 y -450.160817 z 324.000000 dtype: float64 x 509.850140 y 175.125465 z 1139.000000 dtype: float64
Next step is add structure by this line:
voxelGridId = cloud.add_structure("voxelgrid", size_x=1/256, size_y=1/256, size_z=1/256, regular_bounding_box=True)
And here I got this error while calling the function compute()
ValueError: Number of samples, -9223372036854775807, must be non-negative.
I accessed the voxel grid class file .I have tried to trace to find the error by adding prints. I add print in the compute function after obtaining the xyzmin and xyzmax of the points as shown in the photo:
The output of the print is supposed to be like the above values but it was having a NaN values instead of the z points but the min and max of x and y are the same as shown:
xyzmin: [-275.90637873 -450.16081664 nan], [509.85014009 175.12546505 nan] It is very strange for me and I couldn't trace more than this.
If you can fix this bug as soon as you can, it will be highly appreciated as I am blocked and I have a deadline during the next week.
Thanks
Can you share the data?