Skip to content
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

Lens distortion attributes #3130

Open
ffabi opened this issue Jul 29, 2020 · 24 comments
Open

Lens distortion attributes #3130

ffabi opened this issue Jul 29, 2020 · 24 comments
Assignees
Labels

Comments

@ffabi
Copy link

ffabi commented Jul 29, 2020

Can you help me find the correlation between the lens distortion attributes defined in Carla and radial/tangential distortion coefficients?

OpenCV documentation defines k1-k6 for radial distortion and p1, p2 for tangential distortion:
https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html

I would like to define these values, can you help me calculate the attributes needed for Carla camera sensor?
Can you provide a more detailed description of these values?

Maybe lens_k = k1 and lens_kcube = k2 ?

I could not find these Carla attributes in Unreal engine documentation either.

@germanros1987
Copy link
Member

@marcgpuig which model did you follow to implement the lens distortion?

@ffabi
Copy link
Author

ffabi commented Jul 30, 2020

For a while, pinhole camera model was sufficient for me, but I would like to generate images with a given radial and tangential distortion according to the Brown–Conrady model. I would like to mimic a real-world sensor which has defined k1, k2, p1, p2, k3 parameters.

@germanros1987
Copy link
Member

@marcgpuig are we using the Brown–Conrady model to create the lens distortion?

@jerryliu20001
Copy link

I have the same problem about the lens distortion attributes defined in CARLA.
If the default value of the lens_k and lens_kcube mean without distortion, the assumption of the lens_k=k1 and lens_kcube=k2 are unreasonable.
In addition, I am also confused about the other attributes.

image

@stale
Copy link

stale bot commented Oct 31, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

1 similar comment
@stale
Copy link

stale bot commented Jan 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue has not had recent activity label Jan 3, 2021
@germanros1987
Copy link
Member

@marcgpuig do you have 10 min to answer this?

@stale stale bot removed the stale Issue has not had recent activity label Jan 26, 2021
@germanros1987 germanros1987 assigned Axel1092 and unassigned marcgpuig Jan 26, 2021
@YifuTao
Copy link

YifuTao commented Feb 17, 2021

Hi, I have found that the distortion model is "plumb_bob".

I used the ros-bridge, ran rostopic echo /carla/ego_vehicle/rgb_view/camera_info and get something like this:


header:
seq: 10
stamp:
secs: 435
nsecs: 313154742
frame_id: "ego_vehicle/rgb_test"
height: 480
width: 848
distortion_model: "plumb_bob"
D: [0.0, 0.0, 0.0, 0.0, 0.0]
K: [431.4655346201811, 0.0, 424.0, 0.0, 431.4655346201811, 240.0, 0.0, 0.0, 1.0]
R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
P: [431.4655346201811, 0.0, 424.0, 0.0, 0.0, 431.4655346201811, 240.0, 0.0, 0.0, 0.0, 1.0, 0.0]
binning_x: 0
binning_y: 0
roi:
x_offset: 0
y_offset: 0
height: 0
width: 0
do_rectify: False

We changed K (and hence P) by setting the fov and image size. Specifically, K1, K5 (fx, fy) by fov (fov = 2 arctan (fx/2f)) and K3, K6 (cx, cy) by image size (halve). Definition of D,K,R,P and more information of plumb_bob distortion model can be found in http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/CameraInfo.html.

Question remained: we still cannot set D, the distortion model. I have tried to set the CARLA Camera lens distortion attributes as mentioned above, but that does not lead to changes in nor D or other matrix in the above camera information.

Can you help on this? It would be very helpful for the community if the camera distortion section documentation can be improved.

Many thanks in advance!

@Axel1092
Copy link
Contributor

Axel1092 commented Mar 3, 2021

Hi all, we are on the way of changing the lens distortion algorithms as we found some issues and inaccurate results with the current implementation. We plan to expose these parameters so that they can be tuned easily.

@stale
Copy link

stale bot commented Jul 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue has not had recent activity label Jul 21, 2021
@jimmyw404
Copy link

Hi all, we are on the way of changing the lens distortion algorithms as we found some issues and inaccurate results with the current implementation. We plan to expose these parameters so that they can be tuned easily.

Hi @Axel1092 , any update on this! I'm very interested in getting basic lens distortion with matching OpenCV parameters!

@stale stale bot removed the stale Issue has not had recent activity label Aug 16, 2021
@Kait0
Copy link

Kait0 commented Nov 4, 2021

I am also interested in this issue.

@AbanobSoliman
Copy link

Hi, I am also interested in this topic/issue. any updates ! Thanks

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue has not had recent activity label Apr 16, 2022
@jimmyw404
Copy link

I am still interested in this!

@stale stale bot removed the stale Issue has not had recent activity label Apr 16, 2022
@qiangt
Copy link

qiangt commented May 16, 2022

Does any one know any update on this? I just checked the latest Carla version 0.9.13, and it still uses the old model

@yuanhaorannnnnn
Copy link

so upset to see that no updates with such a basic concept

@1999010168
Copy link

also sad

@dengping023
Copy link

Looking forward to distortion model of opencv used in carla

@Hassan-BABAOUSMAIL
Copy link

Hi all, we are on the way of changing the lens distortion algorithms as we found some issues and inaccurate results with the current implementation. We plan to expose these parameters so that they can be tuned easily.

Hello sir,
Is there any update? Which model was used in CARLA to model distortion? How can
we modify it?

@ZijianHan
Copy link

ZijianHan commented May 13, 2023

Hi all, we are on the way of changing the lens distortion algorithms as we found some issues and inaccurate results with the current implementation. We plan to expose these parameters so that they can be tuned easily.

any updates on the distortion model?

@alanhuang1990
Copy link

alanhuang1990 commented May 24, 2023

If you look into Carla/PostProcessingMaterials/PhysicLensDistortion.uasset, you will find that carla use this distortion model: https://www.ssontech.com/content/lensalg.html
But it seems to be a bug that this uasset does not works properly.
image

@zhengxh-git
Copy link

I am still interested in this!

@MinnanZhou
Copy link

Still interested in this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment