## 5 Conclusions  
The denoising issues associated with grayscale images have become a significant area of research in the field of digital image processing. For the processing of high-noise grayscale images in particular, the denoising effects can become worse with increasing noise density. In this paper, an improved median filter algorithm, TSETMF, is proposed that utilizes two-dimensional maximum Shannon entropy to achieve the adaptive selection of thresholds to enhance the ability to process high-density noise and achieve denoising stability. The noise in images can be filtered by automatically partitioning a window size, the threshold value of which is adaptively calculated using two-dimensional maximum Shannon entropy. Three comparative experiments were conducted to verify the rationality of the TSETMF model and show its relative superiority in denoising. The experimental results demonstrated that the proposed TSETMF algorithm exhibited better processing performance with superior high-density noise suppression and denoising stability. The proposed TSETMF exhibited a stronger ability to process high-density noise, which was demonstrated by a higher PSNR value of 24.97 dB at a 95% noise density for the classical Lena grayscale image. The proposed TSETMF also exhibited better denoising stability when the noise density increased from 5% to 95%, which was demonstrated by the minor decline in the PSNR value of approximately 10.78% relative to the PSNR of 23.10 dB for the classical Cameraman grayscale image. The TSETMF algorithm is independent of the effects of noise density and achieved more accurate and effective results when processing the high-density salt and pepper noise in the COVID image. Therefore, it is clear that the proposed TSETMF can also maintain good filtering effects with excellent denoising robustness for processing high-density noise in grayscale images. This method could provide a unique approach to addressing denoising issues. Additionally, the processing of more grayscale image types should be carried out to explore the applicability of the proposed TSETMF algorithm and further improve its denoising performance and stability.  
**Supplementary Materials:** The following supporting information can be downloaded at: [[https://www.mdpi.com/article/10.3390/app14020635/s1](https://www.mdpi.com/article/10.3390/app14020635/s1)]([https://www.mdpi.com/article/10.3390/app14020635/s1](https://www.mdpi.com/article/10.3390/app14020635/s1)), Table S1: PSNR comparison data from different algorithms processing Lena with increasing noise density. Table S2: SSIM comparison data from different algorithms processing Lena with increasing noise density. Table S3: PSNR comparison data from different algorithms processing Cameraman with increasing noise density. Table S4: SSIM comparison data from different algorithms processing Cameraman with increasing noise density. Table S5: PSNR comparison data from different algorithms processing COVID with increasing noise density. Table S6: SSIM comparison data from different algorithms processing COVID with increasing noise density.  
**Author Contributions:** Conceptualization, N.C.; investigation, N.C.; methodology, N.C. and Y.L.; data curation, N.C. and Y.L.; writing--original draft, N.C. and Y.L.; writing--review and editing, N.C. All authors have read and agreed to the published version of the manuscript.  
This work was supported by the Key Science and Technology Research Project of Henan Province, China (Grant No. 222102220032, 212102210359), and the Doctoral Research Fund of Zhengzhou University of Light Industry (Grant No. 2019 BSJJ003).  
Not applicable.  
**Data Availability Statement:** The data presented in this study are available in the article.  
The authors declare no conflicts of interest.