Skip to main content

Generate orthographic projections from a Point Cloud.

Project description

Orthographic Projector

A Rust-based Python library for generating cubic orthographic projections from point clouds.

Prerequisites

  • Python 3.10 or later
  • rustc 1.77.2 or later
  • pip

Setup

From PyPI

pip install orthographic-projector
# or
python -m pip install orthographic-projector

From source

# Clone this repository
https://github.com/akaTsunemori/orthographic_projector.git

# cd into the project folder
cd orthographic_projector

# Setup and activate the conda environment
conda env create -f environment.yml
conda activate orthographic-projector

# Compile the project into a python module using maturin
maturin develop -r

Usage

import cv2
import numpy as np
import open3d as o3d
import orthographic_projector
import time


def save_projections(projections):
    for i in range(len(projections)):
        image = projections[i].astype(np.uint8)
        image_bgr = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
        cv2.imwrite(f"projection_{i}.png", image_bgr)


# Load the point cloud through open3d
PC_PATH = "./examples/redandblack_vox10_1550.ply"
pc = o3d.io.read_point_cloud(PC_PATH)
points, colors = np.asarray(pc.points), np.asarray(pc.colors)

# orthographic_projector parameters
precision = 10
filtering = 2
crop = True
save = True

t0 = time.time()
# The generate_projections function can be used for generating the projections
images, ocp_maps = orthographic_projector.generate_projections(
    points, colors, precision, filtering
)
# The crop parameter could optionally be passed to the generate_projections function,
# but it can also be called after the generation process
if crop:
    images, ocp_maps = orthographic_projector.apply_cropping(images, ocp_maps)
t1 = time.time()
print(f"Done. Time taken: {(t1-t0):.2f} s")

# The save_projections function is just an example intended for visualization of the results
if save:
    save_projections(images)

This example is also available in the examples/example_generate_projections.py folder.

Results

These are the generated projections to be expected from the provided example.

Spoiler Projection 1 Projection 2 Projection 3 Projection 4 Projection 5 Projection 6

References

  • Orthographic projector

    [1] A. Javaheri, C. Brites, F. Pereira, and J. Ascenso, “Joint geometry and color projection-based point cloud quality metric,” IEEE Access, vol. 10, pp. 90 481–90 497, 2022.

  • Source for the example point cloud

    [3] E. Alexiou, I. Viola, T. M. Borges, T. A. Fonseca, R. L. De Queiroz, and T. Ebrahimi, “A comprehensive study of the rate-distortion performance in mpeg point cloud compression,” APSIPA Transactions on Signal and Information Processing, vol. 8, 2019

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated, you can simply open an issue.

License

MIT License


GitHub @akaTsunemori

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.

orthographic_projector-0.2.1-cp312-cp312-win_amd64.whl (163.4 kB view details)

Uploaded CPython 3.12Windows x86-64

orthographic_projector-0.2.1-cp312-cp312-win32.whl (154.7 kB view details)

Uploaded CPython 3.12Windows x86

orthographic_projector-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

orthographic_projector-0.2.1-cp312-cp312-macosx_11_0_arm64.whl (266.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

orthographic_projector-0.2.1-cp311-cp311-win_amd64.whl (163.2 kB view details)

Uploaded CPython 3.11Windows x86-64

orthographic_projector-0.2.1-cp311-cp311-win32.whl (154.9 kB view details)

Uploaded CPython 3.11Windows x86

orthographic_projector-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

orthographic_projector-0.2.1-cp311-cp311-macosx_11_0_arm64.whl (271.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

orthographic_projector-0.2.1-cp310-cp310-win_amd64.whl (163.0 kB view details)

Uploaded CPython 3.10Windows x86-64

orthographic_projector-0.2.1-cp310-cp310-win32.whl (154.9 kB view details)

Uploaded CPython 3.10Windows x86

orthographic_projector-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

orthographic_projector-0.2.1-cp310-cp310-macosx_11_0_arm64.whl (270.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file orthographic_projector-0.2.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2d2ee0b140fe2aee46340c7c619a87c36ea5fc6e96728953c56954c8abdf4554
MD5 da4ccc16c45db5fa3d1a9c7e6576080b
BLAKE2b-256 5c1a18cc49d5ceb68fbb0f5a52e017255a9b6c3b9aa127bce2a47ace2583e6b2

See more details on using hashes here.

File details

Details for the file orthographic_projector-0.2.1-cp312-cp312-win32.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 260e01601fb457a794c631e6f1171e138e3f38de06eb97c1a7ab0fce7bb28c01
MD5 3db6f8e5b734f0ca6767bfe997f10cbb
BLAKE2b-256 891db9dc9a2323402b475eb71985c72fd3ce282468d789d2c5f959a67c920c91

See more details on using hashes here.

File details

Details for the file orthographic_projector-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 663a29c7a9d3d6af2655cfed1d72b0be73bda3fd9cf0b4925a89d53b8dab6cbc
MD5 661429ea5c9e98d288296386415c08af
BLAKE2b-256 ad027c01ec65b56404003cfd53d55584eb3aaa1a1812b7bad82d137dac2aa8c2

See more details on using hashes here.

File details

Details for the file orthographic_projector-0.2.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dc236ef07a05d52023927f33c80b89966a1f21f565abf0b82bc8f4fcc8fa1e27
MD5 33ea26f387b9e8385b4489eb54f916d5
BLAKE2b-256 287eb6defd3873305f43346399ebbfe90a5325a390988dc39fea1ce31de2bb0d

See more details on using hashes here.

File details

Details for the file orthographic_projector-0.2.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d5fd1916f11b0483809ad3b5f9115f43fc04a32a414173425c740720758d4472
MD5 3562e4bf4b52eaf5575868531676075b
BLAKE2b-256 bf765b3535d7933b8550d43d534210978fffc36e2ab9b3f39033b4a5d3178689

See more details on using hashes here.

File details

Details for the file orthographic_projector-0.2.1-cp311-cp311-win32.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 bf8c8a809a37a2a93e7f8dfde3bf1e84b5482c0779e74d771802480d548d7bf0
MD5 4d705d33e6ba507dce9bf60fec8e7a42
BLAKE2b-256 1a17928a5f01abd2d1ae609187acac65873a0ab12df71b76cf468950dfbecdc0

See more details on using hashes here.

File details

Details for the file orthographic_projector-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ab86358cb429ac5922ea5d49527089598c53103ff20d64a212004a27cc5e882
MD5 ffaa9e1155a3b15cfe38c75e51d08df3
BLAKE2b-256 a47305511c9ad9dd9c46595f8be27bedf0400bf0b794e431eaf821f98217a9d3

See more details on using hashes here.

File details

Details for the file orthographic_projector-0.2.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8b85ce86c89854eada875aef18a1ebcce55a60633b2517b565077fd675ec12af
MD5 98c1d5775761ce68b7d42c874118f7a8
BLAKE2b-256 f5a03ddae9134b54bf34bb8532e460c6eda9f1442ff7dcabe7bc638a5061d506

See more details on using hashes here.

File details

Details for the file orthographic_projector-0.2.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 220f2ec235d34adc15a98002da1095307330bf085ccc4693c7ac4ec022d8eafc
MD5 674c229312c5d5faf14810800be03f26
BLAKE2b-256 2539b1c2ac8f147a76c0d8af40211935b023b5d5caa9e77551b80757d3bdf34c

See more details on using hashes here.

File details

Details for the file orthographic_projector-0.2.1-cp310-cp310-win32.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 24c21d141f3a5c2450d5a37d4850b9782ca30ad8d23caefe2a5a9ec2675bbd28
MD5 0acd619fdd3c1ef0b2b68150c0745418
BLAKE2b-256 2e6d3493a39d18e486d8b4dc66fdcd10071bea99410bed3159509a325267d354

See more details on using hashes here.

File details

Details for the file orthographic_projector-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e331f6437188d6cdb44c28955332bf2cdf5f837c32d307b449e7d5e28be5c103
MD5 06474a9285fceb51bff16539fc4bcf3b
BLAKE2b-256 2eebdaa23843133e95a623930d2115be7b73e2f1bd66ac86d9bc165cb5e27896

See more details on using hashes here.

File details

Details for the file orthographic_projector-0.2.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for orthographic_projector-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00dda19da5057e9cfb958b0774aed9114851315795d1e8d6ad8436592d845e79
MD5 0aecca9015cd88eced6b823f029f8536
BLAKE2b-256 c0d402ce3840180333e3c1f9982b45ca559761378dd241161e225eb953d13268

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