-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix intrinsics calculation for non BROWN D500 models #12618
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,6 +194,14 @@ namespace librealsense | |
|
||
// update values in the distortion params of the calibration table | ||
rgb_coefficients_table.distortion_model = RS2_DISTORTION_BROWN_CONRADY; | ||
|
||
// Since we override the table we need an indication that the table had changed from | ||
// outside this function Decided to use a reserve field for that | ||
if( rgb_coefficients_table.reserved[3] != 0 ) | ||
throw invalid_value_exception( "reserved field read from RGB distortion model table is expected to be zero" ); | ||
|
||
rgb_coefficients_table.reserved[3] = 1; | ||
|
||
rgb_coefficients_table.distortion_coeffs[5] = 0; | ||
rgb_coefficients_table.distortion_coeffs[6] = 0; | ||
rgb_coefficients_table.distortion_coeffs[7] = 0; | ||
|
@@ -222,13 +230,18 @@ namespace librealsense | |
intrinsics.height = height; | ||
|
||
// For D555e, model will be brown and we need the unrectified intrinsics | ||
auto rect_params = compute_rect_params_from_resolution( table->rgb_coefficients_table.distortion_model | ||
== RS2_DISTORTION_BROWN_CONRADY | ||
? table->rgb_coefficients_table.base_instrinsics | ||
: table->rectified_intrinsics, | ||
width, | ||
height, | ||
false ); // symmetry not needed for RGB | ||
// We use reserved[3] as a flag here to indicate the full distortion module is not | ||
// really brown but we treat it as such because the HW fixes fisheye distortion. | ||
bool use_base_intrinsics | ||
= ( table->rgb_coefficients_table.distortion_model == RS2_DISTORTION_BROWN_CONRADY | ||
&& table->rgb_coefficients_table.reserved[3] == 0 ); | ||
|
||
auto rect_params = compute_rect_params_from_resolution( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't look like clang-format formatting :) |
||
use_base_intrinsics ? table->rgb_coefficients_table.base_instrinsics | ||
: table->rectified_intrinsics, | ||
width, | ||
height, | ||
false ); // symmetry not needed for RGB | ||
|
||
intrinsics.fx = rect_params[0]; | ||
intrinsics.fy = rect_params[1]; | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment that we use
reserved[3]
as a flag here to indicate the full distortion module is not really brown but we treat it as such because the HW fixes fisheye distortion.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added