Skip to content

Adding python example for color/depth alignment using SW device - #13988

Merged
Nir-Az merged 8 commits into
realsenseai:developmentfrom
alexkunin-gh:akunin/python_example
May 8, 2025
Merged

Adding python example for color/depth alignment using SW device#13988
Nir-Az merged 8 commits into
realsenseai:developmentfrom
alexkunin-gh:akunin/python_example

Conversation

@alexkunin-gh

Copy link
Copy Markdown
Contributor

New python example demonstrating usage of SW device for color/depth aligment

Comment thread wrappers/python/examples/align-with-software-device.py Outdated
Comment thread wrappers/python/examples/align-with-software-device.py Outdated
@Nir-Az
Nir-Az requested a review from Copilot May 7, 2025 14:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds a new Python example demonstrating how to use a software device for color/depth alignment with pre-captured images. The changes include updating the README to reference the new example and adding a complete example script that captures, processes, and aligns depth and color frames.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
wrappers/python/examples/readme.md Updated README to include a new section for the alignment example
wrappers/python/examples/align-with-software-device.py New Python example demonstrating color/depth alignment using a SW device

Comment thread wrappers/python/examples/readme.md Outdated
Comment thread wrappers/python/examples/align-with-software-device.py Outdated
Comment thread wrappers/python/examples/align-with-software-device.py Outdated
@alexkunin-gh
alexkunin-gh requested review from Nir-Az and Copilot May 8, 2025 08:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new Python example demonstrating how to align depth to color using a software device, and updates the example index in the README.

  • Added a new example file (align-with-software-device.py) that captures frames and performs alignment using pre-captured images.
  • Updated the README to include a link to the new example.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
wrappers/python/examples/readme.md Updated README with an entry for the new SW device alignment example
wrappers/python/examples/align-with-software-device.py New example file demonstrating depth-to-color alignment using a software device

Comment thread wrappers/python/examples/readme.md Outdated
Comment thread wrappers/python/examples/align-with-software-device.py Outdated
Alex Kunin and others added 2 commits May 8, 2025 11:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@alexkunin-gh
alexkunin-gh requested a review from Copilot May 8, 2025 08:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new Python example that demonstrates how to perform color and depth alignment using a software device. Key changes include:

  • Updating the readme to include the new alignment example.
  • Adding a comprehensive Python script (align-with-software-device.py) that captures frames, creates software frames, and aligns depth to color.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
wrappers/python/examples/readme.md Updated the examples list to include the new stream alignment example.
wrappers/python/examples/align-with-software-device.py New example script implementing color/depth alignment using a software device.
Comments suppressed due to low confidence (1)

wrappers/python/examples/align-with-software-device.py:111

  • The logging module is used to log errors but is not imported. Add 'import logging' near the top of the file to prevent a NameError.
except Exception as e:
    logging.error("An error occurred: %s", e, exc_info=True)

Comment thread wrappers/python/examples/readme.md Outdated
Comment thread wrappers/python/examples/align-with-software-device.py
@Nir-Az

Nir-Az commented May 8, 2025

Copy link
Copy Markdown
Collaborator

This looks like a great example addition @alexk1976 :)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@alexkunin-gh
alexkunin-gh requested review from Copilot May 8, 2025 12:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new Python example that demonstrates aligning depth and RGB images using a software device. Key changes include:

  • Adding a new example file (align-with-software-device.py) that captures and processes color/depth frames.
  • Updating the README to include a link to the new example.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
wrappers/python/examples/readme.md Added new example entry describing stream alignment.
wrappers/python/examples/align-with-software-device.py New example showing color/depth capture, processing, and alignment using a software device.
Comments suppressed due to low confidence (1)

wrappers/python/examples/align-with-software-device.py:112

  • The exception handler uses logging.error without importing the logging module. Please add 'import logging' at the beginning of the file.
    logging.error("An error occurred: %s", e, exc_info=True)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@alexkunin-gh
alexkunin-gh requested a review from Copilot May 8, 2025 13:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new Python example that demonstrates how to align color and depth images using a software device, and updates the README to include a reference to the new example.

  • Updated README to add an entry for the new alignment example.
  • Added the Python example file that captures, saves, and aligns depth and color frames using a software device.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
wrappers/python/examples/readme.md Added a new entry for the alignment example in the examples list.
wrappers/python/examples/align-with-software-device.py New Python example demonstrating depth-to-color alignment with a software device.
Comments suppressed due to low confidence (1)

wrappers/python/examples/readme.md:17

  • [nitpick] Consider using consistent terminology across the PR; for example, replacing 'SW device' with 'software device' for consistency with the code comments.
11. [Stream alignment using SW device](./align-with-software-device.py) - Demonstrates how to align depth and RGB images using a software device.

Comment thread wrappers/python/examples/align-with-software-device.py
Comment thread wrappers/python/examples/align-with-software-device.py Outdated
Alex Kunin and others added 2 commits May 8, 2025 16:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@alexkunin-gh
alexkunin-gh requested a review from Nir-Az May 8, 2025 17:44

@Nir-Az Nir-Az left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nir-Az
Nir-Az merged commit 547e831 into realsenseai:development May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants