Skip to main content

Render large point clouds fast using Octrees in Python

Project description

OakTree

Render large point clouds efficiently using Octrees. The library is a C++ module with Python bindings for ease of use.

Quick Demo

Create an Octree from a Numpy array containing points' xyz positions and RGB intensities.

import numpy as np
from oaktree import Node

# use random points, but could be any Numpy array with shape [N, 3]
points = np.random.uniform(size=(100000, 3))
points_rgb = points.copy() / np.linalg.norm(points_rgb, axis=1, keepdims=True)
points_rgb = (points_rgb + 1) / 2

# create Octree node that allows efficient ray casting
node = Node(max_points_per_node=1000, points=points, points_rgb=points_rgb)

# camera parameters
image_hw = (640, 480)
K = np.array([[300., 0., 320.],
              [0., 300., 240.],
              [0., 0., 1.]], dtype=np.float64)
cam2world = np.array([[0.707, -0.408, -0.577, 2.0],
                      [-0.707, -0.408, -0.577, 2.0], 
                      [0.0, 0.816, -0.577, 2.0],
                      [0.0, 0.0, 0.0, 1.0]], dtype=np.float64)

# render
rgbd = node.render(K=K, cam2world=cam2world, image_hw=image_hw)
rgb = rgbd[..., :3]
depth = rgbd[..., 3]

You can run this and other examples with real datasets with

cd examples
python box.py
python wurzburg.py

Note: examples require extra dependencies including matplotlib, PIL, pandas.

Wurzburg Lecture Hall demo output depth maps:

Installation

Pypi (linux only)

pip install pyoaktree

Build from source

Build dependencies:

  • CXX compiler compatible with C++17
git clone --recursive https://github.com/eduardohenriquearnold/oaktree.git
cd oaktree
pip install .

Unit tests can be executed with

mkdir build
cd build
cmake ..
cmake --build .
ctest
# or, to see results of individual tests
./cpp_test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyoaktree-0.0.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (223.4 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

pyoaktree-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (226.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pyoaktree-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (226.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyoaktree-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (226.6 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

Details for the file pyoaktree-0.0.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyoaktree-0.0.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e72f6a1218114556bc37f907b03ea3460933f1a7ff5da99461e0060cfa31313
MD5 71745658f309e14f1b6312527d63dd4a
BLAKE2b-256 e272b4a06c8242ad3536a83c639fc1dabef8a44cd35e3fa09f81c25a0d897b24

See more details on using hashes here.

File details

Details for the file pyoaktree-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyoaktree-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aafd8dad7e649a01a3a77f748f3618209d88620efcc041e162d8c612f68096c9
MD5 b0da64e897ba9687b97860f32c188155
BLAKE2b-256 3ea842c8cd2fbeb4b6d23e50365271e38ff3ea55fa62899c424a8128bfef0fae

See more details on using hashes here.

File details

Details for the file pyoaktree-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyoaktree-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a016aef7a56172cf7fa757139f2e60f23c0010fa007be508c4b05b8bba579a13
MD5 b12a89e89bed83c1fa7e8d1def1d0e32
BLAKE2b-256 418b3fc74e1f724c14e2e3cc9c6677f34d5e73f6b55a4796090ede68bc4c0f10

See more details on using hashes here.

File details

Details for the file pyoaktree-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyoaktree-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 571a0010a0060055300d4a484c3df8d37e7467d6b76e1eef5d366c732ed48540
MD5 cd0101952aa7f55009033136422e11b6
BLAKE2b-256 8ab549df0e0886b7d29d0b0dea9c2d784e4713012ad910a3c631f6d62f255c62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page