Skip to main content

Python realsense align

Project description

realsense-align

pre-commit License: BSD 3-Clause-Clear

Porting librealsense C++ align code to Python C++ extension. Align depth and color image from numpy array without librealsense SDK and rs:frame infrastructure.

Prerequisites

  • Poetry
  • OpenMP

Build

poetry install
poetry build

How to use

See tests/test_align.py for detail.

Run the test code by poetry run pytest tests.

Example

mmwave-capture-std RGB+Depth Video Player

Set up the virtual environment using uv

uv sync
source .venv/bin/activate

Then, run the code to show the RGB+Depth video

python examples/play_depth_video.py path/to/capture_00001

Porting

  • struct Intrinsic
  • Depth to color align
  • Color to depth align

Trade-off

  1. Don't care distortion: See librealsense#1430 for more information.

  2. Don't care extrinsic: Assume the following:

Rotation: [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
Translation: [0, 0, 0]

See src/proc/align.cpp for original implementation, and rs2_extrinsicsStruct Reference for rs2_extrinsics structure.

Links

LICENSE

The Clear BSD License

Copyright (c) 2023 Louie Lu <louielu@cs.unc.edu>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted (subject to the limitations in the disclaimer
below) provided that the following conditions are met:

     * Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimer.

     * Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.

     * Neither the name of the copyright holder nor the names of its
     contributors may be used to endorse or promote products derived from this
     software without specific prior written permission.

NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

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.

realsense_align-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (188.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

realsense_align-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (188.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

realsense_align-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (187.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

realsense_align-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (187.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

Details for the file realsense_align-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for realsense_align-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b12be6f1aed4b5c6d7202a5e6e980e9f8a562433a9c9c16ae807ef9ef923eea8
MD5 bc7278d533c12bf7d1c1b79b242a73c0
BLAKE2b-256 ef2f7cabe4e7f3064541a5bee4cb2652ac56019dc0770f17033fd5d9ad722b1f

See more details on using hashes here.

File details

Details for the file realsense_align-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for realsense_align-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5fc0bf1b380bc57e85b82995cffc48c769bde328c943d423355f47ce69f9cab4
MD5 faa1e14cc6158886814187b339089173
BLAKE2b-256 8c5c3053be81f0fd0a5e91af69e1d4deb81bc3bae2e5c2bc7f636cbd5fc860c7

See more details on using hashes here.

File details

Details for the file realsense_align-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for realsense_align-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e9197cd0819f9a380b4e60e034adf3992e96a46226c32e1bbcb6f648b1cad686
MD5 2c5f5fe014f6ac992d8e2dc9bbe19951
BLAKE2b-256 6bc6fda1d8fdb914d25f98915e92ed29c8798a19b762938fd06140a05ef4a3d7

See more details on using hashes here.

File details

Details for the file realsense_align-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for realsense_align-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6e17ba055bf28b0cf1e2bd7e245370baa84d80fdb39a70674a0cea0c85c2e5c6
MD5 b20de71d8166b3730ad9184d6173febb
BLAKE2b-256 17982d8a8dfc7a93ce6362f2b0be4795d6300cc2147a46aaf2080145aaff9559

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