## 2 Two-Dimensional Maximum Shannon Entropy  
In order to conduct the digital processing of an image, it is conventional to adopt a two-dimensional matrix to represent the grayscale image [33; 34]. This can effectively reflect the gray-level distributions of images [35; 36], resulting in successful denoising. The location of noise should be determined before denoising occurs as the resulting threshold selection can directly influence the discriminating effects of noise [37; 38]. In a single threshold system, a pixel value less or greater than the preset one can be regarded as noise [39]. The ranges of the pixel values used to identify a noise point can often be large, resulting in an increase in error detection. However, a self-adaptive dual-threshold system, with a relatively minor noise recognition range, may decrease the probability of error detection [24]. However, during the processing of high-density noise in a grayscale image, it is also unstable and difficult to handle. Hence, in order to address the poor denoising issue, it is necessary to select a better threshold value to fit with the automatic window changes. To improve the noise detection effects during selections, a threshold value can be obtained using the gray levels of an image [40; 41], which can be expressed by a gray-level histogram formed using a two-dimensional matrix [42; 43]. The selection of a gray threshold may be achieved by using the valley value between two peaks in the two-dimensional histogram [44; 45]. Because a common gray-level histogram cannot accurately represent the randomness of noise, the processing effects of the complex images may be limited. By contrast, two-dimensional maximum Shannon entropy can more accurately represent the randomness of noise by employing more image information. In addition, the gray level and noise distributions of image pixels also present randomness; thus, a Shannon threshold can be selected using a two-dimensional gray histogram. In view of the Shannon threshold value method being widely used in signal processing [46; 47], two-dimensional maximum Shannon entropy can be utilized to select an optimal threshold value by calculating the two-dimensional gray-level histogram of the image coupled with maximum entropy theory [48]. As a result, it can be used to obtain better image processing effects, especially for noise images. Also, a multi-dimensional histogram constructed using a grayscale image and other characteristics can be optimized, including neighborhood gradient and neighborhood variance. For a grayscale image, the information entropy \(H\) using Shannon can be defined as follows [49]:  
\[H=-\sum\limits_{i=1}^{L}p_{i}\ln p_{i} \tag{1}\]  
where \(L\) is the gray-level number for inputting an image and \(p\) is the discrete distribution probability. In a two-dimensional gray-level histogram, the threshold point (\(s\), \(t\)) is a division point for segmenting the image foreground and background, where \(s\) represents a threshold value using the image's gray values to segment the image and \(t\) represents a threshold value using the average gray values in the neighborhood to segment the image. Therefore, for a threshold point (\(s\), \(t\)), two posterior probabilities, \(P_{0}\)(\(s\), \(t\)) and \(P_{1}\)(\(s\), \(t\)), of the target foreground and background can be expressed as:  
\[\left\{ \begin{array}{l}P_{0}(s,t)=\sum\limits_{i=0}^{s}\sum\limits_{j=0}^{t} p_{ij}\\ P_{1}(s,t)=\sum\limits_{i=s+1}^{L-1}\sum\limits_{j=t+1}^{L-1}p_{ij}\end{array} \right. \tag{2}\]  
where \(P_{0}\)(\(s\), \(t\)) represents the posterior probabilities of the image pixel gray values and the neighborhood average gray values are less than or equal to the threshold values \(s\) and \(t\), respectively. Also, \(P_{1}\)(\(s\), \(t\)) represents the posterior probabilities of the image pixel gray values and the neighborhood average gray values are greater than the threshold values \(s\) and \(t\), respectively.