Repository navigation
Fix #6609 - #6615
Fix #6609#6615
Conversation
…initialize coeffs
|
Hi @jangernert |
| 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.
@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.
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.
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.
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.
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