A New K Nearest Neighbours Algorithm Using Cell Grids for 3D Scattered Point Cloud

Jianhui Zhao, Chengjiang Long, Shuping Xiong, Cheng Liu, Zhiyong YuanElektronika 2014

Abstract

In this paper, we propose one novel and efficient K nearest neighbours search algorithm based on 3D uniform cell grids. First, a simple min-max box is used to store all the points and a twice division strategy is adopted to determine the edge length of basic grids. Then we limit the search space for each grid with certain query points to control the amount of distance calculations under a suitable level. And the computational cost of sorting operations is reduced effectively through avoiding the unnecessary calculations, with the help of properly determined subspaces and sphere spaces for points. Compared with existing related algorithms, our method can search for the K nearest neighbours accurately and quickly, and it has many possible applications in the fields using 3D scattered point clouds.

Introduction

In fields like virtual reality, reverse engineering, and geometric modeling, 3D objects are often represented as "point clouds"—massive collections of $(x, y, z)$ coordinates. To derive meaningful information from this data, such as surface normals or curvature, algorithms must efficiently find the $K$ closest points to any given query point.

While classic structures like K-d trees, Octrees, and Voronoi diagrams are widely used, they can become computationally expensive as point clouds grow into the millions. The primary bottleneck in these systems is often not the distance calculation itself, but the sorting required to identify the top $K$ candidates. This paper introduces a high-efficiency K-Nearest Neighbours (KNN) search algorithm that utilizes a "twice-division" uniform grid strategy and geometric pruning to minimize expensive sorting operations.

Methodology

The proposed algorithm employs a multi-stage approach to structure data and optimize the search process.

Twice Division Strategy

The algorithm begins by creating a bounding box and a preliminary grid based on the total number of points. It then calculates the actual density of non-empty cells. Using an adjustment parameter ($\alpha$), the grid edge length ($L$) is refined to better suit the local distribution of the data. This density-aware gridding acts as a lightweight way to adapt the grid size without the complexity of a fully hierarchical structure like an Octree.

Defining Search Spaces and the Sorting Shortcut

The core innovation lies in how the search space is limited around a query point. The algorithm expands outward from a point's home cell to find a region called the "Ultimate Space" ($S_{ultimate}$), guaranteed to contain at least $K$ neighbors. Within this space, two spheres are defined: an internal sphere ($S_{insphere}$) and an external sphere ($S_{outsphere}$).

Geometric definition of search spaces including internal and external spheres.

The algorithm leverages these spaces to bypass sorting:

  1. If the number of points in the internal sphere is $\le K$, all those points are automatically neighbors. The algorithm then only needs to sort the remaining candidates found in the "shell" between the internal and external spheres to fill the remaining slots.
  2. If the internal sphere already contains $> K$ points, the search is strictly confined and sorted within that smaller sphere.

By performing a few extra distance checks to categorize points into these spheres, the algorithm drastically reduces the number of points that actually need to be sorted. Additionally, since multiple points often reside in the same grid cell, the "Ultimate Space" is calculated once per cell and reused, avoiding redundant spatial expansions.

Evaluation and Results

The algorithm was evaluated using several standard 3D models, including the Stanford Bunny (35,947 points), Foot (10,016 points), and Teeth (117,871 points).

The Stanford Bunny model and localized K-NN search results on its surface.

In head-to-head tests against Bentley’s K-d tree and Sankaranarayanan’s method, the proposed algorithm consistently showed the lowest total execution time across all models. While the algorithm performs more distance calculations than some competitors, it more than makes up for it by reducing the time spent on sorting. Accuracy was verified by ensuring the algorithm correctly identifies neighbors even in difficult areas, such as sharp ridges or isolated outliers.

The parameter $\alpha$ was found to be most effective between 0.22 and 0.30, providing the best balance between grid overhead and sorting efficiency.

Conclusion

The grid-and-sphere approach offers a significant speed advantage for 3D point cloud processing by prioritizing sorting reduction. However, the efficiency relies on the adjustment parameter $\alpha$, and the 3D grid structure can be memory-intensive in sparse environments. Future work may explore how this approach scales to higher-dimensional feature spaces common in machine learning.

Summary updated

BibTeX
@inproceedings{zhao2014new,
  author = {Jianhui Zhao and Chengjiang Long and Shuping Xiong and Cheng Liu and Zhiyong Yuan},
  title = {{A New K Nearest Neighbours Algorithm Using Cell Grids for 3D Scattered Point Cloud}},
  booktitle = {Elektronika},
  year = {2014},
  doi = {10.5755/j01.eee.20.1.3926},
}
Figure