## 2 Materials and Methods
### Other Edge-Preserving Methods  
Having a strong interest in the best possible nuclei edge retention, the results of the developed methods were compared with the performance of dedicated filters for edge preservation and noise reduction.  
The following filters were considered: the average (mean) filter, the median filter, the Wiener filter, which derives from the mean operator, and the Median Modified Wiener filter (MMWF), which is a nonlinear adaptive spatial filter that uses the quality and abilities of both median and Wiener filters [27]. MMWF provides global denoising, eliminating spikes and Gaussian noise while preserving the structures visible in the image. For each of the filters listed, the only parameter is the window size, which was tested in the range from 3 to 7, depending on the type of filter.  
In addition, the performance of a Gaussian filter of size 3, 5, and 7 with standard deviation \(\sigma\) varying from 0.4 to 2.8, and the Guided filter [28] was tested. The input image was used as a guidance image with the size of the rectangular neighborhood around each pixel from 3 to 7 and the amount of smoothing ranged from 0.001 to 0.05 (when the value is small, only the neighborhood with a small variance will be smoothed and the areas with stronger edges will be preserved).  
In [29], the authors proposed a class of algorithms that realizes image denoising using a diffusion process. An anisotropic diffusion filter was used as a speckle removal technique to improve the quality of ultrasonography [30] and the magnetic resonance images [31]. In this work, different connectivity values were examined: four or eight neighborhoods and conduction methods: exponential and quadratic. In the diffusion process, five iterations were used.  
In [32], the authors introduced a non-iterative bilateral filter to preserve edges through a nonlinear combination of nearby pixels. Noise removal is achieved by combining two Gaussian filters: the first works in the spatial domain, and the second filter works in the intensity domain. This filter applies spatially weighted averaging to smooth edges and preserve their shape. This method was also used to eliminate distortions from medical images [30]. Here, degrees of smoothing from 0.005 to 0.02 and standard deviations of spatial Gaussian smoothing kernel from 0.4 to 1.3 were tested.  
Another tested algorithm, the non-local means (NL-means), based on a non-local averaging of all pixels in the image, was presented in [33]. It can smooth blocking artifacts and preserve the edges simultaneously. Due to the nature of the algorithm, the most favorable case is the textured or periodic image, but some natural images also have sufficient redundancy for the filtering action to have a positive impact on image quality.  
Finally, the deep convolutional neural network FBCNN [20], which achieves state-of-the-art performance in the blind JPEG artifacts removal on single and multiple compressed color and grayscale images, was tested. Trained weights were used for a model designed to remove single compression artifacts from color images provided by the authors ([[https://github.com/jiaxi-jiang/FBCNN/releases/tag/v1.0](https://github.com/jiaxi-jiang/FBCNN/releases/tag/v1.0)]([https://github.com/jiaxi-jiang/FBCNN/releases/tag/v1.0](https://github.com/jiaxi-jiang/FBCNN/releases/tag/v1.0)), accessed on 4 February 2025).