octree-nn / ocnn-pytorch

Octree-based Sparse Convolutional Neural Networks
MIT License
150 stars 16 forks source link

Issue with Consistent Octree points Data for Identical Point Cloud Inputs #35

Closed kankanzheli closed 4 months ago

kankanzheli commented 4 months ago

Hello,

I am currently working on a project that involves merging multiple octrees to create a complete map. I am encountering an issue with the consistency of the points data in the octree and would appreciate some guidance.

Problem Description I initially believed that the points data in the octree referred to the center coordinates of the occupied nodes. To ensure consistent space partitioning in the world coordinate system across different octrees, I implemented the following steps:

Filtered point cloud data within a specified bounded space in the world coordinate system. Added boundary extreme points to the point cloud data to ensure that the octree partitions the same space. I expected that with identical point cloud data inputs, the center coordinates of the nodes in the octree (points data) would be consistent. However, I observed that even with manually input identical point cloud data, the points data from the octree differ each time.

Steps to Reproduce Filter point cloud data within a bounded space. Add boundary extreme points to the point cloud data. Generate octrees from the identical point cloud data inputs. Observations Despite using identical point cloud data, the points data from the octree are not consistent across different runs.

Questions Is my understanding of the points data in the octree correct? Does it represent the center coordinates of the occupied nodes? Is there a flaw in my approach to ensuring consistent space partitioning across different octrees? How can I achieve consistent points data for identical point cloud inputs in the octree? Thank you for your assistance.

wang-ps commented 4 months ago

Sorry, I can not fully understand the issue. The process of building an octree is deterministic. The octree is the same if the same point cloud is provided. I suggest checking the normalization of the point cloud to see whether the normalization factor is different across runs.

kankanzheli commented 4 months ago

To clarify, I have configured a voxel model to encapsulate point cloud data, defining its structure based on a set depth and adhering to the overall spatial dimensions of the point cloud. This setup is intended to ensure that each voxel represents a specific volume within the total space. For example, with a depth of 7, the world is divided in to (2depth)3 voxel space. And my voxel model indicates that there are 457 occupied voxel nodes for a particular point cloud.  However, when I store the same point cloud data using OCNN's octree functions (depth = 7), and retrieve the data using x, y, z, b = octree_total.xyzb, the octree reports only 143 data points. Both the voxel model and the octree are configured to have the same spatial dimensions and are cubic in shape.  Given that the spatial division is identical in both models, shouldn't the number of points output by the octree be consistent with the number of occupied voxels in the voxel model? Could you please help me understand why there might be such a significant difference in the outputs? Are there any particular configurations or aspects of the OCNN implementation that could explain this discrepancy?