Blur
Blur layer ("action": "blur") applies blur filter to the image.

Median blur

To use median blur (cv2.medianBlur) set name to median and kernel to odd number.
1
{
2
"action": "blur",
3
"src": ["$data1"],
4
"dst": "$data2",
5
"settings": {
6
"name": "median",
7
"kernel": 5
8
}
9
}
Copied!

Gaussian blur

To use gaussian blur (cv2.GaussianBlur) set name to gaussian and sigma to object with two numbers: min and max.
1
{
2
"action": "blur",
3
"src": ["$data1"],
4
"dst": "$data2",
5
"settings": {
6
"name": "gaussian",
7
"sigma": { "min": 3, "max": 50 }
8
}
9
}
Copied!
Original image
Resulting image

Example

1
[
2
{
3
"dst": "$data",
4
"src": [
5
"example/*"
6
],
7
"action": "data",
8
"settings": {
9
"classes_mapping": "default"
10
}
11
},
12
{
13
"dst": "$result",
14
"src": [
15
"$data"
16
],
17
"action": "blur",
18
"settings": {
19
"name": "gaussian",
20
"sigma": {"min": 3, "max": 50 }
21
}
22
},
23
{
24
"dst": "example_blur5",
25
"src": [
26
"$result"
27
],
28
"action": "supervisely",
29
"settings": {}
30
}
31
]
Copied!
Last modified 1yr ago