# Identification of Location and Camera Parameters for Public Live Streaming Web Cameras
## 2 Coordinate Systems, Models  
We select an ENU coordinate frame \(F_{emu}\) (East, North, Up) with an origin on a fixed object to localize points \(P=(x_{e},y_{e},z_{e})\), where \(x_{e},y_{e}\), and \(z_{e}\) are coordinates of \(P\) in \(F_{emu}\). A camera forms an image in the sensor (Figures 1 and 2). A digital image is a pixel matrix \(N\times M\) (\(N\) columns, \(M\) rows). A pixel position is described in the image coordinate frame \(F_{im}\) in the image plane \(P_{im}=(u,v)\) where \(u\) and \(v\) are real numbers, coordinates of \(P_{im}\) in \(F_{im}\). Axis \(U\) corresponds to the image matrix rows (towards the right), and axis \(V\) corresponds to columns (from up to down). The camera orientation determines the image sensor plane orientation. Integer indexes define pixel position in the image matrix. We can obtain them by rounding \(u\) and \(v\) to the nearest integers. Let \(w\) and \(h\) be the image pixel width and height, respectively. For the image width and height, we have \(W=Nw\) and \(H=Mh\). Camera position and orientation define the camera coordinate frame \(F_{c}\) (Figure 1). The camera perspective projection center \(O\) is the origin of \(F_{c}\). We denote by \((O_{xe},O_{ye},O_{xe})\) the \(O\) coordinates in \(F_{emu}\). Axis \(Z_{c}\) follows along the camera optical axis, axis \(X_{c}\) is parallel to axis \(U\), and \(Y_{c}\) is parallel to axis \(V\). Axis \(X_{c}\) defines the camera horizon. The deviation of \(X_{c}\) from the horizontal plane \(X_{emu}Y_{emu}\) defines the camera horizon tilt. Unlike \(F_{im}\), the \(F_{emu}\) and \(F_{c}\) are metric coordinate frames. \(F_{im}\) coordinates \((u,v)\) approximate matrix indexes. To obtain meters from \(u\) on axis \(U\), we use the expression \(m(u)=wu\), and to obtain meters from \(v\) on axis \(V\), we use \(m(v)=hv\). Suppose the camera builds an image close to a perspective projection of a 3D scene. We describe this camera transformation as the pinhole camera model (Figures 1 and 2 and ref. [5]). A point image \(P_{im}=(u,v)\) is the transformation of the original 3D point \(P\) coordinates described in \(F_{emu}\). The matrices \(A\) and \([R|t]\) define this transformation:  
\[A= \begin{bmatrix}f_{u}&0&c_{u}\\ 0&f_{v}&c_{v}\\ 0&0&1\end{bmatrix} , \tag{1}\]  
\[[R|t]= \begin{bmatrix}r_{11}&r_{12}&r_{13}&t_{x}\\ r_{21}&r_{22}&r_{23}&t_{y}\\ r_{31}&r_{32}&r_{33}&t_{z}\end{bmatrix} . \tag{2}\]  
The triangular matrix \(A\) contains the intrinsic parameters of the camera. Camera position and orientation determine matrix \([R|t]\). Matrix \([R|t]\) defines transformation from frame \(F_{emu}\) to camera coordinates \(F_{c}\):  
\[ \begin{bmatrix}x_{c}\\ y_{c}\\ z_{c}\end{bmatrix} =[R|t] \begin{bmatrix}x_{e}\\ y_{e}\\ z_{e}\\ 1\end{bmatrix} , \begin{bmatrix}t_{x}\\ t_{y}\\ t_{z}\end{bmatrix} =-R \begin{bmatrix}O_{xe}\\ O_{ye}\\ o_{ze}\end{bmatrix} . \tag{3}\]  
Here, \(R\) is a rotation matrix, and \(t\) is the shift vector from the origin of \(F_{emu}\) to \(O\) (origin of \(F_{c}\)). Matrix \(A\) includes the principal point \(C\) coordinates \((c_{u},c_{v})\) in frame \(F_{im}\) and the camera focal length \(f\) divided by pixel width and height:  
\[f_{u}=f/w,\,f_{v}=f/h.\]The camera's optical axis and the image plane intersect at \(C\). It is the spatial point \(G\) image (Figures 1 and 2). Usually, the coordinates \((c_{u},c_{v})\) point to the image sensor matrix center (e.g., full HD resolution is 1920 \(\times\) 1080, so \(c_{u}=960,c_{v}=540\)). Some modes of cameras can produce cropped images shifted from the principal point; we do not consider this case here. The triangles \((O,P_{im},C)\) and \((O,P,(z_{c},0,0))\) are similar on the plane \(ZX_{c}\) and on \(ZY_{c}\) (Figure 2), so  
\[ \begin{array}{c}x_{c}/z_{c}=w(u-c_{u})/f=\tan\theta_{x}\\ y_{c}/z_{c}=h(v-c_{v})/f=\tan\theta_{y}\end{array} . \tag{5}\]  
It follows from (5) that pixel coordinates in \(F_{im}\) are connected with coordinates of the spatial source in \(F_{c}\) by the equations  
\[P_{im}^{h}= \begin{bmatrix}u\\ v\\ 1\end{bmatrix} =A