- Research
- Open Access

# Preservation of image edge feature based on snowfall model smoothing filter

- Honghui Fan
^{1}and - Hongjin Zhu
^{1}Email author

**2018**:67

https://doi.org/10.1186/s13640-018-0312-8

© The Author(s). 2018

**Received:**6 June 2018**Accepted:**25 July 2018**Published:**3 August 2018

## Abstract

This paper proposed a snowfall model as a novel smoothing filter. The pixel composition of the image was similar to the geographic features, so it could be smooth because of snow accumulation. In the snowfall processing, luminance changes are linked to terrain and snowfall amount. Curvature and luminance gradient decided the amount of snowfall; the amount of snowfall became large on the parts where the curvature was large, and it became little on the parts where the gradient was steep. Snowfall algorithm simulates the natural snowfall process, which nonlinear diffusion and the target feature could be preserved well. Snowfall model has the same function as the Gaussian filter. The number of regions was reduced after Gaussian filter and snowfall model smoothing, respectively. The contrast experiment was carried out based on Watershed algorithm. The image area segmentation that pretreated through snowfall model was compared with Gaussian filter smoothing. The experimental result showed that the proposed snowfall model was a smoothing filter. It was able to realize edge preservation, which was the original purpose, and it was also possible to apply to region segmentation.

## Keywords

- Smoothing filter
- Snowfall model
- Edge characteristics
- Image preservation
- Region segmentation

## 1 Introduction

Image smoothing makes images easier for feature extracting and recognizing, and it could eliminate image space noise [1, 2]. Usually, image noise is mainly composed of high-frequency component; smoothing filter can enhance image low-frequency component to remove the high-frequency noise [3–5]. The typical smoothing process includes mean filter, median filter, and Gaussian low-pass filter. Mean filter is used to reduce noise in the image process, and it is an intuitive and simple method to make the image smooth [6]. Its principle is reducing the amount of intensity variation on pixel and the next [7]. Mean filter is based on the template for image convolution operation to achieve smooth processing [8]. It uses the average grayscale value of template pixels instead of the object pixels [9]. Mean filter output is an average value of the pixels within the filter template territory. Processing result reduces the image grayscale sharp changes and reduces the noise, but also has the negative effect of the fuzzy edges [10]. Median filter is a nonlinear digital filtering technique, and it is used to perform noise reduction in an image [11]. Pixels on the local area are sorted according to grayscale and according to the intermediate value of statistical sorting to replace the object pixel [12]. If the nature of the noise is not relevant to a random noise with the contents of the image, the median filter is effective and the effectiveness is better than the mean filter [13, 14]. Based on the median filter method, random spike noise signals are removed and edge blur degradation is reduced [15, 16]. Gaussian low-pass filter has the properties of having no overshoot to a step function input while minimizing the rise and fall time [17]. The pixels of space distribution are used as a reference value in an image denoising process; the weight distribution is determined based on distance to the target pixel, according to the calculate principle, the Gaussian low-pass filter blur effect close to human natural vision [18, 19]. Using a weight template the standard deviation for the convolution operation can realize the image smoothing process, with a standard deviation value becoming larger and the image smoothing effect becoming stronger. The above-described smoothing process methods do not retain the image edge effect, so the image processing results lose the edge characteristics of the original image [20, 21].

In the process of image generation and transmission, noise may be physically included due to various factors. Since noise is an obstacle to image processing, so it needs to be removed [22]. When the mechanism for generating such noise can be mathematically modeled [23], a noise cancelation method corresponding to the model could be used, but if it is not, the noise is reduced by the smoothing method [24, 25]. Image noise contains many high-frequency components; smoothing is a method of using a low-frequency emphasis filter to blur images to reduce noise [26].

In our research, we proposed a new smoothing method that reduces the noise through pseudo-snow in the image, making the snowfall in the natural world and the terrain becoming flat. Therefore, this research proposed the snowfall model as a smoothing technique for an image.

## 2 Snowfall model algorithm

- (1)
All of image pixels additive operation execution;

- (2)
Concave waveform smoothing process as a priority target;

- (3)
Convexity larger waveform as a reservation target.

Based on the above image processing, desired result of the smoothing process is shown in Fig. 1.

In order to achieve the smoothing effect of the snowfall model, the luminance slope and curvature parameters need to be defined. The luminance gradient value and curvature of convex waveform were required as snowfall calculation parameters to achieve self-adaptive smoothing process. Curvature and luminance gradient decided the amount of snowfall. The upward convex waveform curvature was given a negative value and recorded as negative curvature, and downward convex waveform curvature was given a positive value and recorded as positive curvature. When curvature value and gradient value were relatively large, we need to give less snowfall in the image process. Similarly, if positive curvature value and gradient value were relatively large, we need more snowfall to achieve a blur effect. Snowfall calculation parameters were divided into horizontal and vertical directions. One-dimensional differential filter and two-dimensional differential filter were used to calculate the gradient value.

*G*

_{ra}were calculated by the one-dimensional differential filter; because the positive and negative gradient values were not considered in the calculation, so the absolute value of the gradient values was calculated as shown in Eq. (1), in order to satisfy the calculation of snowfall, which was normalization between 0 and

*π*/2. Figure 3 shows the waveform of the luminance and absolute luminance gradients.

## 3 Method—smoothing based on the snow fall model

*K*was calculated as Eq. (2).

First-order derivative and second-order derivative in the *x* direction of image function *f*(*x, y*) values were calculated by Eq. (3) and Eq. (4).

*y*direction were calculated by Eq. (5) and Eq. (6).

*K*was positive; conversely, curvature value

*k*was a negative value. If the waveform of the grayscale value was linear,

*K*was 0. Figure 4 shows the luminance value and curvature waveform corresponding relation.

A pair of luminance gradient *g*(*x*) and curvature *k*(*x*) was calculated to produce *S*(*x*), i.e., a measure of snowfall amount at a pixel *x*. More specifically, a weight *G*(*x*) was defined so that *cosG*(*x*) was maximum with gradient *g*(*x*) = 0 and smaller with larger *g*(*x*) in magnitude.

In addition, another weight based on the curvature was used, where it became larger with negative values (concave) and smaller with positive ones (convex). This second weight was defined by exp(*k*(*x*)/10) as an example. A combination of the two weights was used to calculate *S*(*x*). Integrating the measure *S*(*x*) over an entire image, *S*(total) was to get a measure of snow amount for the entire image. *S*(total) was not depth of snow. Therefore, a scaling factor was needed and it was collated with real depth of snowfall. However, the process above corresponded to one-time snowfall. It was repeated, if further smoothing was necessary. If repeated once, it corresponded to depth. It should be noted that gradient and curvature should be calculated again prior to the next snowfall.

*S*was calculated using gradient value and curvature value. Horizontal snowfall amount

*S*

_{H}was calculated by horizontal direction gradient absolute value

*G*

_{H}and curvature value

*K*

_{H}. Vertical direction

*S*

_{V}could be calculated as the same. The total amount of snowfall

*S*was calculated by Eq. (7).

*K*and snowfall indicated that the larger

*K*means a greater amount of snowfall

*S*. In addition, the relationship between the gradient absolute value

*G*

_{ra}and the snowfall amount

*S*indicated that the greater the gradient absolute value

*G*

_{ra}, the smaller the amount of snowfall. For basic snowfall controlled parameters in the horizontal axis, the gradient of horizontal was

*G*

_{H}(

*x*

_{i},

*y*

_{j}) and the curvature of horizontal was

*K*

_{H}(

*x*

_{i},

*y*

_{j}). For basic snowfall controlled parameters in the vertical axis, the gradient of vertical was

*G*

_{V}(

*x*

_{i},

*y*

_{j}) and the curvature of vertical was

*K*

_{V}(

*x*

_{i},

*y*

_{j}). The detailed calculation in image processing of snowfall is shown in Fig. 5. In order to simulate the process and amount of natural snowfall as much as possible, the amount of snowfall in the horizontal direction and the amount of snowfall in the vertical direction are considered comprehensively; because the specific application needs are not considered at present, total snowfall is finally designed as the average of horizontal direction and vertical direction. In the subsequent research, the ratio of the amount of snowfall in the horizontal direction and the amount of snow in the vertical direction could be adjusted according to the specific application requirements.

In the process of snowfall, the whole image is taken as the processing object. In the specific calculation process, in each local snowfall amount calculation, the adjacent five pixels of the target pixel is treated as the local snowfall range. If the *x* direction is calculated, the left and right adjacent five pixels are used as the local snowfall range. If the *y* direction is calculated, the top and bottom five pixels adjacent are used as the local snowfall range.

Based on the above calculation step, we calculate the snowfall amount to achieve image smooth processing, and additional operation of grayscale value might be causing an unnatural snowfall effect. Grayscale value waveform might be becoming convex waveform, although the original waveform was concave, or the original grayscale value waveform for convex became a concave waveform after the snowfall process; these phenomena are not natural snowfall effect in image smoothing.

## 4 Results and discussion

*y*= 150 is taken as the analysis object. The changes in the pixel values of the original image and the 30, 60, and 90 times snowfall processing are shown in Fig. 8. The

*x*-axis of Fig. 8 represents positional information in the

*x*-direction of the pixel, and the

*y*-axis represents the luminance value. The red line represents the luminance distribution of the original image. The three lines from the bottom to top represent the change of luminance after the 30, 60, and 90 times of snowfall processing. By observing the waveform changes in Fig. 8, we can see that the small concave in the original image waveform becomes more and more smooth with the increase of snowfall times. From an analysis and comparison of three snowfall processes, waveform became smooth gradually. In Fig. 7, a handful of waveform values were less than the original image, the reason was the normalization in snowfall process.

As expected, moderate luminance variation and concavity were smoothed while large luminance variation and steep edges were preserved. At the same time, this technique increased the luminance value with each snowfall in the same way as snow falls on the ground, resulting in increase in the average luminance value. However, it did not matter since this technique was expected for use in conjunction with differential filters such as the watershed segmentation.

*σ*.

Using a weight template, which is from Eq. (8), the convolution operation could realize image-smoothing processing, with *σ* value becoming larger and the image smoothing effect becoming stronger.

Based on the watershed algorithm for image segmentation, first we find the minimum (minima) of grayscale difference and carried on the label, the label number was the serial number of each region. Grayscale value was based on the baseline moving upward starting from 0 to 255; mobile search for the maximum value was the watershed point, so as to complete the image region segmentation based on watershed algorithm.

*σ*, the smoothing effect of Gaussian filter is enhanced; with the increase of snowfall times, the smoothing effect of snowfall model has the same characteristic. In order to compare with the Gaussian filter, the segmentation results corresponding to different snowfall times and the segmentation results corresponding to the different Gaussian filter parameters

*σ*are investigated and analyzed. Finally, the number of regions and the number of edges are both not much different as a group to make comparative analysis. Table 1 summarizes the changes in the number of boundary lines that overlap the number of regions and the boundary in each smoothing method with different parameters.

The number of regions and edges in smoothing method

Gaussian filter | Snowfall model | ||||
---|---|---|---|---|---|

| Edge retention | Region | Amount | Edge retention | Region |

0.0 | 4799 | 3780 | 0 | 4799 | 3780 |

0.5 | 4309 | 3755 | 20 | 3031 | 3833 |

1.0 | 3034 | 3653 | 40 | 2290 | 3864 |

1.5 | 2107 | 3210 | 60 | 1721 | 3733 |

2.0 | 1570 | 2848 | 80 | 1400 | 3515 |

2.4 | 1220 | 2501 | 90 | 1222 | 3382 |

## 5 Conclusions

Snowfall model as a novel edge preserving smoothing filter based on nature snowfall was presented in this paper. The moderate luminance variation and concavity are smoothed while large luminance variation and steep edges are preserved. At the same time, this technique increases luminance value with each snow fall in the same way as snow falls to the ground, resulting in an increase in average luminance value. In order to verify the smoothing effect of the snowfall model, it was applied to the pretreatment of region segmentation based on the watershed algorithm. In addition, compared with Gaussian-filter, experimental results showed that the snowfall model had the same function as the Gaussian-filter. Although region was not merged in the tiny part, smoothing effect of snowfall was better than Gaussian-filter in the lower luminance part. However, it does not matter since this technique is expected for use in conjunction with differential filters such as watershed segmentation. In the future, we would further study the parameters of snowfall model on smoothing effect and application, especially the matching degree with the watershed algorithm, and suppressing over-segmentation.

## Declarations

### Funding

This work was supported by Natural Science Fund of Changzhou (CE20165028, CE20175026), Qing Lan Project of Jiangsu Province, Natural Science Research Project of Jiangsu Province (BY2016030–05).

### Availability of data and materials

We can provide the data.

### Authors’ contributions

Two authors take part in the discussion of the work described in this paper. The author HF designed the experiment and wrote the first version of the paper. The author HZ verified the proposed method and performed the part experiments of the paper. Both authors read and approved the final manuscript.

### Authors’ information

Honghui Fan, Doctor of Engineering, Associate Professor, Graduated from Yamgata University of Japan in 2011 and worked in Jiangsu University of Technology. His current research interests include computer application technology, image processing and image restoration. Hongjin Zhu, Doctor of Engineering, Associate Professor, graduated from Yamgata University of Japan in 2010 and worked in Jiangsu University of Technology. Her current research interests include image processing, computer vision, and pattern recognition.

### Ethics approval and consent to participate

Not applicable.

### Consent for publication

Not applicable.

### Competing interests

Both authors declare that they have no competing interests.

### Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Open Access** This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

## Authors’ Affiliations

## References

- C Song, C Xiao, X Li, et al., Structure-preserving texture filtering for adaptive image smoothing [J]. J. Vis. Lang. Comput.
**45**, 17–23 (2018)View ArticleGoogle Scholar - D Min, S Choi, J Lu, et al., Fast global image smoothing based on weighted least squares [J]. IEEE Trans. Image Process.
**23**(12), 5638–5653 (2014)MathSciNetView ArticleMATHGoogle Scholar - S Gonzalez, M Brookes, PEFAC-a pitch estimation algorithm robust to high levels of noise [J]. IEEE/ACM Trans. Audio Speech Lang. Process. (TASLP)
**22**(2), 518–530 (2014)View ArticleGoogle Scholar - KM Wong, TT Wong,
*Edge-preserving smoothing filter for particle based rendering [J]. Game Engine Gems 3*(2016), p. 91Google Scholar - M Mazhari, RPR Hasanzadeh, Suppression of noise in SEM images using weighted local hysteresis smoothing filter [J]. Scanning
**38**(6), 634–643 (2016)View ArticleGoogle Scholar - R Verma, J Ali, A comparative study of various types of image noise and efficient noise removal techniques [J]. Int. J. Adv. Res. Comput. Sci. Softw. Eng. 3(10), 617-622 (2013)Google Scholar
- H Hiary, R Zaghloul, A Al-Adwan, et al., Image contrast enhancement using geometric mean filter [J]. SIViP
**11**(5), 833–840 (2017)View ArticleGoogle Scholar - K He, J Sun, X Tang, Guided image filtering [J]. IEEE Trans. Pattern Anal. Mach. Intell.
**6**, 1397–1409 (2013)View ArticleGoogle Scholar - H Choi, J Jeong, Despeckling images using a preprocessing filter and discrete wavelet transform-based noise reduction techniques [J]. IEEE Sensors J.
**18**(8), 3131–3139 (2018)View ArticleGoogle Scholar - KK Sirur, Y Peng, Z Qinchuan, Effect of Smoothing Filters on Time-Domain Waveform Image Segmentation [C], Proceeding IIP'17 Proceedings of the 2nd International Conference on Intelligent Information Processing (ACM, New York, 2017), p. 19. Article No. 19, Bangkok, Thailand — July 17 - 18, 2017.Google Scholar
- L Jin, M Jin, X Xu, et al.,
*Structure-Adaptive Vector Median Filter for Impulse Noise Removal in Color Images [C]*, Image processing (ICIP), 2017 IEEE international conference on (IEEE, Beijing, 2017), pp. 690–694. https://doi.org/10.1109/ICIP.2017.8296369. - C Tsiotsios, M Petrou, On the choice of the parameters for anisotropic diffusion in image processing [J]. Pattern Recogn.
**46**(5), 1369–1381 (2013)View ArticleGoogle Scholar - A Roy, J Singha, L Manam, et al., Combination of adaptive vector median filter and weighted mean filter for removal of high-density impulse noise from colour images [J]. IET Image Process.
**11**(6), 352–361 (2017)View ArticleGoogle Scholar - V Gupta, V Chaurasia, M Shandilya, Random-valued impulse noise removal using adaptive dual threshold median filter [J]. J. Vis. Commun. Image Represent.
**26**, 296–304 (2015)View ArticleGoogle Scholar - Yang Q, Mao W, Tang H, et al. Deblending with Weak Signal Preserved by Dip Vector-Median Filter [C]. 2017 SEG international exposition and annual meeting. society of exploration geophysicists, 2017.View ArticleGoogle Scholar
- S Huo, W Zhu, T Shi, Iterative dip-steering median filter [J]. J. Appl. Geophys.
**144**, 151–156 (2017)View ArticleGoogle Scholar - B Pan, Bias error reduction of digital image correlation using Gaussian pre-filtering [J]. Opt. Lasers Eng.
**51**(10), 1161–1167 (2013)View ArticleGoogle Scholar - L Karacan, E Erdem, A Erdem, Structure-preserving image smoothing via region covariances [J]. ACM Trans. Graph. (TOG)
**32**(6), 176 (2013)View ArticleGoogle Scholar - C Lopez-Molina, B De Baets, H Bustince, et al., Multiscale edge detection based on Gaussian smoothing and edge tracking [J]. Knowl.-Based Syst.
**44**, 101–111 (2013)View ArticleGoogle Scholar - NM Zaitoun, MJ Aqel, Survey on image segmentation techniques [J]. Procedia Comput. Sci.
**65**, 797–806 (2015)View ArticleGoogle Scholar - Z Guo, H Pan, J Chen, et al.,
*Image Filtering Enhancement [C]*, International conference on sensing and imaging (Springer, Cham, 2018), pp. 493–499Google Scholar - J Ahmad, MA Khan, SO Hwang, et al., A compression sensing and noise-tolerant image encryption scheme based on chaotic maps and orthogonal matrices [J]. Neural Comput. & Applic.
**28**(1), 953–967 (2017)View ArticleGoogle Scholar - MR Islam, C Xu, Y Han, et al., A novel weighted variational model for image denoising [J]. Int. J. Pattern Recognit. Artif. Intell.
**31**(12), 1754022 (2017)View ArticleGoogle Scholar - H Yang, M Gunzburger, Algorithms and analyses for stochastic optimization for turbofan noise reduction using parallel reduced-order modeling [J]. Comput. Methods Appl. Mech. Eng.
**319**, 217–239 (2017)MathSciNetView ArticleGoogle Scholar - RVK Reddy, KP Raju, MJ Kumar, et al., Comparative analysis of common edge detection algorithms using pre-processing technique [J]. Int. J. Electr. Comput. Eng. (IJECE)
**7**(5), 2574–2580 (2017)View ArticleGoogle Scholar - C Pérez-Benito, S Morillas, C Jordán, et al., A model based on local graphs for colour images and its application for Gaussian noise smoothing [J]. J. Comput. Appl. Math.
**330**, 955–964 (2018)MathSciNetView ArticleMATHGoogle Scholar