Items with no label
3335 Discussions

lens distortion in RealSenseSDK for Windows vs. librealsense *sigh*

SNoh4
Beginner
1,956 Views

Hello again,

I had a similar trouble to this thread ( ), so previously I tried to solve this issue by manual calibration.

I'm certain that I got more accurate calibration parameters, but it also makes weird 3D noise in point cloud.

I guess it came from the undistortion on depth image.

Anyway, at this moment, I am now trying to transfer my code from RSSDK for Windows (2016R3) to librealsense.

As expected (*sigh* ), I encountered another problem.

The problem now is the difference of lens distortion model.

In the previous RSSDK for Windows, the distortion model was radial/tangential distortion model, which is the same (?) with OpenCV.

Therefore, I just could utilize cv::undistort without a trouble.

Now I checked librealsense and just print out the calibration parameters in this new SDK, and I found that the distortion coefficients are different.

After few digging, I got it is Brown-Conrady distortion model.

However, I have no idea on this distortion model, and I cannot find the conversion between them, unfortunately.

So, here are my questions.

Is there any way to convert radial/tangential distortion model to Brown-Conrady model?

If it exists (I guess it should because librealsense just export different value without any touch), please provide us that information.

Thank you for your reading.

0 Kudos
1 Solution
MartyG
Honored Contributor III
447 Views

Perhaps the Librealsense mode RS_DISTORTION_MODIFIED_BROWN_CONRADY would be useful to you. It is equal to Brown-Conrady, except that tangential distortion is applied to radially distorted points

View solution in original post

0 Kudos
3 Replies
MartyG
Honored Contributor III
448 Views

Perhaps the Librealsense mode RS_DISTORTION_MODIFIED_BROWN_CONRADY would be useful to you. It is equal to Brown-Conrady, except that tangential distortion is applied to radially distorted points

0 Kudos
SNoh4
Beginner
447 Views

MartyG, hello again!

I just quickly modified code in C-Tutorials-3-pointcloud in librealsense SDK and checked it works, by using "struct rs_intrinsics".

By the way, why C++ API (rs::intrinsics) does not permit to modify "model" ?

It is quite awkward, but I'm now doing like this:

rs::intrinsics depth_intrin;

// depth_intrin.model(RS_DISTORTION_MODIFIED_BROWN_CONRADY); // what I want to do ...

auto modifyIntrinsicToModifiedBrownConrady = [](rs_intrinsics *intrin) {

intrin->model = RS_DISTORTION_MODIFIED_BROWN_CONRADY;

};

modifyIntrinsicToModifiedBrownConrady(&depth_intrin); // awkward, but anyway it works ...

0 Kudos
MartyG
Honored Contributor III
447 Views

I'm very glad you got it working!

The only useful reference I could find about model() in regard to rs:intrinsics and distortion is this one, which explains the difference between the RealSense SDK and Librealsense distortion systems.

https://www.bountysource.com/issues/48438489-librealsense-vs-win-dcm-realsense-distortion-model Bountysource

0 Kudos
Reply