# Superpixel Segmentation of Hyperspectral Images Based on Entropy and Mutual Information
## 3 Superpixel Segmentation Based on Color Histogram Driving
### Metric Function of Color Uniformity  
In this study, CHD function was used as the evaluation function [28], which consisted of two parts, i.e., the metric function of color uniformity function and the edge smoothness function.  
(1) Metric function of color uniformity  
To evaluate the division of the color density of each superpixel, we constructed a histogram and discretized the color space. \(\lambda\) is the label of color space, \(G\) is the number of discrete histogram bars which is set by the users, and \(H_{j}(j=1,2,\cdots,G)\) defines the color in a histogram bar in the group of \(\lambda\). \(A_{k}\) is a set of pixels, \(c_{A_{k}}(j)\) is the color histogram of \(A_{k}\), which is expressed in Equation (9).  
\[c_{A_{k}}(j)=\frac{1}{Z}\sum\limits_{i\in A_{k}}\delta\Big{(}I(i)\in H_{j}\Big{)} \tag{9}\]  
where \(I(i)\) stands for the color of pixel \(i\), \(Z\) is the normalisation factor, and \(\delta(\cdot)\) is the color discriminant function. When the color in all pixels falls in box \(j\), \(\delta(\cdot)\) returns 1. \(\phi\Big{(}c_{A_{k}}(j)\Big{)}\) is the distance in the color distribution, as shown in Equation (10).  
\[\begin{array}{c}\phi\Big{(}c_{A_{k}}(j)\Big{)}=\frac{1}{\mu\|I(i)-\overline{ I}\|+1}\Big{(}I(i)\in H_{j}\Big{)}\\ \overline{I}=\frac{\sum\limits_{i\in A_{k}}\delta\left(I(i)\in H_{j}\right)}{ A_{k}}\end{array} \tag{10}\]  
where \(\overline{I}\) is the average color value of \(A_{k}\) and \(\mu\) is the color histogram distance weight coefficient.  
\(\psi\Big{(}c_{A_{k}}\Big{)}\) is the quality of the color distribution, and \(H(s)\) is the evaluation of \(\psi\Big{(}c_{A_{k}}\Big{)}\) for each superpixel \(k\). \(H(s)=\sum\limits_{k}\psi\Big{(}c_{A_{k}}\Big{)}\). \(\psi\Big{(}c_{A_{k}}\Big{)}\) is used to evaluate the distance between colors and the concentration degree of colors in a histogram, as shown in Equation (11).  
\[\psi\Big{(}c_{A_{k}}\Big{)}=\sum\limits_{H_{j}}\Big{(}c_{A_{k}}(j)\Big{)}^{2} \frac{1}{\mu\big{|}I(i)-\overline{I}\big{|}+1} \tag{11}\]  
when all the colors concentrate in a bar of the histogram, \(\psi\Big{(}c_{A_{k}}\Big{)}\) reaches the maximum value, i.e., \(\psi\Big{(}c_{A_{k}}\Big{)}=1\). When all color bars in the histogram have the same value, the value of \(\psi\Big{(}c_{A_{k}}\Big{)}\) is the minimum.  
(2) Edge smoothness function  
In \(G(s)\), \(N_{i}\) is defined as a square area of \(N\times N\) pixel set centered at pixel \(i\). The histogram of the superpixel labels in region \(N_{i}\) can be defined as:  
\[b_{N_{i}}(k)=\frac{1}{Z}\sum\limits_{j\in N_{i}}\delta(I(j)\in A_{k}) \tag{12}\]  
where \(b_{N_{i}}(k)\) is the value of the \(kth\) superpixel label. In the histogram, the number of pixels in the adjacent region of superpixel A\({}_{k}\) is calculated.  
The edge smoothness function \(G(s)\) is defined as the sum of the edge smooth energy of all the superpixels, as shown in Equation (13).  
\[G(s)=\sum\limits_{i}\sum\limits_{k}\Big{(}b_{N_{i}}(k)\Big{)}^{2} \tag{13}\]  
\(G(s)\) reaches the maximum value when there is a unique superpixel in a neighboring region \(N_{i}\). However, there are at least two superpixel labels in the neighboring regions adjacent to the boundaries, thus not all the pixels can reach the maximum. However, by analyzing the neighboring regions which contain more than one superpixel labels, the pixels close to boundaries can be reduced and the function can have more regular shapes.