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
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
6
4
7

5
8
6
-
7
9
## How to use code
10
+
8
11
Requirements for C++:
9
-
- opencv 4.3.0 if you want Mat type support
12
+
13
+
- opencv 4.3.0 if you want Mat type support
10
14
11
15
Here is the simple example of filter usage with opencv Mat images:
12
16
@@ -26,12 +30,14 @@ int main()
26
30
return 0;
27
31
}
28
32
```
33
+
29
34
Python requirements are in file requirements.txt
30
35
use:
31
36
`pip install --upgrade pip`
32
37
`pip install -r requirements.txt`
33
38
34
39
Here is example with python:
40
+
35
41
```python
36
42
import filter_based_on_gradient_analysis as fga
37
43
import cv2
@@ -44,6 +50,7 @@ cv2.imwrite('your_output_file_name', output) # write the result
44
50
```
45
51
46
52
## General idea
53
+
47
54
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.
48
55

49
56
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.
@@ -54,7 +61,7 @@ When gradient magnitudes are inverted bigger values refer to textures (insignifi
54
61
55
62
If you used the code or want to reference this method in your work, please cite:
56
63
57
-
```
64
+
```bibtex
58
65
@inproceedings{gudkov2020image,
59
66
title={Image smoothing algorithm based on gradient analysis},
60
67
author={Gudkov, Vladimir and Moiseev, Ilia},
@@ -64,4 +71,3 @@ If you used the code or want to reference this method in your work, please cite:
0 commit comments