# A New Smoke Segmentation Method Based on Improved Adaptive Density Peak Clustering
## 3 Procedure of TSDPC
### Adaptation of Double Truncation Distance  
Manual selection of truncation distance based on experience is one of the disadvantages of DPC. The local density redefinition in this paper is jointly determined by the location information and the CIE_Lab color space; thus, this paper will use the Hungarian mathematician [PERSON] in 1961 to propose an information entropy [39] that can measure the continuous random variable, and solve the optimal double truncation distance.  
In information theory, information entropy is a systematic and orderly measurement method. The calculation equation of information entropy is as follows:  
\[H=-\sum_{i=1}^{n}P_{i}\log P_{i} \tag{5}\]  
\(P_{i}\), in Equation (5), is the probability of the event I, and \(\sum_{i=1}^{n}P_{i}=1\).  
Figure 2: Schematic diagram of sample point C density calculation.  
Before determining the density of sample points according to Equation (4), the truncation distance needs to be determined by information entropy.  
TSDPC uses the information entropy theory to judge the clustering effect of the sample points. If the information entropy of the sample set is large, it means that the clustering effect of the sample set is poor; otherwise, it means that the clustering effect of the sample set is better. The information entropy of the sample set can be expressed as:  
\[H=-\sum_{i=1}^{n}\frac{\rho_{i}}{\sum_{i=1}^{n}\rho_{i}}\log\frac{\rho_{i}}{ \sum_{i=1}^{n}\rho_{i}} \tag{6}\]  
We respectively normalize the distances of all sample points in the CIE_Lab space and sort them in ascending order. Through Equations (4) and (6), the truncation distance gradually increases from 0 to 1, and the interval is 0.05, find the value of the minimum entropy corresponding to the abscissa, and use this value as the truncation distance of the sample point in the position and CIE_Lab space, respectively. The specific steps of the algorithm are shown in Algorithm 1.  
```
1:Input:\(\{x_{1},x_{2},\ldots,x_{m},\ldots x_{n}\}\);
2:For\(d_{c}=0\) to 1, interval is 0.05, do
3: Calculate the information entropy function and display the result in an entropy diagram;
4:endfor
5:Find the double truncation distance corresponding to the minimum entropy value;
6:Output:\(d_{c}\)
```  
**Algorithm 1**Adaptation of double truncation distance  
The more similar the brightness and color of two superpixels in an image, the more similar the density between them. In this case, it is easier for two superpixels to be clustered into the same class. The location information and density of two superpixels in the image are similar, but the color and brightness information are quite different; thus, the two superpixels cannot be clustered into one class. We adopt Equation (7) to calculate the distance of the input sample points.  
\[\delta_{i}=\begin{cases}\min\left(d_{Lab\_{j}i}\right),&\exists\rho_{j}>\rho_ {i}\\ \max\left(d_{Lab\_{j}i}\right),&\forall\rho_{j}\leq\rho_{i}\end{cases} \tag{7}\]  
where \(\rho_{i}\) and \(\rho_{j}\) are the local density of the \(ith\) and \(jth\) sample points calculated by Equation (4). \(d_{Lab\_{j}i}\) is calculated by Equation (3). Only when the local density \(\rho_{i}\) of the sample point is the maximum density, the distance \(\delta_{i}\) takes the maximum value of the distance of each sample point. If \(\rho_{i}\) is not the maximum density, then the distance \(\delta_{i}\) is the sample point distance that is denser than it and has the smallest relative distance.