Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to plot Grid cell distance from the sensor vs. logarithmically spaced mean number of points per grid cell #14

Open
chowkamlee81 opened this issue Jun 21, 2020 · 3 comments

Comments

@chowkamlee81
Copy link

How to plot the graph of

Grid cell distance from the sensor vs. logarithmically spaced mean number of points per grid cell

Kindly help and give pointers

@chowkamlee81
Copy link
Author

@YangZhang4065 @edwardzhou130 Kindly help on this. Do the needful

@edwardzhou130
Copy link
Owner

Hi @chowkamlee81,

You can use grid_ind, which gives you the index of the assigned voxel for each point,

grid_ind = (np.floor((np.clip(xyz_pol,min_bound,max_bound)-min_bound)/intervals)).astype(np.int)

and voxel_position, which is the position of each voxel.
voxel_position = np.indices(self.grid_size)*intervals.reshape(dim_array) + min_bound.reshape(dim_array)

Doing the reverse to count the number of points in each voxel and averaging the number of occurrences for voxels in the same distance, you will get the graph.

@torchlidar
Copy link

torchlidar commented Jul 30, 2020

Hi @chowkamlee81,

You can use grid_ind, which gives you the index of the assigned voxel for each point,

grid_ind = (np.floor((np.clip(xyz_pol,min_bound,max_bound)-min_bound)/intervals)).astype(np.int)

and voxel_position, which is the position of each voxel.

voxel_position = np.indices(self.grid_size)*intervals.reshape(dim_array) + min_bound.reshape(dim_array)

Doing the reverse to count the number of points in each voxel and averaging the number of occurrences for voxels in the same distance, you will get the graph.

Plot the grid for distance code doesn't open, does it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants