gaoxiang12 / slambook

MIT License
6.79k stars 3.25k forks source link

SLAM第5讲的相机畸变中的去畸变公式疑惑 #250

Open cctt126 opened 4 years ago

cctt126 commented 4 years ago

SLAM第5讲的相机畸变中的去畸变公式与opencv文档一致, xcorrected = x(1 + k1r2 + k2r4 + k3r6) ycorrected = y(1 + k1r2 + k2r4 + k3r6)

但令我困惑的是与matlab工具箱文档描述正好相反(http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/parameters.html) %xx = a (1 + kc(1)r^2 + kc(2)r^4) + 2kc(3)ab + kc(4)(r^2 + 2a^2); %yy = b (1 + kc(1)r^2 + kc(2)r^4) + kc(3)(r^2 + 2b^2) + 2kc(4)ab; looks like the xx,yy are distorted coordinate; a,b are ideal coordinate. 糊涂了,哪种正确?

cctt126 commented 4 years ago

I figured out it, both OpenCV document for camera undistortion and SLAM 14 course are wrong. Matlab version is the correct one: x_distorted = x_ideal(1 + k1r2 + k2r4 + k3r6). An ideal xyz multiply (1 + k1r2 + k2r4 + k3r6) turns out a distorted xyz_d. (They all in z=1 plane)