-
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 #6609 #6615
Fix #6609 #6615
Conversation
…initialize coeffs
Hi @jangernert |
src/l500/l500-depth.h
Outdated
@@ -178,6 +178,12 @@ namespace librealsense | |||
intrinsics.fy = intrinsic_params.pinhole_cam_model.ipm.focal_length.y; | |||
intrinsics.ppx = intrinsic_params.pinhole_cam_model.ipm.principal_point.x; | |||
intrinsics.ppy = intrinsic_params.pinhole_cam_model.ipm.principal_point.y; | |||
intrinsics.coeffs[0] = 0; |
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.
@jangernert hi ,
it might not necessary apply here, but in general case the coefficients should be copied from the source rather than assigned.
You can either change it (preferred) or add explanation in code why it can be avoided in the particular case.
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.
I honestly didn't check if the distortion struct had any valid values since the image is not distorted.
intrinsics.coeffs[2] = intrinsic_params.pinhole_cam_model.distort.radial_k3; | ||
intrinsics.coeffs[3] = intrinsic_params.pinhole_cam_model.distort.tangential_p1; | ||
intrinsics.coeffs[4] = intrinsic_params.pinhole_cam_model.distort.tangential_p2; | ||
intrinsics.model = RS2_DISTORTION_NONE; |
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.
Thanks for the quick response, the parameters should be reordered and to be aligned with the struct's layout,
similar to https://github.com/IntelRealSense/librealsense/blob/ac/src/l500/l500-color.cpp#L202-L206:
if( model.distort.radial_k1 || model.distort.radial_k2 || model.distort.tangential_p1 || model.distort.tangential_p2 || model.distort.radial_k3 )
{
intrinsics.coeffs[0] = model.distort.radial_k1;
intrinsics.coeffs[1] = model.distort.radial_k2;
intrinsics.coeffs[2] = model.distort.tangential_p1;
intrinsics.coeffs[3] = model.distort.tangential_p2;
intrinsics.coeffs[4] = model.distort.radial_k3;
intrinsics.model = RS2_DISTORTION_INVERSE_BROWN_CONRADY;
}
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.
Oh that is a bit confusing. Any reason why the coeffs are handed out in an array rather than the distortion struct directly? Would make things a lot clearer.
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.
The parameters are unique per distortion model in use, so apparently the names cannot be hard-coded/reused.
As for the Brown-Conrady distortion and its coefficients - this convention used throughout the SDK for all sensor's that are modeled after it
@jangernert , thanks again for the contribution! |
#6609
set the distortion model of the l500 depth sensor to NONE & initialize coeffs