Fix D405 VGA resolution intrinsics calculation - #13060
Merged
Merged
Conversation
Nir-Az
reviewed
Jun 20, 2024
| //D405 needs special calculation because the ISP crops the full sensor image using non linear transformation. | ||
| rs2_intrinsics get_d405_color_stream_intrinsic(const std::vector<uint8_t>& raw_data, uint32_t width, uint32_t height) | ||
| { | ||
| // Convert normalized focal lenght and principal point to pixel units (K matrix format) |
Nir-Az
reviewed
Jun 20, 2024
| k( 2, 1 ) = ( k( 2, 1 ) + 1 ) * resolutions_list[res].y / 2.f; // ppy | ||
| }; | ||
|
|
||
| // Scale focal lenght and principal point in pixel units from one resolution to another (K matrix format) |
Nir-Az
reviewed
Jun 20, 2024
Nir-Az
reviewed
Jun 20, 2024
| }; | ||
|
|
||
| auto table = check_calib< ds::d400_rgb_calibration_table >( raw_data ); | ||
| auto raw_res = width_height_to_ds_rect_resolutions( 1280, 800 ); |
Collaborator
There was a problem hiding this comment.
Can you explain why we take this resolution?
Contributor
Author
There was a problem hiding this comment.
This is the raw sensor resolution.
These values where also hard coded in the matlab algorithm I was based on. Special for D405 handling.
Nir-Az
reviewed
Jun 20, 2024
Nir-Az
reviewed
Jun 20, 2024
remibettan
reviewed
Jun 24, 2024
| rs2_intrinsics get_d405_color_stream_intrinsic(const std::vector<uint8_t>& raw_data, uint32_t width, uint32_t height) | ||
| { | ||
| // Convert normalized focal length and principal point to pixel units (K matrix format) | ||
| auto k_to_pixels = [&]( float3x3 & k, ds_rect_resolutions res ) |
Contributor
There was a problem hiding this comment.
Please rename k_to_pixels to normalized_k_to_pixels
Nir-Az
reviewed
Jun 26, 2024
| else | ||
| { | ||
| k_to_pixels( k, calibration_res ); | ||
| normalized_k_to_pixels( k, calibration_res ); |
Collaborator
There was a problem hiding this comment.
What is the difference between normalized_k_to_pixels and k_to_pixels?
Contributor
Author
There was a problem hiding this comment.
No difference, just renaming based on Remi's comment.
The code always assumes a "normalized k" input and changes it to pixel units based on the requested resolution.
Nir-Az
approved these changes
Jun 26, 2024
Contributor
Author
|
Close and reopen to trigger CI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracked on [RSDSO-18999]