魚眼相機模型-相機畸變


 

魚眼鏡頭

魚眼相機鏡頭是由十幾個不同的透鏡組合而成,在成像的過程中,入射光線經過不同程度的折射,投影到尺寸有限的成像平面上,使得魚眼鏡頭擁有更大的視野范圍。下圖為魚眼相機的組成結構:

與針孔相機原理不同,魚眼鏡頭采用非相似成像,在成像過程中引入畸變,通過對直徑空間的壓縮,突破成像視角的局限,從而達到廣角成像。

所以魚眼鏡頭是一種極端 的廣角鏡頭,通常焦距小於等於16mm並且視角接近或等於180°(在工程上視角超過140°的鏡頭即統稱為魚眼鏡頭)。

相機畸變

魚眼鏡頭無論如何它的邊緣線條都是要彎曲的,即使90度的魚眼也是這樣,這種畸變我們在很多廣角鏡頭上都可以看到,而這就是明顯的桶形畸變。同樣的120度的魚眼看起來彎曲的更加厲害一些了,而且被容納進范圍的景物更多;150度同樣如此,而180度的魚眼則可以把鏡頭周圍180度范圍內的所有物體都拍攝進去。眾所周知,焦距越短,視角越大,因光學原理產生的變形也就越強烈。為了達到180度的超大視角,魚眼鏡頭不得不允許這種變形(桶形畸變)的合理存在。

針對原始圖像進行畸變校正后,帶有冗余邊界,需要做進一步截取。如下圖:

 

畸變模型和參數

 

魚眼相機投影模型有: 等距投影  正交投影  等立體角投影    體視投影 ;成像模型:先將三維點投影到單位球面,再將單位球面上的點投影到歸一化平面上。

但這些,對於 不搞鏡頭研發,只搞 圖像處理的我們都不必關心,我們關心下面的opencv 模型

 

opencv https://docs.opencv.org/3.4/db/d58/group__calib3d__fisheye.html

 

由 世界坐標點和圖像坐標點,標定得到相機 內參、外參、畸變參數

 

 

 

 1 double cv::fisheye::calibrate    (
 2     InputArrayOfArrays     objectPoints,
 3         InputArrayOfArrays     imagePoints,
 4         const Size &     image_size, 
 5         InputOutputArray     K,
 6         InputOutputArray     D,
 7         OutputArrayOfArrays     rvecs,
 8         OutputArrayOfArrays     tvecs,
 9         int     flags = 0,
10        TermCriteria     criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 100, DBL_EPSILON) 
11 )    

 

 1 objectPoints    vector of vectors of calibration pattern points 
 2                 in the calibration pattern coordinate space.
 3 imagePoints        vector of vectors of the projections of calibration pattern points. 
 4                 imagePoints.size() and objectPoints.size() and imagePoints[i].size() 
 5                 must be equal to objectPoints[i].size() for each i.
 6 image_size        Size of the image used only to initialize the camera intrinsic matrix.
 7 K                Output 3x3 floating-point camera intrinsic matrix 
 8                 If fisheye::CALIB_USE_INTRINSIC_GUESS is specified, 
 9                 some or all of fx, fy, cx, cy must be initialized before calling the function.
10 D                Output vector of distortion coefficients (k1,k2,k3,k4).
11 rvecs            Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view. 
12                 That is, each k-th rotation vector together with the corresponding k-th translation vector 
13                 (see the next output parameter description) brings the calibration pattern from the model 
14                 coordinate space (in which object points are specified) to the world coordinate space, 
15                 that is, a real position of the calibration pattern in the k-th pattern view (k=0.. M -1).
16 tvecs            Output vector of translation vectors estimated for each pattern view.
17 flags            Different flags that may be zero or a combination of the following values:
18      fisheye::CALIB_USE_INTRINSIC_GUESS cameraMatrix contains valid initial values of fx, fy, cx, cy 
19                           that are optimized further. Otherwise, (cx, cy) is initially set to the image center 
20                           ( imageSize is used), and focal distances are computed in a least-squares fashion.
21      fisheye::CALIB_RECOMPUTE_EXTRINSIC Extrinsic will be recomputed after each iteration of intrinsic optimization.
22      fisheye::CALIB_CHECK_COND The functions will check validity of condition number.
23      fisheye::CALIB_FIX_SKEW Skew coefficient (alpha) is set to zero and stay zero.
24      fisheye::CALIB_FIX_K1,..., fisheye::CALIB_FIX_K4 Selected distortion coefficients are set to zeros and stay zero.
25      fisheye::CALIB_FIX_PRINCIPAL_POINT The principal point is not changed during the global optimization. 
26                       It stays at the center or at a different location specified when 
27                       fisheye::CALIB_USE_INTRINSIC_GUESS is set too.
28 
29 criteria    Termination criteria for the iterative optimization algorithm.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM