Correcting lens distortion during camera calibration
4 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I am attempting to calibrate several webcams for optical tracking using Matlab's cameraCalibrator tool. Following the instructions via the help guide, I was able to obtain the camera's parameters, including the radial distortion coefficients as follows:
k=[-0.0548 0.2001 -0.3073]
I encounter an issue however, when I plug these values into the distortion correction equations along with any set of (x_d,y_d) coordinates:
x_d = x(1 + k1*r^2 + k2*r^4 + k3*r^6)
y_d= y(1 + k1*r^2 + k2*r^4 + k3*r^6)
where r^2 = x^2 + y^2
Analyzing this pair of nonlinear equations, you quickly discover that in order to get any (x,y) values that are on the magnitude of our image (1280x720 --> +-640, +-360) you either need really small k values (on the order of e^-10) or you need to multiply your (x,y) coordinates by some scalar to make them smaller.
I am comfortable assuming Matlab's radial distortion coefficients (k, listed above) are accurate, because all the other intrinsic/extrinsic data the cameraCalibrator tool provided was correct. This leads me to ask the question: do I need to normalize the image coordinates somehow and if so, how do I do that?
Thank you for your help
-Alex
0 件のコメント
採用された回答
Dima Lisin
2014 年 8 月 4 日
編集済み: Dima Lisin
2014 年 8 月 10 日
Hi Alex,
Yes, the x and y distortion equations are in the normalized image coordinates. That is the origin is at the optical center (aka principal point), and the coordinates are in world units. So if you have a point in pixels, you need to subtract the optical center, and then divide by fx and fy from the intrinsic matrix.
Also, as a sanity check you should always try using undistortImage() to see whether the distortion coefficients make sense. There is a button in the buttom left corner of the image pane of the Camera Calibrator that will show you the undistorted image.
1 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Camera Calibration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!