# Towards Efficient Implementation of an Octree for a Large 3D Point Cloud

## Abstract

**:**

## 1. Introduction

## 2. Material and Methods

#### 2.1. Algorithm Development

#### 2.1.1. Implementation of Octree for a 3D Point Cloud

- An axially-aligned minimum bounding hexahedron (hereafter, MBH) is defined to tightly enclose the whole 3D point cloud and assigned to a head node.
- Eight new MBHs are defined by halving the MBH along the x-, y- and z-axes, and are assigned to eight child nodes.
- A child node, of which MBH encloses an input point, is chosen and the input point is passed over a child node in further depth.
- Step 2 and Step 3 are continued until the depth reaches a given threshold value (hereafter, Depth) and the final child node (hereafter, the leaf node) stores the input point.
- Every point in the 3D point cloud is assigned to the head node and undergoes Step 2 to Step 4.

#### 2.1.2. Implementation of File-Based Octree

#### 2.1.3. Implementation of an Anisometric Octree

#### 2.1.4. Implementation of a Semi-Isometric Octree Group

#### 2.2. Application to Real Point Clouds

## 3. Results and Discussion

## 4. Conclusions

## Funding

## Conflicts of Interest

## References

- Balsa Barreiro, J.; Avariento Vicent, J.P.; Lerma García, J.L. Airborne light detection and ranging (LiDAR) point density analysis. Sci. Res. Essays
**2012**, 7, 3010–3019. [Google Scholar] [CrossRef] - Balsa-Barreiro, J.; Lerma, J.L. Empirical study of variation in lidar point density over different land covers. Int. J. Remote Sens.
**2014**, 35, 3372–3383. [Google Scholar] [CrossRef] - Singh, K.K.; Chen, G.; McCarter, J.B.; Meentemeyer, R.K. Effects of LiDAR point density and landscape context on estimates of urban forest biomass. ISPRS J. Photogramm. Remote Sens.
**2015**, 101, 310–322. [Google Scholar] [CrossRef] - Schön, B.; Bertolotto, M.; Laefer, D.F.; Morrish, S. Storage, manipulation, and visualization of LiDAR data. In 3rd ISPRS International Workshop 3D-ARCH 2009; International Society of Photogrammetry and Remote Sensing: Trento, Italy, 2009. [Google Scholar]
- Point Cloud Library (PCL): Module Octree. Available online: http://docs.pointclouds.org/1.8.1/group__octree.html (accessed on 12 October 2018).
- Han, S.; Kim, S.; Hoon Jung, J.; Kim, C.; Yu, K.; Heo, J. Development of a hashing-based data structure for the fast retrieval of 3D terrestrial laser scanned data. Comput. Geosci.
**2012**, 39, 1–10. [Google Scholar] [CrossRef] - Han, S.-H.; Lee, S.-J.; Kim, S.-P.; Kim, C.-J.; Heo, J.; Lee, H.-B. A Comparison of 3D R-tree and Octree to Index Large Point Clouds from a 3D Terrestrial Laser Scanner. J. Korean Soc. Surv. Geod. Photogramm. Cartogr.
**2011**, 29, 39–46. [Google Scholar] [CrossRef] - Woo, H.; Kang, E.; Wang, S.; Lee, K.H. A new segmentation method for point cloud data. Int. J. Mach. Tools Manuf.
**2002**, 42, 167–178. [Google Scholar] [CrossRef] - Schnabel, R.; Wahl, R.; Klein, R. Efficient RANSAC for Point-Cloud Shape Detection. Comput. Graph. Forum
**2007**, 26, 214–226. [Google Scholar] [CrossRef] [Green Version] - Hornung, A.; Wurm, K.M.; Bennewitz, M.; Stachniss, C.; Burgard, W. OctoMap: An efficient probabilistic 3D mapping framework based on octrees. Auton. Robots
**2013**, 34, 189–206. [Google Scholar] [CrossRef] - Schnabel, R.; Klein, R. Octree-based Point-cloud Compression. In 3rd Eurographics/IEEE VGTC Conference on Point-Based Graphics; SPBG’06; Eurographics Association: Aire-la-Ville, Switzerland, 2006; pp. 111–121. [Google Scholar]
- Vo, A.-V.; Truong-Hong, L.; Laefer, D.F.; Bertolotto, M. Octree-based region growing for point cloud segmentation. ISPRS J. Photogramm. Remote Sens.
**2015**, 104, 88–100. [Google Scholar] [CrossRef] - Maréchal, L. Advances in Octree-Based All-Hexahedral Mesh Generation: Handling Sharp Features. In Proceedings of the 18th International Meshing Roundtable; Clark, B.W., Ed.; Springer: Berlin/Heidelberg, Germany, 2009; pp. 65–84. [Google Scholar]
- Wang, M.; Tseng, Y.H. Automatic segmentation of Lidar data into coplanar point clusters using an octree-based split-and-merge algorithm. Photogramm. Eng. Remote Sens.
**2010**, 76, 407–420. [Google Scholar] [CrossRef] - Elseberg, J.; Borrmann, D.; Nüchter, A. One billion points in the cloud – an octree for efficient processing of 3D laser scans. ISPRS J. Photogramm. Remote Sens.
**2013**, 76, 76–88. [Google Scholar] [CrossRef] - Elseberg, J.; Borrmann, D.; Nüchter, A. Efficient processing of large 3D point clouds. In 2011 XXIII International Symposium on Information, Communication and Automation Technologies; IEEE: New York, NY, USA, 2011; pp. 1–7. [Google Scholar]
- Han, S. Design of Memory-Efficient Octree to Query Large 3D Point Cloud. J. Korean Soc. Surv. Geod. Photogramm. Cartogr.
**2013**, 31, 41–48. [Google Scholar] [CrossRef] [Green Version] - Octree. Available online: https://en.wikipedia.org/w/index.php?title=Octree&oldid=853700715 (accessed on 12 October 2018).
- Rabbani Shah, T. Automatic reconstruction of industrial installations: Using point clouds and images. Doctoral Thesis, Delft University of Technology, Delft, The Netherlands, 2006. [Google Scholar]
- k-nearest Neighbors Algorithm. Available online: https://en.wikipedia.org/w/index.php?title=K-nearest_neighbors_algorithm&oldid=860439224 (accessed on 18 October 2018).
- Schall, O.; Belyaev, A.; Seidel, H.-P. Robust Filtering of Noisy Scattered Point Data. In Proceedings of the Second Eurographics/IEEE VGTC Conference on Point-Based Graphics; SPBG’05; Eurographics Association: Aire-la-Ville, Switzerland, 2005; pp. 71–77. [Google Scholar]

**Figure 8.**Comparison of octree groups: (

**a**) an isometric octree group; (

**b**) a semi-isometric octree group.

Data 1 | Data 2 | Data 3 | |
---|---|---|---|

Laser scanner | C10, Leica Geosystems | Scan station 2, Leica Geosystems | ALTM 3070, Optech |

Scanned object | A long tunnel | A short tunnel | An urban area |

Dimension | $\Delta \mathrm{x}=569.16\mathrm{m}$ $\Delta \mathrm{y}=1442.58\mathrm{m}$ $\Delta \mathrm{z}=19.05\mathrm{m}$ | $\Delta \mathrm{x}=56.05\mathrm{m}$ $\Delta \mathrm{y}=25.57\mathrm{m}$ $\Delta \mathrm{z}=11.98\mathrm{m}$ | $\Delta \mathrm{x}=10708.77\mathrm{m}$ $\Delta \mathrm{y}=3380.64\mathrm{m}$ $\Delta \mathrm{z}=290.26\mathrm{m}$ |

Number of points | 300,525,406 | 18,376,726 | 267,490,366 |

Data file size (in double precision float) | 6878 MB | 420 MB | 6122 MB |

Item | Description |
---|---|

CPU | Intel Core i7-6700K @ 4.00 GHz |

RAM | 64.0 GB DDR4 |

SSD | 512 GB |

OS | Windows 7 64 bit |

Coding language | C++, compiled in 64-bit release mode in Visual studio 2017 |

Memory- and File-Based Octree | Semi-Isometric Octree Group | ||||||||
---|---|---|---|---|---|---|---|---|---|

${\mathit{t}}_{\mathit{i}}$ | Ratios | Ratios | No. of octrees | ||||||

x | y | z | x | y | z | x | y | z | |

1 | 29.87 | 59.97 | 1.00 | 1.03 | 1.02 | 1.00 | 29 | 59 | 1 |

2 | 2.13 | 2.07 | 1.00 | 14 | 29 | 1 | |||

3 | 3.32 | 3.16 | 1.00 | 9 | 19 | 1 |

Memory- and File-Based Octree | Semi-Isometric Octree Group | ||||||||
---|---|---|---|---|---|---|---|---|---|

${\mathit{t}}_{\mathit{i}}$ | Ratios | Ratios | No. of octrees | ||||||

x | y | z | x | y | z | x | y | z | |

1 | 4.68 | 2.13 | 1.00 | 1.10 | 1.07 | 1.00 | 4 | 2 | 1 |

2 | 2.34 | 2.13 | 1.00 | 2 | 1 | 1 | |||

3 | 4.68 | 2.13 | 1.00 | 1 | 1 | 1 |

Memory- and File-Based Octree | Semi-Isometric Octree Group | ||||||||
---|---|---|---|---|---|---|---|---|---|

${\mathit{t}}_{\mathit{i}}$ | Ratios | Ratios | No. of octrees | ||||||

x | y | z | x | y | z | x | y | z | |

1 | 36.89 | 11.65 | 1.00 | 1.02 | 1.06 | 1.00 | 36 | 11 | 1 |

2 | 2.05 | 2.33 | 1.00 | 18 | 5 | 1 | |||

3 | 3.07 | 3.88 | 1.00 | 12 | 3 | 1 |

Data 1 | Data 2 | Data 3 | |
---|---|---|---|

Number of sample points (ratio to the whole data) | 3005 (1/100,000) | 3063 (1/6,000) | 2675 (1/100,000) |

Number of retrieved points | 1,735,755 | 1,319,435 | 1,528,718 |

Radius of searching sphere | 5 cm | 5 cm | 5 m |

Memory-Based Octree | File-Based Octree | Semi-Isometric Octree Group $\left({\mathit{t}}_{\mathit{i}}=2\right)$ | |||||||
---|---|---|---|---|---|---|---|---|---|

Depth | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage. (MB) | Construction time (s) | Proximity operation time (s) |

8 | 9500 | 49.30 | 1.62 | 2607 | 51.01 | 290.32 | 3025 | 58.41 | 9.47 |

9 | 9617 | 55.19 | 0.76 | 2725 | 57.03 | 127.02 | 3477 | 66.80 | 4.24 |

10 | 9765 | 61.53 | 0.31 | 2874 | 63.40 | 48.63 | 4784 | 78.56 | 2.45 |

11 | 10065 | 68.92 | 0.19 | 3174 | 70.72 | 22.34 | 8240 | 99.67 | 2.14 |

12 | 10868 | 78.23 | 0.16 | 3978 | 80.03 | 11.25 | |||

13 | 12968 | 91.26 | 0.17 | 6077 | 92.81 | 5.71 |

Memory-Based Octree | File-Based Octree | Semi-Isometric Octree Group $\left({\mathit{t}}_{\mathit{i}}=2\right)$ | |||||||
---|---|---|---|---|---|---|---|---|---|

Depth | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage. (MB) | Construction time (s) | Proximity operation time (s) |

8 | 606 | 3.12 | 0.05 | 185 | 3.26 | 7.66 | 187 | 3.68 | 5.54 |

9 | 625 | 3.65 | 0.05 | 204 | 3.79 | 4.07 | 223 | 4.29 | 2.65 |

10 | 713 | 4.37 | 0.09 | 293 | 4.51 | 2.59 | 364 | 5.15 | 2.20 |

11 | 997 | 5.43 | 0.30 | 576 | 5.52 | 2.59 | |||

12 | 1593 | 7.21 | 1.44 | ||||||

13 | 2491 | 10.06 | 8.27 |

Memory-Based Octree | File-Based Octree | Semi-Isometric Octree Group $\left({\mathit{t}}_{\mathit{i}}=2\right)$ | |||||||
---|---|---|---|---|---|---|---|---|---|

Depth | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage. (MB) | Construction time (s) | Proximity operation time (s) |

8 | 8718 | 44.63 | 0.30 | 2584 | 46.82 | 36.47 | 3370 | 58.70 | 3.46 |

9 | 8890 | 51.47 | 0.14 | 2756 | 53.57 | 11.79 | 5299 | 76.17 | 3.67 |

10 | 9392 | 60.61 | 0.19 | 3258 | 62.68 | 7.24 | |||

11 | 10962 | 74.01 | 0.61 | 4828 | 75.96 | 7.07 | |||

12 | 15048 | 94.72 | 2.64 | ||||||

13 | 22289 | 131.93 | 13.68 |

${\mathit{t}}_{\mathit{i}}=1$ | ${\mathit{t}}_{\mathit{i}}=2$ | ${\mathit{t}}_{\mathit{i}}=3$ | |||||||
---|---|---|---|---|---|---|---|---|---|

Depth | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage. (MB) | Construction time (s) | Proximity operation time (s) |

8 | 3324 | 59.80 | 4.18 | 3025 | 58.41 | 9.47 | 2913 | 57.97 | 12.87 |

9 | 4272 | 69.92 | 2.70 | 3477 | 66.80 | 4.24 | 3242 | 65.47 | 7.29 |

10 | 6912 | 84.83 | 1.98 | 4784 | 78.56 | 2.45 | 4115 | 76.35 | 2.82 |

11 | 8240 | 99.67 | 2.14 | 6515 | 95.63 | 2.36 |

${\mathit{t}}_{\mathit{i}}=1$ | ${\mathit{t}}_{\mathit{i}}=2$ | ${\mathit{t}}_{\mathit{i}}=3$ | |||||||
---|---|---|---|---|---|---|---|---|---|

Depth | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage. (MB) | Construction time (s) | Proximity operation time (s) |

8 | 211 | 3.84 | 2.59 | 187 | 3.68 | 5.54 | 183 | 3.65 | 7.64 |

9 | 301 | 4.60 | 2.08 | 223 | 4.29 | 2.65 | 205 | 4.18 | 4.07 |

10 | 598 | 5.65 | 2.25 | 364 | 5.15 | 2.20 | 292 | 4.91 | 2.60 |

11 | 574 | 5.94 | 2.62 |

${\mathit{t}}_{\mathit{i}}=1$ | ${\mathit{t}}_{\mathit{i}}=2$ | ${\mathit{t}}_{\mathit{i}}=3$ | |||||||
---|---|---|---|---|---|---|---|---|---|

Depth | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage (MB) | Construction time (s) | Proximity operation time (s) | Memory usage. (MB) | Construction time (s) | Proximity operation time (s) |

8 | 4893 | 65.04 | 3.67 | 3370 | 58.70 | 3.46 | 3007 | 56.41 | 4.48 |

9 | 5299 | 76.17 | 3.67 | 4101 | 70.67 | 3.53 | |||

10 | 7289 | 91.43 | 4.15 | ||||||

11 |

© 2018 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Han, S.
Towards Efficient Implementation of an Octree for a Large 3D Point Cloud. *Sensors* **2018**, *18*, 4398.
https://doi.org/10.3390/s18124398

**AMA Style**

Han S.
Towards Efficient Implementation of an Octree for a Large 3D Point Cloud. *Sensors*. 2018; 18(12):4398.
https://doi.org/10.3390/s18124398

**Chicago/Turabian Style**

Han, Soohee.
2018. "Towards Efficient Implementation of an Octree for a Large 3D Point Cloud" *Sensors* 18, no. 12: 4398.
https://doi.org/10.3390/s18124398