# Identification of Location and Camera Parameters for Public Live Streaming Web Cameras
## 5 Examples
### Example 1: Inclined Driving Surface and a Camera with Tilted Horizon  
Figure 3 shows a video frame from the public camera. The camera is a good example, as its video contains noticeable perspective and radial distortion. In the image, there is a line demonstrating the camera's slight horizon tilt (the wall at the base of which is \(P^{\rm p}\)). The visible part of the road has a significant inclination. This is a FullHD camera (\(N=1920\), \(M=1080\)). Select a point \(P^{0}\) as the origin of \(F_{emu}\). Assess ENU coordinates of the point \(O\) (the camera position), point \(G\) (the source of the principal point \(C\), Figures 1 and 3), and points \(P^{\rm u}\) and \(P^{\rm p}\) on the lines \(v=c_{v}\) and \(u=c_{u}\), respectively. Using maps and online photos, we obtained the values listed in Table 1. Convert global coordinates to the \(F_{emu}\) coordinates (see [8]) and add it to the table (in meters). \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Name** & **Lat** & **Long** & **Height** & \(\mathbf{u}\) & \(\mathbf{v}\) & \(\mathbf{x_{emu}}\) & \(\mathbf{y_{emu}}\) & \(\mathbf{z_{emu}}\) \\ \hline \(p^{0}\) & 43.175553\({}^{\circ}\) & 131.917725\({}^{\circ}\) & 56 & & & 0 & 0 & 0 \\ \(G\) & 43.176295\({}^{\circ}\) & 131.918380\({}^{\circ}\) & 57 & 960 & 540 & 53.3 & 82.4 & 1 \\ \(O\) & 43.176934\({}^{\circ}\) & 131.917912\({}^{\circ}\) & 98 & & & 15.2 & 153.4 & 42 \\ \(p^{\rm u}\) & 43.176033\({}^{\circ}\) & 131.917937\({}^{\circ}\) & 57 & 1534 & 540 & 17.2 & 53.3 & 1 \\ \(p^{\rm p}\) & 43.175828\({}^{\circ}\) & 131.918728\({}^{\circ}\) & 52 & 960 & 353 & 81.6 & 30.6 & \(-4\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The points used for the calibration. Latitude and longitude in degrees, altitudes and ENU coordinates in meters, coordinates of pixels in \(F_{im}\) units (\(u\) is the column index, \(v\) is the row). Figure 3: Field of view of the public street camera in Vladivostok. Example 1, image \(\Phi\). The points from Table 1 can be found on the satellite layer of [18] using the latitude and longitude of the query. We obtain \(f_{u}=1166.2\) and \(f_{v}=1241.55\) by using (15), (16) and Table 1 data. Street camera image sensors usually have square pixels, so \(w=h\) and \(f_{u}=f_{v}\) (4). If the difference \(f_{u}\) and \(f_{v}\) is small, let \(f_{u},f_{v}\) be equal \(f_{u}=f_{v}=1203.89\) (we use mean value). So we have an approximation of matrix \(A\). Now, we can estimate radial distortion coefficients \(k_{1}\) and \(k_{2}\) by minimizing distances (19) or in another way. Put \(k_{1}=-0.24\) and \(k_{2}=0\) to compute the mapping \(\Theta\) (17) and apply it to eliminate radial distortion \(k_{1}\) and \(k_{2}\) from the original image (\(\Phi\)). The mapping does not change for different frames from the camera video. We obtained the undistorted version of image \(\Phi\), which we have identified \(\hat{\Phi}\) (Figure 4). The radial distortion of the straight lines in the vicinity of the road has almost disappeared in \(\hat{\Phi}\). The camera's field of view decreased, the \(C\) point remained in place, and the \(p_{1}\) and \(p_{2}\) points moved further along the lines \(v=c_{v}\) and \(u=c_{u}\). The values of \(f_{u}\) and \(f_{v}\) can be recalculated, but radial distortion is not the only cause of errors. Therefore, we will perform additional cross-validation and compensate the values of \(f_{u}\) and \(f_{v}\) if required. We can estimate the horizon tilt angle from the image (Figure 4) and rotate the plane with the axes \(X_{v}\) and \(Y_{v}\) of frame \(F_{v}\) around the optical axis \(Z_{c}\) at this angle. As a result of rotating the image around the optical axis of the camera on \(4.1^{\circ}\), the verticality of the required line was achieved (Figure 5), so let \(\gamma=4.1^{\circ}\) in (24). Figure 4: The image after compensation of radial distortion. Example 1, image \(\Phi=\Theta(\Phi)\). We compute the camera orientation matrix \(R\) with (20)-(26). Now, we can convert \(F_{emu}\) coordinates to \(F_{c}\) with (27).