daavoo / daavoo/pyntcloud

Voxel Grid: ValueError: Number of samples, -9223372036854775807, must be non-negative.

Open
#237 1 comment 0 reactions 1 assignee Claimed by @daavoo View on GitHub
Bug
Dominant language
Python
Stars
1.5k
Forks
229
PR merge metrics
No merged PRs in 30d

Description

**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:
![image](https://user-images.githubusercontent.com/23384075/53278394-37170680-3709-11e9-94e1-b61224c741b3.png)
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.