How to compute distortion percentage using radial distortion coefficients
12 ビュー (過去 30 日間)
古いコメントを表示
I am planning to calculate the distortion present in the image using radial distortion coefficients obtained using 3d simulation camera,will you please let me know how to compute it.
0 件のコメント
回答 (1 件)
Aastha
2024 年 8 月 8 日
Hi Rajini,
I see that you want to calculate radial distortion present in an image using radial distortion coefficients.
Radial distortion occurs when there is an unequal bending of light when passing through the camera lens. This results in straight lines appearing as curved in the captured image.
The commonly used model for radial distortion is as follows:
x_distorted*(1+k1*r^2 + k2*r^4 + k3*r^6) = x
y_distorted*(1+k1*r^2 + k2*r^4 + k3*r^6) = y
Variables x and y are the original image coordinates.
Variables k1, k2 and k3 are the radial distortion coefficients and r is the distance from the centre of the image.
The value of r is calculated as r = sqrt(x_distorted^2+y_distorted^2) assuming the centre of the image to be taken at the origin.
Please follow the below steps to undistort an image affected by radial distortion:
1. Create a camera parameters object to store the camera intrinsic parameters.
2. Use the “undistortImage” function in MATLAB to undistort the image and correct for radial distortion. Pass the camera parameters object you created in the step 1. along with the distorted image variable I.
Radial distortion will increase as the value of the distortion coefficients k1, k2 and k3 increases.
You can measure the amount of distortion by calculating the norm of the distortion coefficients vector [k1 k2 k3]. The undistorted image can then be used to calculate the percentage of distortion.
Please refer to the MathWorks documentation in case of any doubts:
Hope this helps!
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!