# Camera Geolocation Using Digital Elevation Models in Hilly Area
## 4 Propose Method
### Building DEM Skyline Feature Database
#### 4.3.5. Coarse Matching  
In the proposed coarse matching, skyline features are extracted from the image, and the corresponding DEM subdataset is selected according to the heading angle (obtained by compass, etc.). For hilly areas and the heatmap of skyline, the image skyline pyramid was proposed to improve the geolocalization accuracy of the skyline. According to the distance between adjacent skyline in DEM database and the distance between camera and skyline, the skyline of the original image was enlarged and reduced by 10% and 20%, respectively (as illustrated in Figure 21).  
When extracting the Enhanced Angle chain code, the original camera FoV is used as the skyline of the original image, and the zoomed FoV is used for the skyline of other sizes.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Type Code** & **Distance Range** \\ \hline
00 & [0, 800] \\
01 & (800, 1500] \\
10 & (1500, +\infty) \\ \hline \hline \end{tabular}
\end{table}
Table 4: Classification conditions of heatmap.  
Figure 21: Image skyline pyramid (**left**) and the corresponding skylines (**right**).  
Figure 20: Heatmap (**left**) and distance classification map (**right**).  
The common edit distance is used to determine the similarity of two skylines. The magnitude of edit difference and the mean of edit distance are used to measure the difference between two skylines. Unlike the traditional edit distance, the difference in distance of skyline matching is not only related to the number of different characters, but also related to the similarity of different characters. If the two strings to be compared are \(str1\) and \(str2\), and \(a_{i}\) and \(b_{i}\) are, respectively, the \(i\)th character on \(str1\) and \(str2\), then the average distance between the two strings is  
\[Dis(str_{1},str_{2})=\frac{\sum Diff(a_{i},b_{i})}{length}, \tag{11}\]  
where  
\[Diff(a_{i},b_{i})=\frac{0.5\times abs(Curv\_a_{i}-Curv\_b_{i})+0.5\times abs (Normal\_a_{i}-Normal\_b_{i})}{32} \tag{12}\]  
computes the degree of difference between two characters, and the range of value is [0, 1). A value of 0 means the two characters are exactly the same, and a value of 1 means the difference between the two characters is very large.  
The image skyline features are compared with the features of each point in the subdataset, and the minimum error between the image skyline and each sampling point in the subdataset is recorded. For different types of heatmaps, different comparison strategies are adopted.  
When the skyline is far away from the sampling point, the features of the original image skyline and the skyline features of the sampling point are used for comparison, and the error is recorded. When the distance between the skyline and the sampling point is moderate, the skyline of the original image and the skyline compressed and expanded by 10% are compared with the skyline features of the sampling points respectively. The minimum of the three error values is recorded. When the skyline is close to the sample point, the skyline of the original image and the skyline compressed and expanded by 10% and 20%, are compared with the feature of the sampling point. The minimum value of the five error values is recorded. The process of coarse location is shown in the Figure 22.