Fisheye distortion
カメラ座標
Pc=⎝⎛XcYcZc⎠⎞
x′=Xc/Zcy′=Yc/Zcr2=x′2+y′2θ=atan(r)
歪み補正 / Distortion correction
θd=θ(1+k1θ2+k2θ4+k3θ6+k4θ8)x′′=rθdx′y′′=rθdy′
カメラ座標変換
(uv)=(fx00fycxcy)⎝⎛x′′y′′1⎠⎞
OpenCV
K = np.array([
[ 1, 0, 320 ],
[ 0, 1, 240 ],
[ 0, 0, 1 ],
], dtype=np.float32)
D = np.array([ 1, 0, 0, 0 ], dtype=np.float32)
undistorted_points = np.array([[
[ 0, 0 ],
[ 0, 10 ],
[ 10, 0 ],
[ 10, 10 ],
]], dtype=np.float32)
distorted_points = cv2.fisheye.distortPoints(undistorted_points, K, D)
distorted_points
array([[[320. , 240. ],
[320. , 244.65497],
[324.65497, 240. ],
[323.44827, 243.44826]]], dtype=float32)