# A New Smoke Segmentation Method Based on Improved Adaptive Density Peak Clustering
## 3 Procedure of TSDPC
### Redefinition of Sample Point Local Density  
In order to simplify the representation of the image, the SLIC [35] is used to aggregate similar pixels in a small area to form irregular blocks, and image blocks are used instead of pixels as a basic unit in cluster analysis. SLIC is one of the most popular superpixel generation clustering algorithms used in many image segmentation tasks [36; 37]. In this paper, the initial superpixel parameter \(n\) is 500.  
When traditional DPC segment images, the commonly used feature space is the CIE-Lab color space [38]. The input is the \(n\) superpixel blocks of the image, which are subsequently represented by \(n\) sample points, denoted by \(X=\left\{x_{1},x_{2},\ldots,x_{m},\ldots x_{n}\right\}\).  
When the traditional DPC algorithm divides the image, the calculated local density does not consider the structural difference of the image data, and only the color information of the image cannot truly reflect the density of the sample points. This paper redefines the density of the sample points by combining the CIE_Lab color space and position information. The local density equation of the sample points is as follows:  
\[d_{ij}=\frac{D_{ij}-D_{min}}{D_{max}-D_{min}},d_{Lab\_{ij}}=\frac{D_{Lab\_{ij} -D_{Lab\_{min}}}}{D_{Lab\_{max}-D_{Lab\_{min}}}} \tag{3}\]  
Figure 1: Flowchart of TSDPC.  
\[\left\{\begin{aligned} \rho_{i}=\sum_{j=1}^{n}exp\left(-\left(\frac{d_{ij}}{d_{c }}\right)^{2}\right)\times\chi\left(d_{Lab\_ij}\right)\\ \chi\left(d_{Lab\_ij}\right)=\left\{\begin{aligned} 0,d_{Lab\_ij}>d_{ij} \\ 1,d_{Lab\_ij}\leq d_{ij}\end{aligned}\right.\end{aligned}\right. \tag{4}\]  
where \(D_{ij}\) represents the distance in position between the \(ith\) sample point and the \(jth\) sample point. \(D_{Lab\_ij}\) represents the distance in CIE_Lab color space between the \(i^{th}\) sample point and the \(j^{th}\) sample point. \(D_{max}\) and \(D_{min}\) are the maximum and minimum values of \(D\), and \(D_{Lab\_max}\) and \(D_{Lab\_min}\) are the maximum and minimum values of \(D_{Lab}\). Normalize \(D_{ij}\) and \(D_{Lab\_ij}\) to obtain \(d_{ij}\) and \(d_{Lab\_ij}\). Where \(\chi(\cdot)\) indicates that the position information and CIE_Lab space distances together determine the density of sample points. As shown in Figure 2, C is the sample point to be calculated, the blue sample point E is its nearest neighbor, and the white sample point D is a non-neighbor and \(d_{c}\) is its truncated distance. we suppose that the color and brightness information between adjacent sample points are quite different. In that case, even if the location difference between sample points is small, this point is not considered when calculating the local density.  
In DPC [21], the density of sample point C is mainly determined by all sample points within the truncation distance \(d_{c}\). However, in Figure 2, the density of sample point C is mainly determined by the blue sample points within the truncation distance \(d_{c}\). Although sample point D is adjacent to sample point C, in the CIE_Lab space, the distance between the two is relatively large; thus, sample point D cannot determine the density of point C. Although sample point E is not adjacent to sample point C, its position and color space are within the truncation distance, so sample point E and other blue sample points jointly determine the density of sample point C.