References
Theory Introduction Pinhole camera model, optical center (o) Coordinate It seems that there are errors inside.
Parameters calculated by the least-square method For example 相机标定(Camera calibration)原理、步骤_唐僧洗头用飘柔dp的博客-CSDN博客
在图像测量过程以及机器视觉应用中,为确定空间物体表面某点的三维几何位置与其在图像中对应点之间的相互关系,必须建立相机成像的几何模型,这些几何模型参数就是相机参数。在大多数条件下这些参数必须通过实验与计算才能得到,这个求解参数的过程就称之为相机标定(或摄像机标定)。无论是在图像测量或者机器视觉应用中,相机参数的标定都是非常关键的环节,其标定结果的精度及算法的稳定性直接影响相机工作产生结果的准确性。因此,做好相机标定是做好后续工作的前提,提高标定精度是科研工作的重点所在。 常用术语 内参矩阵: Intrinsic Matrix 焦距: Focal Length 主点: Principal Point 径向畸变: Radial Distortion 切向畸变: Tangential Distortion 旋转矩阵: Rotation Matrices 平移向量: Translation Vectors 平均重投影误差: Mean Reprojection Error 重投影误差: Reprojection Errors 重投影点: Reprojected Points 世界坐标系(world coordinate)(xw,yw,zw),也称为测量坐标系,是一个三维直角坐标系,以其为基准可以描述相机和待测物体的空间位置。世界坐标系的位置可以根据实际情况自由确定。 相机坐标系(camera coordinate)(xc,yc,zc),也是一个三维直角坐标系,原点位于镜头光心处,x、y轴分别与相面的两边平行,z轴为镜头光轴,与像平面垂直。 其中R为3*3的旋转矩阵,t为3*1的平移矢量,(xc,yc,zc,1)T(xc,yc,zc,1)T为相机坐标系的齐次坐标,(xw,yw,zw,1)T(xw,yw,zw,1)T为世界坐标系的齐次坐标。 ### 1.4 像素坐标系、图像坐标系 - 像素坐标系(pixel coordinate) 如图,像素坐标系uov是一个二维直角坐标系,反映了相机CCD/CMOS芯片中像素的排列情况。原点oo位于图像的左上角,uu轴、vv轴分别于像面的两边平行。像素坐标系中坐标轴的单位是像素(整数)。 其中,dX、dY分别为像素在X、Y轴方向上的物理尺寸,u0,v0为主点(图像原点)坐标。 如图,空间任意一点P与其图像点p之间的关系,P与相机光心o的连线为oP,oP与像面的交点p即为空间点P在图像平面上的投影。 该过程为透视投影,如下矩阵表示: 其中,ss为比例因子(ss不为0),ff为有效焦距(光心到图像平面的距离),(x,y,z,1)T(x,y,z,1)T是空间点PP在相机坐标系oxyzoxyz中的齐次坐标,(X,Y,1)T(X,Y,1)T是像点pp在图像坐标系OXYOXY中的齐次坐标。 其中,αx=f/dXαx=f/dX、αy=f/dYαy=f/dY,称为u、v轴的尺度因子,M1称为相机的内部参数矩阵,M2称为相机的外部参数矩阵,M称为投影矩阵。 ## 2 相机内参与畸变参数 ### 2.1 相机内参 - 参看1.6节所述 畸变参数(distortion parameters) 畸变(distortion)是对直线投影(rectilinear projection)的一种偏移。 简单来说直线投影是场景内的一条直线投影到图片上也保持为一条直线。 畸变简单来说就是一条直线投影到图片上不能保持为一条直线了,这是一种光学畸变(optical aberration),可能由于摄像机镜头的原因。 畸变一般可以分为:径向畸变、切向畸变 1、径向畸变来自于透镜形状 2、切向畸变来自于整个摄像机的组装过程。畸变还有其他类型的畸变,但是没有径向畸变、切向畸变显著 下面是几张反应畸变的图像 径向畸变 实际摄像机的透镜总是在成像仪的边缘产生显著的畸变,这种现象来源于"筒形"或"鱼眼"的影响。如下图,光线在原理透镜中心的地方比靠近中心的地方更加弯曲。对于常用的普通透镜来说,这种现象更加严重。筒形畸变在便宜的网络摄像机中非常厉害,但在高端摄像机中不明显,因为这些透镜系统做了很多消除径向畸变的工作。 对于径向畸变,成像仪中心(光学中心)的畸变为0,随着向边缘移动,畸变越来越严重。 径向畸变包括:枕形畸变、桶形畸变 切向畸变 切向畸变是由于透镜制造上的缺陷使得透镜本身与图像平面不平行而产生的。 切向畸变可分为:薄透镜畸变、离心畸变 切向畸变图示: 2.2.1 opencv中的畸变模型 相机标定步骤 1、打印一张棋盘格,把它贴在一个平面上,作为标定物。 ...
https://blog.csdn.net/weixin_45860565/article/details/119302447
demosaic def demosaic(path, pngTop, Hres, Vres):
deYUV 彩色电视为了与黑白电视兼容,必须传送一个亮度信号,以便黑白电视机接收。在彩色电视中,常用两个色差信号(B-Y)和(R-Y)来代表色度信息,它们与彩色摄像机输出的R、G、B三基色信号存在下列关系:
{ Y = 0.299 R + 0.587 G + 0.114 B V = C r = ( R − Y ) ∗ 0.713 + d e l t a U = C b = ( B − Y ) ∗ 0.564 + d e l t a \begin{cases}
Y=0.299R+0.587G+0.114B\\
V=C_r=(R-Y)*0.713+delta\\
U=C_b=(B−Y)*0.564+delta\\
\end{cases} ⎩ ⎨ ⎧ Y = 0.299 R + 0.587 G + 0.114 B V = C r = ( R − Y ) ∗ 0.713 + d e lt a U = C b = ( B − Y ) ∗ 0.564 + d e lt a
read_yuv422_mode1_by_numpy
demosaicRaw Demosaic the 16bit and 8bit raw to RGB color, take RCCB as RGGB
matrix2uint8 pic = matrix2uint8(filepath, Vres, Hres) Limit the image raw8 which is to be returned in [0, 255]
WhiteBalance The old code uses OpenCV 3.1.0
calib1cam
calib1cam_chessboard
calib1cam_dots n p . m g r i d [ 0 : c l , 0 : r w ] = n p . m g r i d [ 0 : 27 , 0 : 21 ] ∣ s h a p e : ( 2 , 27 , 21 ) np.mgrid[0:cl, 0:rw] = np.mgrid[0:27, 0:21]\quad | \quad shape: (2, 27, 21) n p . m g r i d [ 0 : c l , 0 : r w ] = n p . m g r i d [ 0 : 27 , 0 : 21 ] ∣ s ha p e : ( 2 , 27 , 21 )
n p . m g r i d [ 0 : c l , 0 : r w ] . T = n p . m g r i d [ 0 : 27 , 0 : 21 ] . T ∣ s h a p e : ( 21 , 27 , 2 ) np.mgrid[0:cl, 0:rw].T = np.mgrid[0:27, 0:21].T \quad | \quad shape: (21, 27, 2) n p . m g r i d [ 0 : c l , 0 : r w ] . T = n p . m g r i d [ 0 : 27 , 0 : 21 ] . T ∣ s ha p e : ( 21 , 27 , 2 )
n p . m g r i d [ 0 : c l , 0 : r w ] . T . r e s h a p e ( − 1 , 2 ) = n p . m g r i d [ 0 : 27 , 0 : 21 ] . T . r e s h a p e ( − 1 , 2 ) ∣ s h a p e ( 567 , 2 ) np.mgrid[0:cl, 0:rw].T.reshape(-1, 2) = np.mgrid[0:27, 0:21].T.reshape(-1, 2) \quad | \quad shape(567, 2) n p . m g r i d [ 0 : c l , 0 : r w ] . T . res ha p e ( − 1 , 2 ) = n p . m g r i d [ 0 : 27 , 0 : 21 ] . T . res ha p e ( − 1 , 2 ) ∣ s ha p e ( 567 , 2 )
blobdetc
picklekp pickle.dump
kpsort1 💡
Sort the keypoints from left to right, from top to bottom!
d1_sq: The point that has the farthest distance from the end of the image. That is to say, the one that is closest to the origin point. Purpose: Find the beginning of the dots.
Different cases of I & j:
i=0, j=0 i>0, j=0 i>0, j>0
fitpinhole l e n ( o b j p o i n t s ) = 1 ∣ n p . s h a p e ( o b j p o i n t s [ 0 ] ) : ( 567 , 3 ) len\left(objpoints\right) = 1 \quad | \quad np.shape\left(objpoints\left[0\right]\right): \left(567, 3\right) l e n ( o bj p o in t s ) = 1 ∣ n p . s ha p e ( o bj p o in t s [ 0 ] ) : ( 567 , 3 )
l e n ( i m g p o i n t s ) = 1 ∣ n p . s h a p e ( i m g p o i n t s [ 0 ] ) : ( 567 , 1 , 2 ) len\left(imgpoints\right) = 1 \quad | \quad np.shape\left(imgpoints\left[0\right]\right): \left(567, 1, 2\right) l e n ( im g p o in t s ) = 1 ∣ n p . s ha p e ( im g p o in t s [ 0 ] ) : ( 567 , 1 , 2 )
Official OpenCV code ret = retval: the overall RMS re-projection error. mtx = cameraMatrix: Input/output 3x3 floating-point camera intrinsic matrix A. A = K = [ f x c x f y c y 1.0 ] = [ f μ x c x f μ y c y 1.0 ] = [ 1943.333333 0.0 963.5 0.0 1943.333333 603.5 0.0 0.0 1.0 ] A=K=\begin{bmatrix}fx&&cx\\&fy&cy\\&&1.0\end{bmatrix}=\begin{bmatrix}\frac{f}{\mu_{x}}&&cx\\&\frac{f}{\mu_{y}}&cy\\&&1.0\end{bmatrix}=\begin{bmatrix}1943.333333&0.0&963.5\\0.0&1943.333333&603.5\\0.0&0.0&1.0\end{bmatrix} A = K = f x f y c x cy 1.0 = μ x f μ y f c x cy 1.0 = 1943.333333 0.0 0.0 0.0 1943.333333 0.0 963.5 603.5 1.0 If CALIB_USE_INTRINSIC_GUESS and/or CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be initialized before calling the function. dist = distCoeffs: Input/output vector of distortion coefficients "A vector"of 4, 5, 8, 12 or 14 elements. D = ( k 1 , k 2 , p 1 , p 2 [ , k 3 [ , k 4 , k 5 , k 6 [ , s 1 , s 2 , s 3 , s 4 [ , τ x , τ y ] ] ] ] ) D=(k1,k2,p1,p2[,k3[,k4,k5,k6[,s1,s2,s3,s4[,\tau _x,\tau _y]]]]) D = ( k 1 , k 2 , p 1 , p 2 [ , k 3 [ , k 4 , k 5 , k 6 [ , s 1 , s 2 , s 3 , s 4 [ , τ x , τ y ]]]]) rvecs: Output vector of rotation vectors (Rodrigues ) estimated for each pattern view (e.g. std::vectorcv::Mat>). That is, each i-th rotation vector together with the corresponding i-th translation vector (see the next output parameter description) brings the calibration pattern from the object coordinate space (in which object points are specified) to the camera coordinate space. In more technical terms, the tuple of the i-th rotation and translation vector performs a change of basis from object coordinate space to camera coordinate space. Due to its duality, this tuple is equivalent to the position of the calibration pattern with respect to the camera coordinate space. tvecs: Output vector of translation vectors estimated for each pattern view, see parameter describtion above.
fitfisheye links about the "criteria" opencv python K-Means聚类
K-Means Clustering in OpenCV cv2.kmeans(data, K, bestLabels, criteria, attempts, flags[, centers]) -> retval, bestLabels, centers data: np.float32数据类型,每个功能应该放在一个列中 nclusters(K):集群数 bestLabels:预设的分类标签:没有的话 None criteria:它是迭代终止标准,满足此条件时,算法迭代停止,实际上,它应该是3个参数的元组。它们是(type,max_iter,epsilon) type又有两种选择: cv2.TERM_CRITERIA_EPS - 如果达到指定的精度epsilon,则停止算法迭代。 cv.TERM_CRITERIA_MAX_ITER - 在指定的迭代次数max_iter之后停止算法。 cv.TERM_CRITERIA_EPS+ cv.TERM_CRITERIA_MAX_ITER - 当满足上述任何条件时停止迭代。 max_iter - 指定最大迭代次数的整数 epsilon - 要求的准确性 attempts:重复试验kmeans算法次数,将会返回最好的一次结果 flags:该标志用于指定初始中心的采用方式。通常会使用两个标志:cv2.KMEANS_PP_CENTERS和cv2.KMEANS_RANDOM_CENTERS retval:它是从每个点到它们相应中心的平方距离之和 bestLabels:这是标签数组 centers:这是一组聚类中心 假设只有一个特征的数据,即一维的,我们可以采用我们的T恤问题,只使用人的高度来决定T恤的大小。因此,我们首先创建数据并在Matplotlib中绘制它 import numpy as np import cv2 import matplotlib.pyplot as plt x = np.random.randint(25,100,25) y = np.random.randint(175,255,25) z = np.hstack((x,y)) z = z.reshape((50,1)) z = np.float32(z) plt.hist(z,256,[0,256]),plt.show() 现在我们应用KMeans功能。我们的标准是,每当运行10次迭代算法或达到epsilon = 1.0的精度时,停止算法并返回答案.
https://segmentfault.com/a/1190000015844795
OpenCV official codes ret = retval: the overall RMS re-projection error 均方根(RMS)重投影误差 cam_mtx = K: Output 3x3 floating-point camera intrinsic matrix A. A = K = [ f x c x f y c y 1.0 ] = [ f μ x c x f μ y c y 1.0 ] = [ 1943.333333 0.0 963.5 0.0 1943.333333 603.5 0.0 0.0 1.0 ] A=K=\begin{bmatrix}fx&&cx\\&fy&cy\\&&1.0\end{bmatrix}=\begin{bmatrix}\frac{f}{\mu_{x}}&&cx\\&\frac{f}{\mu_{y}}&cy\\&&1.0\end{bmatrix}=\begin{bmatrix}1943.333333&0.0&963.5\\0.0&1943.333333&603.5\\0.0&0.0&1.0\end{bmatrix} A = K = f x f y c x cy 1.0 = μ x f μ y f c x cy 1.0 = 1943.333333 0.0 0.0 0.0 1943.333333 0.0 963.5 603.5 1.0 If fisheye::CALIB_USE_INTRINSIC_GUESS is specified, some or all of fx, fy, cx, cy must be initialized before calling the function. cam_dist = D: Output vector of distortion coefficients. D = ( k 1 , k 2 , k 3 , k 4 ) D=\left(k_1, k_2, k_3, k_4 \right) D = ( k 1 , k 2 , k 3 , k 4 ) rvecsf = rvecs: Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view. That is, each k-th rotation vector together with the corresponding k-th translation vector (see the next output parameter description) brings the calibration pattern from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the calibration pattern in the k-th pattern view (k=0.. M -1). tvecsf = tvecs: Output vector of translation vectors estimated for each pattern view.
l e n ( o b j p o i n t s ) = 1 ∣ n p . s h a p e ( o b j p o i n t s [ 0 ] ) : ( 567 , 3 ) len\left(objpoints\right) = 1 \quad | \quad np.shape\left(objpoints\left[0\right]\right): \left(567, 3\right) l e n ( o bj p o in t s ) = 1 ∣ n p . s ha p e ( o bj p o in t s [ 0 ] ) : ( 567 , 3 )
n p . r e s i z e ( x , ( l e n ( x ) , 1 , 3 ) ) = n p . r e s i z e ( o b j p o i n t s [ 0 ] , ( 567 , 1 , 3 ) ) np.resize\left(x, \left(len\left(x\right), 1, 3\right)\right) = np.resize\left(objpoints\left[0\right], \left(567, 1, 3\right)\right) n p . res i ze ( x , ( l e n ( x ) , 1 , 3 ) ) = n p . res i ze ( o bj p o in t s [ 0 ] , ( 567 , 1 , 3 ) )
n p . t r a n s p o s e ( n p . r e s i z e ( x , ( l e n ( x ) , 1 , 3 ) ) , a x e s = [ 1 , 0 , 2 ] ) = n p . t r a n s p o s e ( n p . r e s i z e ( o b j p o i n t s [ 0 ] , ( 567 , 1 , 3 ) ) , a x e s = [ 1 , 0 , 2 ] ) np.transpose\left(np.resize\left(x, \left(len\left(x\right), 1, 3\right)\right), axes=\left[1, 0, 2\right]\right) = np.transpose\left(np.resize\left(objpoints\left[0\right], \left(567, 1, 3\right)\right), axes=\left[1, 0, 2\right]\right) n p . t r an s p ose ( n p . res i ze ( x , ( l e n ( x ) , 1 , 3 ) ) , a x es = [ 1 , 0 , 2 ] ) = n p . t r an s p ose ( n p . res i ze ( o bj p o in t s [ 0 ] , ( 567 , 1 , 3 ) ) , a x es = [ 1 , 0 , 2 ] ) n o . s h a p e ( ) : ( 1 , 567 , 3 ) no.shape\left( \right): \left(1, 567, 3\right) n o . s ha p e ( ) : ( 1 , 567 , 3 )
l e n ( i m g p o i n t s ) = 1 ∣ n p . s h a p e ( i m g p o i n t s [ 0 ] ) : ( 567 , 1 , 2 ) len\left(imgpoints\right) = 1 \quad | \quad np.shape\left(imgpoints\left[0\right]\right): \left(567, 1, 2\right) l e n ( im g p o in t s ) = 1 ∣ n p . s ha p e ( im g p o in t s [ 0 ] ) : ( 567 , 1 , 2 )
n p . r e s i z e ( x , ( l e n ( x ) , 1 , 2 ) ) = n p . r e s i z e ( i m g p o i n t s [ 0 ] , ( 567 , 1 , 2 ) ) np.resize\left(x, \left(len\left(x\right), 1, 2\right)\right) = np.resize\left(imgpoints\left[0\right], \left(567, 1, 2\right)\right) n p . res i ze ( x , ( l e n ( x ) , 1 , 2 ) ) = n p . res i ze ( im g p o in t s [ 0 ] , ( 567 , 1 , 2 ) )
n p . t r a n s p o s e ( n p . r e s i z e ( x , ( l e n ( x ) , 1 , 2 ) ) , a x e s = [ 1 , 0 , 2 ] ) = n p . t r a n s p o s e ( n p . r e s i z e ( i m g p o i n t s [ 0 ] , ( 567 , 1 , 2 ) ) , a x e s = [ 1 , 0 , 2 ] ) np.transpose\left(np.resize\left(x, \left(len\left(x\right), 1, 2\right)\right), axes=\left[1, 0, 2\right]\right) = np.transpose\left(np.resize\left(imgpoints\left[0\right], \left(567, 1, 2\right)\right), axes=\left[1, 0, 2\right]\right) n p . t r an s p ose ( n p . res i ze ( x , ( l e n ( x ) , 1 , 2 ) ) , a x es = [ 1 , 0 , 2 ] ) = n p . t r an s p ose ( n p . res i ze ( im g p o in t s [ 0 ] , ( 567 , 1 , 2 ) ) , a x es = [ 1 , 0 , 2 ] ) n o . s h a p e ( ) : ( 1 , 567 , 2 ) no.shape\left( \right): \left(1, 567, 2\right) n o . s ha p e ( ) : ( 1 , 567 , 2 )
fitpinhole & fitfisheye (All images) Links related to my attempt to accelerate or simplify the calculation. My failed attempt to calculate the "retval" r e t v a l ≠ Σ n = 0 n = N [ ( x n − x n ′ ) 2 + ( y n − y n ′ ) 2 ] N = ( x 0 − x 0 ′ ) 2 + ( y 0 − y 0 ′ ) 2 + ( x 1 − x 1 ′ ) 2 + ( y 1 − y 1 ′ ) 2 + . . . N retval\ne\sqrt{\frac{\Sigma_{n=0}^{n=N}[(x_n-x_n')^2+(y_n-y_n')^2]}{N}}=\sqrt{\cfrac{(x_0-x_0')^2+(y_0-y_0')^2+(x_1-x_1')^2+(y_1-y_1')^2+...}{N}} re t v a l = N Σ n = 0 n = N [( x n − x n ′ ) 2 + ( y n − y n ′ ) 2 ] = N ( x 0 − x 0 ′ ) 2 + ( y 0 − y 0 ′ ) 2 + ( x 1 − x 1 ′ ) 2 + ( y 1 − y 1 ′ ) 2 + ... r e t v a l ≠ Σ n = 0 n = N [ ( x n − x n ′ ) + ( y n − y n ′ ) ] 2 N = [ ( x 0 − x 0 ′ ) + ( y 0 − y 0 ′ ) ] 2 + [ ( x 1 − x 1 ′ ) + ( y 1 − y 1 ′ ) ] 2 + . . . N retval\ne \frac{\sqrt{\Sigma_{n=0}^{n=N}[(x_n-x_n')+(y_n-y_n')]^2}}{N}=\cfrac{\sqrt{[(x_0-x_0')+(y_0-y_0')]^2+[(x_1-x_1')+(y_1-y_1')]^2+...}}{N} re t v a l = N Σ n = 0 n = N [( x n − x n ′ ) + ( y n − y n ′ ) ] 2 = N [( x 0 − x 0 ′ ) + ( y 0 − y 0 ′ ) ] 2 + [( x 1 − x 1 ′ ) + ( y 1 − y 1 ′ ) ] 2 + ... r e t v a l ≠ Σ n = 0 n = N [ ( x n − x n ′ ) 2 + ( y n − y n ′ ) 2 ] N = ( x 0 − x 0 ′ ) 2 + ( y 0 − y 0 ′ ) 2 + ( x 1 − x 1 ′ ) 2 + ( y 1 − y 1 ′ ) 2 + . . . N retval\ne \frac{\sqrt{\Sigma_{n=0}^{n=N}[(x_n-x_n')^2+(y_n-y_n')^2]}}{N}=\cfrac{\sqrt{(x_0-x_0')^2+(y_0-y_0')^2+(x_1-x_1')^2+(y_1-y_1')^2+...}}{N} re t v a l = N Σ n = 0 n = N [( x n − x n ′ ) 2 + ( y n − y n ′ ) 2 ] = N ( x 0 − x 0 ′ ) 2 + ( y 0 − y 0 ′ ) 2 + ( x 1 − x 1 ′ ) 2 + ( y 1 − y 1 ′ ) 2 + ...
r m s = Σ n ( x 2 ( n ) ) N rms = \sqrt{\frac{\Sigma_n(x^2(n))}{N}} r m s = N Σ n ( x 2 ( n )) e r r = Σ i ( d e l t a x ( i ) 2 + d e l t a y ( i ) 2 ) _err = \Sigma_i(deltax(i)^2+deltay(i)^2) e rr = Σ i ( d e lt a x ( i ) 2 + d e lt a y ( i ) 2 ) fitpinhole r e t P = r e t m t x = m t x d i s t = d i s t p _ r v e c s = r v e c s p _ t v e c s = t v e c s retP=ret \quad mtx=mtx \quad dist=dist \quad p\_rvecs=rvecs \quad p\_tvecs=tvecs re tP = re t m t x = m t x d i s t = d i s t p _ r v ecs = r v ecs p _ t v ecs = t v ecs l e n ( o b j p o i n t s ) = 42 ∣ n p . s h a p e ( o b j p o i n t s [ 0 ] ) : ( 567 , 3 ) len\left(objpoints\right) = 42 \quad | \quad np.shape\left(objpoints\left[0\right]\right): \left(567, 3\right) l e n ( o bj p o in t s ) = 42 ∣ n p . s ha p e ( o bj p o in t s [ 0 ] ) : ( 567 , 3 )
l e n ( i m g p o i n t s ) = 42 ∣ n p . s h a p e ( i m g p o i n t s [ 0 ] ) : ( 567 , 1 , 2 ) len\left(imgpoints\right) = 42 \quad | \quad np.shape\left(imgpoints\left[0\right]\right): \left(567, 1, 2\right) l e n ( im g p o in t s ) = 42 ∣ n p . s ha p e ( im g p o in t s [ 0 ] ) : ( 567 , 1 , 2 )
fitfisheye r e t F = r e t c a m _ m t x = c a m _ m t x c a m _ d i s t = c a m _ d i s t c a m _ r v e c s = r v e c s f c a m _ t v e c s = t v e c s f retF=ret \quad cam\_mtx=cam\_mtx \quad cam\_dist=cam\_dist \quad cam\_rvecs=rvecsf \quad cam\_tvecs=tvecsf re tF = re t c am _ m t x = c am _ m t x c am _ d i s t = c am _ d i s t c am _ r v ecs = r v ecs f c am _ t v ecs = t v ecs f l e n ( o b j p o i n t s ) = 42 ∣ n p . s h a p e ( o b j p o i n t s [ 0 ] ) : ( 567 , 3 ) len\left(objpoints\right) = 42 \quad | \quad np.shape\left(objpoints\left[0\right]\right): \left(567, 3\right) l e n ( o bj p o in t s ) = 42 ∣ n p . s ha p e ( o bj p o in t s [ 0 ] ) : ( 567 , 3 )
l e n ( i m g p o i n t s ) = 42 ∣ n p . s h a p e ( i m g p o i n t s [ 0 ] ) : ( 567 , 1 , 2 ) len\left(imgpoints\right) = 42 \quad | \quad np.shape\left(imgpoints\left[0\right]\right): \left(567, 1, 2\right) l e n ( im g p o in t s ) = 42 ∣ n p . s ha p e ( im g p o in t s [ 0 ] ) : ( 567 , 1 , 2 )
pinholeFOV A = K = [ f x c x f y c y 1.0 ] = [ f μ x c x f μ y c y 1.0 ] = [ 1943.333333 0.0 963.5 0.0 1943.333333 603.5 0.0 0.0 1.0 ] A=K=\begin{bmatrix}fx&&cx\\&fy&cy\\&&1.0\end{bmatrix}=\begin{bmatrix}\frac{f}{\mu_{x}}&&cx\\&\frac{f}{\mu_{y}}&cy\\&&1.0\end{bmatrix}=\begin{bmatrix}1943.333333&0.0&963.5\\0.0&1943.333333&603.5\\0.0&0.0&1.0\end{bmatrix} A = K = f x f y c x cy 1.0 = μ x f μ y f c x cy 1.0 = 1943.333333 0.0 0.0 0.0 1943.333333 0.0 963.5 603.5 1.0 D = ( k 1 , k 2 , p 1 , p 2 [ , k 3 [ , k 4 , k 5 , k 6 [ , s 1 , s 2 , s 3 , s 4 [ , τ x , τ y ] ] ] ] ) D=(k1,k2,p1,p2[,k3[,k4,k5,k6[,s1,s2,s3,s4[,\tau _x,\tau _y]]]]) D = ( k 1 , k 2 , p 1 , p 2 [ , k 3 [ , k 4 , k 5 , k 6 [ , s 1 , s 2 , s 3 , s 4 [ , τ x , τ y ]]]]) r = x 2 + y 2 r=x^2+y^2 r = x 2 + y 2 { e q 1 = f x ⋅ [ x ⋅ 1 + k 1 ⋅ r + k 2 ⋅ r 2 + k 3 ⋅ r 3 1 + k 4 ⋅ r + k 5 ⋅ r 2 + k 6 ⋅ r 3 + 2 ⋅ p 1 ⋅ x ⋅ y + p 2 ( r + 2 x 2 ) ] + c x − x p i x = 0 e q 2 = f y ⋅ [ y ⋅ 1 + k 1 ⋅ r + k 2 ⋅ r 2 + k 3 ⋅ r 3 1 + k 4 ⋅ r + k 5 ⋅ r 2 + k 6 ⋅ r 3 + 2 ⋅ p 2 ⋅ x ⋅ y + p 1 ( r + 2 y 2 ) ] + c y − y p i x = 0 \begin{cases}eq1=fx\cdot\left[x\cdot\cfrac{1+k1\cdot r+k2\cdot r^2+k3\cdot r^3}{1+k4\cdot r+k5\cdot r^2+k6\cdot r^3}+2\cdot p1\cdot x\cdot y+p2(r+2x^2)\right]+cx-xpix=0\\ eq2=fy\cdot\left[y\cdot\cfrac{1+k1\cdot r+k2\cdot r^2+k3\cdot r^3}{1+k4\cdot r+k5\cdot r^2+k6\cdot r^3}+2\cdot p2\cdot x\cdot y+p1\left(r+2y^2\right)\right]+cy-ypix=0\end{cases} ⎩ ⎨ ⎧ e q 1 = f x ⋅ [ x ⋅ 1 + k 4 ⋅ r + k 5 ⋅ r 2 + k 6 ⋅ r 3 1 + k 1 ⋅ r + k 2 ⋅ r 2 + k 3 ⋅ r 3 + 2 ⋅ p 1 ⋅ x ⋅ y + p 2 ( r + 2 x 2 ) ] + c x − x p i x = 0 e q 2 = f y ⋅ [ y ⋅ 1 + k 4 ⋅ r + k 5 ⋅ r 2 + k 6 ⋅ r 3 1 + k 1 ⋅ r + k 2 ⋅ r 2 + k 3 ⋅ r 3 + 2 ⋅ p 2 ⋅ x ⋅ y + p 1 ( r + 2 y 2 ) ] + cy − y p i x = 0 [ u v ] = [ f x x ′ ′ + c x f y y ′ ′ + c y ] ⟹ { f x x ′ ′ + c x − u = 0 f y y ′ ′ + c y − v = 0 \begin{bmatrix}
u \\
v
\end{bmatrix}=\begin{bmatrix}
f_{x} x^{\prime \prime}+c_{x} \\
f_{y} y^{\prime \prime}+c_{y}
\end{bmatrix}
\Longrightarrow
\begin{cases}
f_{x} x^{\prime \prime}+c_{x}-u=0\\
f_{y} y^{\prime \prime}+c_{y}-v=0
\end{cases} [ u v ] = [ f x x ′′ + c x f y y ′′ + c y ] ⟹ { f x x ′′ + c x − u = 0 f y y ′′ + c y − v = 0 Schematic Diagram
FisheyeFOV
Process & Write & Print data External Reference [ X C Y C Z C ] = R [ X W Y W Z W ] + T \begin{bmatrix}X_C \\Y_C \\Z_C\end{bmatrix}=\boldsymbol{R}\begin{bmatrix}X_W \\Y_W \\Z_W\end{bmatrix}+\boldsymbol{T} X C Y C Z C = R X W Y W Z W + T [ X C Y C Z C 1 ] = [ R T 0 T 1 ] [ X W Y W Z W 1 ] = M 1 [ X W Y W Z W 1 ] = [ cos ψ cos θ sin ψ cos θ − sin θ X W − sin ψ cos ϕ + cos ψ sin θ sin ϕ cos ψ cos ϕ + sin ψ sin θ sin ϕ cos θ sin ϕ Y W sin ψ sin ϕ + cos ψ sin θ cos ϕ − cos ψ sin ϕ + sin ψ sin θ sin ϕ cos θ cos ϕ Z W 0 0 0 1 ] [ X W Y W Z W 1 ] \begin{bmatrix}
X_C \\
Y_C \\
Z_C \\
1
\end{bmatrix}=\begin{bmatrix}
\boldsymbol{R} & \boldsymbol{T} \\
0^{T} & 1
\end{bmatrix}\begin{bmatrix}
X_W \\
Y_W \\
Z_W \\
1
\end{bmatrix}=M_1\begin{bmatrix}
X_{W} \\
Y_{W} \\
Z_{W} \\
1
\end{bmatrix}
= \begin{bmatrix}
\cos \psi \cos \theta & \sin \psi \cos \theta & -\sin \theta & X_W\\
-\sin \psi \cos \phi+\cos \psi \sin \theta \sin \phi & \cos \psi \cos \phi+\sin \psi \sin \theta \sin \phi & \cos \theta \sin \phi & Y_W\\
\sin \psi \sin \phi+\cos \psi \sin \theta \cos \phi & -\cos \psi \sin \phi+\sin \psi \sin \theta \sin \phi & \cos \theta \cos \phi & Z_W \\
0 & 0 & 0 & 1\end{bmatrix}\begin{bmatrix}
X_W \\
Y_W \\
Z_W \\
1
\end{bmatrix} X C Y C Z C 1 = [ R 0 T T 1 ] X W Y W Z W 1 = M 1 X W Y W Z W 1 = cos ψ cos θ − sin ψ cos ϕ + cos ψ sin θ sin ϕ sin ψ sin ϕ + cos ψ sin θ cos ϕ 0 sin ψ cos θ cos ψ cos ϕ + sin ψ sin θ sin ϕ − cos ψ sin ϕ + sin ψ sin θ sin ϕ 0 − sin θ cos θ sin ϕ cos θ cos ϕ 0 X W Y W Z W 1 X W Y W Z W 1 R = [ cos ψ cos θ sin ψ cos θ − sin θ − sin ψ cos ϕ + cos ψ sin θ cos ϕ cos ψ cos ϕ + sin ψ sin θ sin ϕ cos θ sin ϕ sin ψ sin ϕ + cos ψ sin θ cos ϕ − cos ψ sin ϕ + sin ψ sin θ sin ϕ cos θ cos ϕ ] R= \begin{bmatrix}
\cos \psi \cos \theta & \sin \psi \cos \theta & -\sin \theta \\
-\sin \psi \cos \phi+\cos \psi \sin \theta \cos \phi & \cos \psi \cos \phi+\sin \psi \sin \theta \sin \phi & \cos \theta \sin \phi \\
\sin \psi \sin \phi+\cos \psi \sin \theta \cos \phi & -\cos \psi \sin \phi+\sin \psi \sin \theta \sin \phi & \cos \theta \cos \phi \end{bmatrix}
R = cos ψ cos θ − sin ψ cos ϕ + cos ψ sin θ cos ϕ sin ψ sin ϕ + cos ψ sin θ cos ϕ sin ψ cos θ cos ψ cos ϕ + sin ψ sin θ sin ϕ − cos ψ sin ϕ + sin ψ sin θ sin ϕ − sin θ cos θ sin ϕ cos θ cos ϕ T = [ X W Y W Z W ] T T=\begin{bmatrix}
X_W & Y_W & Z_W\end{bmatrix}^T T = [ X W Y W Z W ] T Internal Reference { u = u 0 + x μ x − y cot θ μ x v = v 0 + y μ y sin θ \begin{cases}u=u_{0}+\frac{x}{\mu_{x}}-\frac{y \cot \theta}{\mu_{x}} \\v=v_{0}+\frac{y}{\mu_{y} \sin \theta}\end{cases} { u = u 0 + μ x x − μ x y c o t θ v = v 0 + μ y s i n θ y [ u v 1 ] = [ 1 μ x − 1 μ x cot θ u 0 0 1 μ y 1 sin θ v 0 0 0 1 ] [ x y 1 ] \begin{bmatrix}
u \\
v \\
1
\end{bmatrix}=\begin{bmatrix}
\frac{1}{\mu_{x}} & -\frac{1}{\mu_{x}} \cot \theta & u_{0} \\
0 & \frac{1}{\mu_{y}} \frac{1}{\sin \theta} & v_{0} \\
0 & 0 & 1
\end{bmatrix}\begin{bmatrix}
x \\
y \\
1
\end{bmatrix} u v 1 = μ x 1 0 0 − μ x 1 cot θ μ y 1 s i n θ 1 0 u 0 v 0 1 x y 1 X P x Q = Z p f , Y P y Q = Z P f ⟹ x = f X C Z C , y = f Y C Z C \frac{X_{P}}{x_{Q}}=\frac{Z_{p}}{f}, \quad \frac{Y_{P}}{y_{Q}}=\frac{Z_{P}}{f} \quad \Longrightarrow \quad x=\frac{f X_{C}}{Z_{C}}, \quad y=\frac{f Y_{C}}{Z_{C}} x Q X P = f Z p , y Q Y P = f Z P ⟹ x = Z C f X C , y = Z C f Y C Z C [ x y 1 ] = [ f 0 0 0 0 f 0 0 0 0 1 0 ] [ X C Y C Z C 1 ] Z_{C}\begin{bmatrix}x \\y \\1\end{bmatrix}=\begin{bmatrix}f & 0 & 0 & 0 \\0 & f & 0 & 0 \\0 & 0 & 1 & 0\end{bmatrix}\begin{bmatrix}X_{C} \\Y_{C} \\Z_{C} \\1\end{bmatrix} Z C x y 1 = f 0 0 0 f 0 0 0 1 0 0 0 X C Y C Z C 1 Z C [ u v 1 ] = [ 1 μ x − 1 μ x cot θ u 0 0 1 μ y 1 sin θ v 0 0 0 1 ] [ f x 0 0 0 0 f y 0 0 0 0 1 0 ] [ R T 0 T 1 ] [ X W Y W Z W 1 ] = [ f x − f x cot θ u 0 0 0 f y 1 sin θ v 0 0 0 0 1 0 ] [ R T 0 T 1 ] [ X W Y W Z W 1 ] = M 1 M 2 [ X W Y W Z W 1 ] = M [ X W Y W Z W 1 ] Z_{C}\begin{bmatrix}u \\v \\1\end{bmatrix}=\begin{bmatrix}\frac{1}{\mu_{x}} & -\frac{1}{\mu_{x}} \cot \theta & u_{0} \\0 & \frac{1}{\mu_{y}} \frac{1}{\sin \theta} & v_{0} \\0 & 0 & 1\end{bmatrix}\begin{bmatrix}f_x & 0 & 0 & 0 \\0 & f_y & 0 & 0 \\0 & 0 & 1 & 0\end{bmatrix}\begin{bmatrix}\boldsymbol{R} & \boldsymbol{T} \\0^{T} & 1\end{bmatrix}\begin{bmatrix}X_{W} \\Y_{W} \\Z_{W} \\1\end{bmatrix} \\=\begin{bmatrix}f_{x} & -f_{x} \cot \theta & u_{0} & 0 \\0 & f_{y} \frac{1}{\sin \theta} & v_{0} & 0 \\0 & 0 & 1 & 0\end{bmatrix}\begin{bmatrix}\boldsymbol{R} & \boldsymbol{T} \\0^{T} & 1\end{bmatrix}\begin{bmatrix}X_{W} \\Y_{W} \\Z_{W} \\1\end{bmatrix}=\boldsymbol{M}_{1} M_{2}\begin{bmatrix}X_{W} \\Y_{W} \\Z_{W} \\1\end{bmatrix}=M\begin{bmatrix}X_{W} \\Y_{W} \\Z_{W} \\1\end{bmatrix} Z C u v 1 = μ x 1 0 0 − μ x 1 cot θ μ y 1 s i n θ 1 0 u 0 v 0 1 f x 0 0 0 f y 0 0 0 1 0 0 0 [ R 0 T T 1 ] X W Y W Z W 1 = f x 0 0 − f x cot θ f y s i n θ 1 0 u 0 v 0 1 0 0 0 [ R 0 T T 1 ] X W Y W Z W 1 = M 1 M 2 X W Y W Z W 1 = M X W Y W Z W 1 f x = f μ x , f y = f μ y f_{x}=\frac{f}{\mu_{x}}, \quad f_{y}=\frac{f}{\mu_{y}} f x = μ x f , f y = μ y f Not shown in data. Just for intuitive illustration.
μ x 、 μ x \mu _{x}、\mu _{x} μ x 、 μ x 表示单一像素在x轴和y轴方向上的物理长度(其单位可理解为 mm/像素)。θ \theta θ 表示u轴和v轴之间的夹角,理想情况下θ = 90 ∘ \theta =90^{\circ} θ = 9 0 ∘ 。图像像素坐标系(pixel coordinate system)( u , v ) (u, v) ( u , v ) 图像物理坐标系(retinal coordinate system,or像平面坐标系,单位常用mm)( x , y ) (x, y) ( x , y ) 相机坐标系(camera coordinate system) ( X C , Y C , Z C ) ⟶ ( X P , Y P , Z P ) (X_C, Y_C, Z_C) \longrightarrow (X_P, Y_P, Z_P)\quad ( X C , Y C , Z C ) ⟶ ( X P , Y P , Z P ) Equivalent to pinhole camera modelImages that demonstrate the camera coordinate system 世界坐标系( X W , Y W , Z W ) (X_W, Y_W, Z_W) ( X W , Y W , Z W ) 💡
张正友标定法仅仅考虑了畸变模型中影响较大的径向畸变。
Said by a Postgraduate from SJTU.
Really? Maybe this conclusion deserves more consideration.
A = K = [ f x c x f y c y 1 ] = [ f μ x c x f μ y c y 1 ] A=K=\begin{bmatrix}f_x&&c_x\\&f_y&c_y\\&&1\end{bmatrix}=\begin{bmatrix}\frac{f}{\mu_{x}}&&c_x\\&\frac{f}{\mu_{y}}&c_y\\&&1\end{bmatrix} A = K = f x f y c x c y 1 = μ x f μ y f c x c y 1 Input/output 3x3 floating-point camera intrinsic matrix.
D = ( k 1 , k 2 , p 1 , p 2 [ , k 3 [ , k 4 , k 5 , k 6 [ , s 1 , s 2 , s 3 , s 4 [ , τ x , τ y ] ] ] ] ) D=(k1,k2,p1,p2[,k3[,k4,k5,k6[,s1,s2,s3,s4[,\tau _x,\tau _y]]]]) D = ( k 1 , k 2 , p 1 , p 2 [ , k 3 [ , k 4 , k 5 , k 6 [ , s 1 , s 2 , s 3 , s 4 [ , τ x , τ y ]]]]) Input/output vector of distortion coefficients.
F o u n d = f o u n d p Found=foundp \quad F o u n d = f o u n d p Number of pictures whose
retP
is less than 2.
F i t _ e r r o r = r e t P Fit\_error=retP\quad
F i t _ error = re tP the overall RMS re-projection error from
fitpinhole
F x = m t x [ 0 , 0 ] F_x=mtx[0, 0]\quad F x = m t x [ 0 , 0 ] f x f_x f x in camera intrinsic matrix from
fitpinhole
F y = m t x [ 1 , 1 ] F_y=mtx[1, 1]\quad F y = m t x [ 1 , 1 ] f y f_y f y in camera intrinsic matrix from
fitpinhole
C x = m t x [ 0 , 2 ] Cx=mtx[0, 2]\quad C x = m t x [ 0 , 2 ] c x cx c x in camera intrinsic matrix
from
fitpinhole
C y = m t x [ 1 , 2 ] Cy=mtx[1, 2]\quad C y = m t x [ 1 , 2 ] c y cy cy in camera intrinsic matrix from
fitpinhole
D _ K 1 = d i s t [ 0 , 0 ] D\_K1=dist[0, 0]\quad
D _ K 1 = d i s t [ 0 , 0 ] k 1 k1 k 1 in distortion coefficients from
fitpinhole
D _ K 2 = d i s t [ 1 , 0 ] D\_K2=dist[1, 0]\quad
D _ K 2 = d i s t [ 1 , 0 ] k 2 k2 k 2 in distortion coefficients from
fitpinhole
D _ P 1 = d i s t [ 2 , 0 ] D\_P1=dist[2, 0]\quad
D _ P 1 = d i s t [ 2 , 0 ] p 1 p1 p 1 in distortion coefficients from
fitpinhole
D _ P 2 = d i s t [ 3 , 0 ] D\_P2=dist[3, 0]\quad
D _ P 2 = d i s t [ 3 , 0 ] p 2 p2 p 2 in distortion coefficients from
fitpinhole
D _ K 3 = d i s t [ 4 , 0 ] D\_K3=dist[4, 0]\quad
D _ K 3 = d i s t [ 4 , 0 ] k 3 k3 k 3 in distortion coefficients from
fitpinhole
D _ K 4 = d i s t [ 5 , 0 ] D\_K4=dist[5, 0]\quad
D _ K 4 = d i s t [ 5 , 0 ] k 4 k4 k 4 in distortion coefficients from
fitpinhole
D _ K 5 = d i s t [ 6 , 0 ] D\_K5=dist[6, 0]\quad
D _ K 5 = d i s t [ 6 , 0 ] k 5 k5 k 5 in distortion coefficients from
fitpinhole
D _ K 6 = d i s t [ 7 , 0 ] D\_K6=dist[7, 0]\quad
D _ K 6 = d i s t [ 7 , 0 ] k 6 k6 k 6 in distortion coefficients from
fitpinhole
H F O V = H F O V HFOV=HFOV\quad
H FO V = H FO V from
pinholeFOV
V F O V = V F O V VFOV=VFOV\quad
V FO V = V FO V from
pinholeFOV
A = K = [ f x c x f y c y 1 ] = [ f μ x c x f μ y c y 1 ] A=K=\begin{bmatrix}f_x&&c_x\\&f_y&c_y\\&&1\end{bmatrix}=\begin{bmatrix}\frac{f}{\mu_{x}}&&c_x\\&\frac{f}{\mu_{y}}&c_y\\&&1\end{bmatrix} A = K = f x f y c x c y 1 = μ x f μ y f c x c y 1 Input/output 3x3 floating-point camera intrinsic matrix.
D = ( k 1 , k 2 , k 3 , k 4 ) D=\left(k_1, k_2, k_3, k_4 \right) D = ( k 1 , k 2 , k 3 , k 4 ) Output vector of distortion coefficients.
F F o u n d = f o u n d f F_Found=foundf\quad
F F o u n d = f o u n df Number of pictures whose
retF
is less than 2.
F _ F i t _ e r r o r = r e t F F\_Fit\_error=retF\quad
F _ F i t _ error = re tF the overall RMS re-projection error from
fitfisheye
F _ F x = c a m _ m t x [ 0 , 0 ] F\_F_x=cam\_mtx[0, 0]\quad F _ F x = c am _ m t x [ 0 , 0 ] f x f_x f x in camera intrinsic matrix from
fitfisheye
F _ F y = c a m _ m t x [ 1 , 1 ] F\_F_y=cam\_mtx[1, 1]\quad F _ F y = c am _ m t x [ 1 , 1 ] f y f_y f y in camera intrinsic matrix from
fitfisheye
F _ C x = c a m _ m t x [ 0 , 2 ] F\_Cx=cam\_mtx[0, 2]\quad F _ C x = c am _ m t x [ 0 , 2 ] c x c_x c x in camera intrinsic matrix from
fitfisheye
F _ C y = c a m _ m t x [ 1 , 2 ] F\_Cy=cam\_mtx[1, 2]\quad F _ C y = c am _ m t x [ 1 , 2 ] c y c_y c y in camera intrinsic matrix from
fitfisheye
F _ D _ K 1 = c a m _ d i s t [ 0 , 0 ] F\_D\_K1=cam\_dist[0, 0]\quad
F _ D _ K 1 = c am _ d i s t [ 0 , 0 ] k 1 k1 k 1 in distortion coefficients from
fitfisheye
F _ D _ K 2 = c a m _ d i s t [ 1 , 0 ] F\_D\_K2=cam\_dist[1, 0]\quad
F _ D _ K 2 = c am _ d i s t [ 1 , 0 ] k 2 k2 k 2 in distortion coefficients from
fitfisheye
F _ D _ K 3 = c a m _ d i s t [ 2 , 0 ] F\_D\_K3=cam\_dist[2, 0]\quad
F _ D _ K 3 = c am _ d i s t [ 2 , 0 ] k 3 k3 k 3 in distortion coefficients from
fitfisheye
F _ D _ K 4 = c a m _ d i s t [ 3 , 0 ] F\_D\_K4=cam\_dist[3, 0]\quad
F _ D _ K 4 = c am _ d i s t [ 3 , 0 ] k 4 k4 k 4 in distortion coefficients from
fitfisheye
F _ H F O V = H F O V f F\_HFOV=HFOVf\quad
F _ H FO V = H FO V f from
FisheyeFOV
V F O V = V F O V f VFOV=VFOVf\quad
V FO V = V FO V f from
FisheyeFOV
f x = f μ x , f y = f μ y f_{x}=\frac{f}{\mu_{x}}, \quad f_{y}=\frac{f}{\mu_{y}} f x = μ x f , f y = μ y f E F L x ( m m ) = E F L X = m t x [ 0 , 0 ] ∗ P i x e l s i z e = f x ∗ P i x e l s i z e EFLx(mm) = EFLX = mtx[0, 0] * Pixelsize = fx * Pixelsize EF Lx ( mm ) = EF L X = m t x [ 0 , 0 ] ∗ P i x e l s i ze = f x ∗ P i x e l s i ze E F L y ( m m ) = E F L Y = m t x [ 1 , 1 ] ∗ P i x e l s i z e = f y ∗ P i x e l s i z e EFLy(mm) = EFLY = mtx[1, 1] * Pixelsize = fy * Pixelsize EF L y ( mm ) = EF L Y = m t x [ 1 , 1 ] ∗ P i x e l s i ze = f y ∗ P i x e l s i ze E F L F X = E F L F Y = E F L / P i x e l s i z e EFLFX = EFLFY = EFL / Pixelsize EF L FX = EF L F Y = EF L / P i x e l s i ze Δ E F L x = D E F L x = m t x [ 0 , 0 ] − E F L F X E F L F X = f x − E F L P i x e l s i z e E F L P i x e l s i z e = f μ x − E F L P i x e l s i z e E F L P i x e l s i z e \Delta EFLx=DEFLx = \cfrac{mtx[0, 0] - EFLFX} {EFLFX} = \cfrac{f_x - \cfrac{EFL}{Pixelsize}}{\cfrac{EFL}{Pixelsize}}= \cfrac{\cfrac{f}{\mu_x} - \cfrac{EFL}{Pixelsize}}{\cfrac{EFL}{Pixelsize}} Δ EF Lx = D EF Lx = EF L FX m t x [ 0 , 0 ] − EF L FX = P i x e l s i ze EF L f x − P i x e l s i ze EF L = P i x e l s i ze EF L μ x f − P i x e l s i ze EF L The mtx is from fitpinhole
.
Δ E F L y = D E F L y = m t x [ 1 , 1 ] − E F L F Y E F L F Y = f y − E F L P i x e l s i z e E F L P i x e l s i z e = f μ y − E F L P i x e l s i z e E F L P i x e l s i z e \Delta EFLy=DEFLy = \cfrac{mtx[1, 1] - EFLFY} {EFLFY} = \cfrac{f_y - \cfrac{EFL}{Pixelsize}}{\cfrac{EFL}{Pixelsize}}= \cfrac{\cfrac{f}{\mu_y} - \cfrac{EFL}{Pixelsize}}{\cfrac{EFL}{Pixelsize}} Δ EF L y = D EF L y = EF L F Y m t x [ 1 , 1 ] − EF L F Y = P i x e l s i ze EF L f y − P i x e l s i ze EF L = P i x e l s i ze EF L μ y f − P i x e l s i ze EF L The mtx is from fitpinhole
.
Δ x ( p i x ) = D X = c a m _ m t x [ 0 , 2 ] − ( H r e s / 2 − 0.5 ) = c x − ( H r e s / 2 − 0.5 ) \Delta x(pix)=DX = cam\_mtx[0, 2] - (Hres / 2 - 0.5)=c_x - (Hres / 2 - 0.5) Δ x ( p i x ) = D X = c am _ m t x [ 0 , 2 ] − ( Hres /2 − 0.5 ) = c x − ( Hres /2 − 0.5 ) Δ y ( p i x ) = D Y = c a m _ m t x [ 1 , 2 ] − ( V r e s / 2 − 0.5 ) = c y − ( V r e s / 2 − 0.5 ) \Delta y(pix)=DY = cam\_mtx[1, 2] - (Vres / 2 - 0.5) = c_y - (Vres / 2 - 0.5) Δ y ( p i x ) = D Y = c am _ m t x [ 1 , 2 ] − ( V res /2 − 0.5 ) = c y − ( V res /2 − 0.5 ) The cam_mtx is from fitfisheye
.
Δ H A n g ( d e g ) = D H A n g = D X / ( H r e s ∗ 0.9 / 2 ) ∗ ( H F O V f / 2 ) \Delta HAng (deg)=DHAng = DX / (Hres * 0.9 / 2) * (HFOVf / 2) Δ H A n g ( d e g ) = DH A n g = D X / ( Hres ∗ 0.9/2 ) ∗ ( H FO V f /2 ) Δ V A n g ( d e g ) = D V A n g = D Y / ( V r e s / 2 ) ∗ ( V F O V f / 2 ) \Delta VAng (deg)=DVAng = DY / (Vres / 2) * (VFOVf / 2) Δ V A n g ( d e g ) = D V A n g = D Y / ( V res /2 ) ∗ ( V FO V f /2 )