You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Image Smoothing Algorithm Based on Gradient Analysis
2
-
This repository contains C++ and Python 3.6 implementation of an image smoothing algorithm that was proposed in this [publication](https://ieeexplore.ieee.org/document/9117646) in IEEE conference "2020 Ural Symposium on Biomedical Engineering, Radioelectronics and Information Technology (USBEREIT)".
2
+
This repository contains C++ and Python 3 implementation of an image smoothing algorithm that was proposed in this [publication](https://ieeexplore.ieee.org/document/9117646).
3
+
4
+

3
5
4
-

5
-
6
-
## General idea
7
-
In this paper image smoothing algorithm based on gradient analysis is proposed. Our algorithm uses filtering and to achieve edge-preserving smoothing it uses two components of gradient vectors: their magnitudes (or lengths) and directions. Our method discriminates between two types of boundaries in given neighborhood: regular and irregular ones.
8
-

9
-
Regular boundaries have small deviations of gradient angles and the opposite for irregular ones. To measure closeness of angles cosine of doubled difference is used. As additional measure that helps to discriminate the types of boundaries inverted gradient values were used.
10
-

11
-
When gradient magnitudes are inverted bigger values refer to textures (insignificant changes in gradient) and smaller refer to strong boundaries. So textures would have bigger weights and hence they would appear smoother. We also propose to smooth image of gradient magnitudes with median filter to enhance visual quality of results. The method proposed in this paper is easy to implement and compute and it gives good results in comparison with other techniques like bilateral filter.
12
-
13
-
## Examples
14
-

15
-
## Comparison
16
-
Here is the comparison with other smoothing algorithms.
17
-
a) - original image
18
-
b) - guided filter
19
-
c) - bilateral filter
20
-
d) - our filter
21
-

22
-
## Edge detection
23
-
Here is the output of Canny edge detector that was applied on the image with and without preprocessing with our filter.
24
-

25
6
26
7
## How to use code
27
8
Libraries used:
@@ -30,8 +11,6 @@ Libraries used:
30
11
Here is the simple example of filter usage with opencv Mat images:
31
12
32
13
```cpp
33
-
//opencv included in Source.cpp if you need to change include path,
34
-
//you should change it there
35
14
#include"FilterBasedOnGradientAnalysis.cpp"
36
15
37
16
intmain()
@@ -41,7 +20,7 @@ int main()
41
20
int kernelSize = 3; //set kernelSize = 3 for filtering with 3x3 kernel
42
21
int runsNumber = 2; //set number of runs: parameter n is 1 by default
43
22
Filter<float, uint8_t> filter; //create the instance of filter
cv2.imwrite('your_output_file_name', output) # write the result
60
39
```
40
+
41
+
## General idea
42
+
Our algorithm uses filtering and to achieve edge-preserving smoothing it uses two components of gradient vectors: their magnitudes (or lengths) and directions. Our method discriminates between two types of boundaries in given neighborhood: regular and irregular ones.
43
+

44
+
Regular boundaries have small deviations of gradient angles and the opposite for irregular ones. To measure closeness of angles cosine of doubled difference is used. As additional measure that helps to discriminate the types of boundaries inverted gradient values were used.
45
+

46
+
When gradient magnitudes are inverted bigger values refer to textures (insignificant changes in gradient) and smaller refer to strong boundaries. So textures would have bigger weights and hence they would appear smoother. We also propose to smooth image of gradient magnitudes with median filter to enhance visual quality of results. The method proposed in this paper is easy to implement and compute and it gives good results in comparison with other techniques like bilateral filter.
47
+
48
+
## Citation
49
+
50
+
If you used the code or want to reference this method in your work, please cite:
51
+
52
+
```
53
+
@inproceedings{gudkov2020image,
54
+
title={Image smoothing algorithm based on gradient analysis},
55
+
author={Gudkov, Vladimir and Moiseev, Ilia},
56
+
booktitle={2020 Ural Symposium on Biomedical Engineering, Radioelectronics and Information Technology (USBEREIT)},
0 commit comments