# Applied Research of the UAV Illumination Measurement System in Sports Stadiums
## 2 Materials and Methods
### System Outlier Handling Algorithm
When this ratio is greater than 1, the density of point \(p\) is less than the density of its surrounding points, and point \(p\) may be an outlier; when this ratio is less than 1, the density of point \(p\) is greater than the density of its surrounding points, and point \(p\) may be a normal point. The density value can be infinity if the number of duplicates is greater than the number of \(k\) neighbors; therefore, the weighted local-outlier factor (WLOF) is defined if the data contains duplicates. The details are as follows. \[wlrd_{k}(p)=1/\frac{\sum\limits_{o\in N_{k}(p)}w(o)reach\_dist_{k}(p,o)}{\sum \limits_{o\in N_{k}(p)}w(o)} \tag{4}\]  
As shown in Equation (4), the \(w(o)\) is the number of duplicates in the data. After computing the weight values, the algorithm treats each set of duplicates as one data value. The calculation of the weighted local outlier is shown in Equation (5)  
\[WLOF_{k}(p)=\frac{\sum\limits_{o\in N_{k}(p)}\frac{wtrd_{k}(o)}{wtrd_{k}(p)}}{ \sum\limits_{o\in N_{k}(p)}w(o)} \tag{5}\]  
In the use of the LOF algorithm, it is necessary to first determine the threshold of the LOF algorithm. In the paper, we used DIALux evo version 11.1 to model the venue and make it comply with the Venue Illumination Standards specified by the Standard for lighting design and test of sports venues (JGJ 153-2016). In the venue model scenario, a  
Figure 6: Distance definition diagram. The selection  
As shown in Figure 7, The horizontal axis represents the local-outlier factor value calculated from the illuminance data points in different data acquisition planes. As we can see, most of the local-outlier factor values are concentrated within 0.5, indicating that the data density is relatively high, and it also shows that there is very little variation in illuminance in the plane of calculation. In illuminance measurement, points within a small plane are specified as measurement-point illuminance values, and the measurement points are faced with the situation of calculating the uniformity of illumination. Furthermore, the vertical axis represents the number of points that obtained different local-outlier-factor values. We removed 10 percent of the data as the threshold to determine the data to remove the effect of excessive differences in illuminance values between different calculation planes. In Figure 7, the blue vertical line is the result of the threshold calculated for the different height planes of data, where the results are 0.63, 0.69, 0.51, and 0.65, respectively. As shown in the picture, the points to the right of the blue vertical line are the discarded data in the dataset. Due to the large differences in illuminance values between different high calculation planes, they cannot be used as criteria for the determination of outliers, so the LOF algorithm determines the threshold value so that it detects the 5 percent of training observations as anomalies. With the use of the algorithm, the nearest point of the selected point is calculated according to the maximum-variance method. The smaller value is selected in the first divided area, and then the algorithm can again look for the smaller value in the second divided region until the smallest value is found in the calculation process. The flow chart of the LOF algorithm is shown in Figure 8.