# Applied Research of the UAV Illumination Measurement System in Sports Stadiums
## 2 Materials and Methods
### System Outlier Handling Algorithm  
There are some outliers in the acquired data due to the instability of the drone hovering and flying in the process of illuminance acquisition by the system and changes in the external environment can also greatly interfere with the measurement of the UAV. Data acquired by a UAV-based illumination acquisition system have the characteristics of a random distribution, which is not a linear distribution, and not a Gaussian distribution. The detection of outliers in such data has important implications for the stability and accuracy of the system. These outliers can lead to large inaccuracies in measurement results, so it is necessary to find and eliminate outliers in measurements. Outliers are defined as data that are distinctive in the dataset so that they make one suspect that these data are not random deviations but are generated by a different mechanism according to Euclidean distance. The specific definition of outliers is as follows based on the description of Euclidean distance. The acquisition set to R = {r(x1), r(x2),..., r(xn)} and S = {f(x1), f(x2),..., f(xn)} is generated by two mechanisms, which are defined as r(x) and f(x) respectively, according to the data acquisition defined as D = {x1, x2,..., xn}. And then owned by is defined as outliers in the case of that M(xi) \(\gg\) M(xi) (i \(\
eq\) j) under the condition that f(xi) is not equal to r(xi), with the defined as an outlier feature. As shown in Figure 5, big data objects follow a certain distribution law, but the data x is clearly deviated, so it can be considered that it is produced by a different mechanism and judged as an outlier. In general, outliers can be divided into global outliers, local outliers, situational (or conditional) outliers, and collective outliers. In the design of the illumination measurement system, the LOF algorithm is selected as the detection method of outliers in this paper. The local-outlier factor is mainly used to determine whether the sample is anomalous by calculating the outlier factor and comparing whether it is far from dense data. The local-outlier factor is a density-based local-outlier detection algorithm, and the specific implementation is shown below. The \(d(o,p)\) is defined as the distance from point \(p\) to point \(o\); \(d_{k}(o)\) is defined as the \(k\)-distance, which is to radiate outward with \(p\) as the center of the circle until the \(k\) neighboring point is covered; and \(N_{k}(o)\) is the \(k\)-distance neighborhood of data point \(p\) defined by the set of all points within the k-distance of point \(p\). The \(reach\_dist_{k}(o,p)\) is defined as shown in Equation (1). \[reach\_dist_{k}(o,p)=\max\{d_{k}(o),d(o,p)\} \tag{1}\]  
The distance definition diagram is shown in Figure 6.  
The local reachable density is defined in Equation (2) based on the above-defined representation. \[lrd_{k}(p)=1/(\frac{\sum_{o\in N_{k}(p)}reach\_dist_{k}(o,p)}{|N_{k}(p)|}) \tag{2}\]  
Figure 5: The location of the outlier diagram. The \(lrd_{k}(p)\) characterizes the density of the point \(p\), and it is known the higher the density of point \(p\) and the surrounding points, the reachable distance of each point may be the smaller respective \(k\)-distance, corresponding to a larger \(lrd\) value; the lower the density of point \(p\) and the surrounding points, the reachable distance of each point may be the larger actual distance between two points, corresponding to a larger \(lrd\) value. In addition, the local-outlier factor can also be defined as Equation (3) by using the \(lrd\) value. \[LOF_{k}(p)=\frac{\sum_{o\in N_{k}(p)}\frac{lrd_{k}(o)}{lrd_{k}(p)}}{|N_{k}(p)|} =\frac{\sum_{o\in N_{k}(p)}lrd_{k}(o)}{|N_{k}(p)|}/lrd_{k}(p) \tag{3}\]  
From Equation (3), we can see that the local-outlier factor of point \(p\) is the ratio of the average locally reachable density of all points in the \(N_{k}(p)\) neighborhood of point \(p\) to the locally reachable density of point \(p\).