Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added transform_depth_image_to_color_camera_custom functionality #76

Merged
merged 5 commits into from
Nov 3, 2020

Conversation

SBoulanger
Copy link
Contributor

Added the ability to transform IR images to color camera format using the k4a_depth_image_to_color_camera_custom function. There is still work to be done because I am pretty sure the depth image is being transformed as well. So it is redundant to only do this with the ir image. Although I am not sure the best way to return both depth and ir images from the c++ function. TODO in the future.

@codecov
Copy link

codecov bot commented Nov 3, 2020

Codecov Report

Merging #76 into develop will decrease coverage by 0.27%.
The diff coverage is 50.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #76      +/-   ##
===========================================
- Coverage    91.83%   91.55%   -0.28%     
===========================================
  Files            5        5              
  Lines          306      308       +2     
===========================================
+ Hits           281      282       +1     
- Misses          25       26       +1     
Impacted Files Coverage Δ
pyk4a/transformation.py 66.66% <50.00%> (-3.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f44f6de...c1c6888. Read the comment docs.

@SBoulanger
Copy link
Contributor Author

SBoulanger commented Nov 3, 2020

Hope the codecov failures aren't an issue. Don't really know what that is about.

pyk4a/capture.py Outdated Show resolved Hide resolved
pyk4a/pyk4a.cpp Outdated Show resolved Hide resolved
pyk4a/transformation.py Outdated Show resolved Hide resolved
pyk4a/pyk4a.cpp Outdated Show resolved Hide resolved
@lpasselin
Copy link
Collaborator

Thank you for the PR.

I added some small comments. Good work I'm sure we'll merge this soon!

Hope the codecov failures aren't an issue. Don't really know what that is about.

Yeah we'll have to add a test to merge. It will propably be similar to the depth transformation tests.

@SBoulanger SBoulanger closed this Nov 3, 2020
@SBoulanger SBoulanger reopened this Nov 3, 2020
@SBoulanger
Copy link
Contributor Author

I saw your comments and made some changes. Check them out.

Thank you for the PR.

No thank YOU for creating this great project.

@lpasselin
Copy link
Collaborator

lpasselin commented Nov 3, 2020

Can you test that the transformed_depth is good? Something like the following

original_transformed_depth = capture._transformed_depth
capture._transformed_depth = None  # reset transformed_depth.
transformed_ir = capture.transformed_ir
assert original_transformed_depth == capture.transformed_depth

If it works, I'll merge even if we don't have tests.

An (unecessary for now) optimization would be to skip generation of the np_depth if we already have a capture.transformed_depth.

@SBoulanger
Copy link
Contributor Author

All is good! I did some tests and they all passed.

Yes some optimization could definitely be done. For now, the best practice is to just call for transformed_ir before transformed_depth so the depth transformation is not done twice.

@lpasselin lpasselin merged commit c7a9878 into etiennedub:develop Nov 3, 2020
lpasselin added a commit that referenced this pull request Dec 15, 2020
* Run test with different python versions (#65)

* Add matrix to workflow

* Change python versions list

* Change python versions list

* Add k4a versions to matrix

* Typofix

* Drop k4a from matrix

* Add dataclasses requirement for python <3.7

* Fix python 3.6 test behavior

* Fix python 3.6 test behavior

* Restore fail-fast option

* fix conversion seconds to ns

* fix conversion seconds to ns

* fix timestamp ns to us

Co-authored-by: Louis-Philippe Asselin <louisphilippeasselin@gmail.com>

* fix install using pip --editable --user (#67)

* Codecov support (#64)

* Codecov support

* Add badge

* Order badges

* fix capture.transformed_depth_point_cloud (#73)

* version 1.0.1

* Added transformed_ir with transform_depth_image_to_color_camera_custom functionality (#76)

* Added transform_depth_image_to_color_camera_custom functionality

* keeping things c

* add interpolation option condition as a parameter

* returned the depth image

* unpack return value if not None so avoid error

* Image timestamp support (#88)

* Support for capture images timestamps

* Support for capture images timestamps

* Add more changes

* version 1.1.0

* fix lint

* readme fix wrong example version of SDK

Co-authored-by: Ilya Gruzinov <igruzinov@yandex.ru>
Co-authored-by: Samuel Boulanger <samuelrdboulanger@gmail.com>
lpasselin added a commit that referenced this pull request Apr 8, 2021
- Use clang-format as CPP code formatter/linter (#105)
- Available devices count (#107)
- Recording support (#106)
- Capture color exposure and white balance properties (#110)
- Calibration: Add functions to access intrinsics (#113)
- Add 3d => 2d conversion function (#114)

* Run test with different python versions (#65)

* Add matrix to workflow

* Change python versions list

* Change python versions list

* Add k4a versions to matrix

* Typofix

* Drop k4a from matrix

* Add dataclasses requirement for python <3.7

* Fix python 3.6 test behavior

* Fix python 3.6 test behavior

* Restore fail-fast option

* fix conversion seconds to ns

* fix conversion seconds to ns

* fix timestamp ns to us

Co-authored-by: Louis-Philippe Asselin <louisphilippeasselin@gmail.com>

* fix install using pip --editable --user (#67)

* Codecov support (#64)

* Codecov support

* Add badge

* Order badges

* fix capture.transformed_depth_point_cloud (#73)

* version 1.0.1

* Added transformed_ir with transform_depth_image_to_color_camera_custom functionality (#76)

* Added transform_depth_image_to_color_camera_custom functionality

* keeping things c

* add interpolation option condition as a parameter

* returned the depth image

* unpack return value if not None so avoid error

* Image timestamp support (#88)

* Support for capture images timestamps

* Support for capture images timestamps

* Add more changes

* version 1.1.0

* fix lint

* readme fix wrong example version of SDK

* Use clang-format as CPP code formatter/linter (#105)

* Use clang-format as CPP code formatter/linter

* Add missed .clang-format

* Available devices count (#107)

* Add ability to querying devices count and read serial numbers

* Fix test

* Rename installed_count => connected_device_count

* Recording support (#106)

* Recording support

* Tests

* Small refactoring

* Add ability to querying devices count and read serial numbers

* Fix test

* Fix format

* Capture color exposure and white balance properties (#110)

* Add color_white_balance and exposure_usec properties to capture

* Add color_white_balance and exposure_usec properties to capture

Co-authored-by: Louis-Philippe Asselin <lpasselin@users.noreply.github.com>

* Calibration: Add functions to access intrinsics (#113)

Camera matrix and distortion coefficients in OpenCV-compatible format.
These values are already specific to the selected camera resolution (in contrast to those accessed through calibration_raw).

related to #35, #69

Co-authored-by: Johan von Forstner <johan.vonforstner@paradoxcat.com>

* version 1.2.0

Co-authored-by: Ilya Gruzinov <igruzinov@yandex.ru>
Co-authored-by: Samuel Boulanger <samuelrdboulanger@gmail.com>
Co-authored-by: Johan von Forstner <johan.forstner@gmail.com>
Co-authored-by: Johan von Forstner <johan.vonforstner@paradoxcat.com>
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.

None yet

2 participants