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

Transforming calibration parameters #35

Closed
FelipeDelgadoR opened this issue Jul 28, 2020 · 4 comments
Closed

Transforming calibration parameters #35

FelipeDelgadoR opened this issue Jul 28, 2020 · 4 comments

Comments

@FelipeDelgadoR
Copy link

Hi @etiennedub
I'm currently using your repo to work with my Azure Kinect and it works really nice!
I'm having some issues with the intrinsics that I got from this function (save_calibration_json)
I have the current intrinsics that I got from the Open3D Method (with the mkv reader) and I got this (and they work):

1920, 1080, 919.42980957, 919.3795166, 953.07250977, 551.76287842

The problem now is that using your function I got this:

0.49665233492851257,
0.50851589441299438,
0.47886967658996582,
0.6384580135345459,
0.32674625515937805,
-2.3125674724578857,
1.3249306678771973,
0.21215163171291351,
-2.1464962959289551,
1.2583736181259155,
0,
0,
-0.00038163267890922725,
0.000783831172157079

and none of these values look like the ones that I got
I think that this is some form of problem converting these values and I'd really appreciate some help from you!
Thanks for everything

@lpasselin
Copy link
Collaborator

Maybe Open3D calibration config is not the same format as the raw calibration values obtained from the device?
As Etienne said, pyk4a outputs the calibration in a format compatible with opencv.

@etiennedub
Copy link
Owner

@lpasselin They are not directly compatible with OpenCV but can be converted.

Those 15 values are the intrinsic define here: https://microsoft.github.io/Azure-Kinect-Sensor-SDK/master/structk4a__calibration__intrinsic__parameters__t_1_1__param.html
All the distortion coefficients can be directly used in OpenCV but not the other prams (fx, fy, cx and cy). There are normalize and that's why they don't look the same.
You can "unormalize" but it depends on your resolution and other stuff. You should be able to do it by looking at this code.
If it's still not clear from the code, you can always ask me.

@FelipeDelgadoR
Copy link
Author

Hi @etiennedub
I was really busy with lots of things but now I'm ready to resume this issue...
I was looking at the code that you send me and I'm not quite sure how this help me...
I'm using 1080p color resolution and both NFOV_UNBINNED and WFOV_UNBINNED to work with my kinects
how should I transform these values?

johan12345 added a commit to johan12345/pyk4a that referenced this issue Mar 22, 2021
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 etiennedub#35, etiennedub#69
johan12345 added a commit to johan12345/pyk4a that referenced this issue Mar 22, 2021
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 etiennedub#35, etiennedub#69
johan12345 added a commit to johan12345/pyk4a that referenced this issue Mar 22, 2021
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 etiennedub#35, etiennedub#69
johan12345 added a commit to johan12345/pyk4a that referenced this issue Mar 22, 2021
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 etiennedub#35, etiennedub#69
@johan12345
Copy link
Contributor

FYI: I have opened a pull request adding a function for accessing the intrinsic parameters in an OpenCV-compatible format: #113.

lpasselin pushed a commit that referenced this issue Mar 30, 2021
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>
lpasselin added a commit that referenced this issue 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

No branches or pull requests

4 participants