Drop Noise
This layer (drop_noise) removes connected components smaller than the specified size from bitmap annotations. This can be useful to eliminate noise after running neural network.

Settings

  • classes (type: array of strings)
  • min_area (type: string)
  • src_type (type: enum ["image", "bbox"])
Minimum area (min_area) for pixel group to be removed can be provided in pixels (ex. 10px) or in percentage (1%).
If min_area is in percentage, area of pixel group to delete can be calculated based on total resoultion of image (src_type = image) or based on area of bounding box of annotation (src_type = bbox).
Only annotations of classes from array classes would be processed. Those classes should have shape bitmap.
1
{
2
"action": "drop_noise",
3
"src": ["$input" ],
4
"dst": "$output",
5
"settings": {
6
"classes": ["noise"],
7
"min_area": "2%",
8
"src_type": "bbox"
9
}
10
}
Copied!

Example

In this example we will remove noise from annotations of class shoes (bitmap) less than 20px in size.
Input annotation with noise
Output annotation without noise
1
[
2
{
3
"dst": "$data",
4
"src": [
5
"example/*"
6
],
7
"action": "data",
8
"settings": {
9
"classes_mapping": "default"
10
}
11
},
12
{
13
"action": "drop_noise",
14
"src": ["$data"],
15
"dst": "$output",
16
"settings": {
17
"classes": ["shoes"],
18
"min_area": "20px",
19
"src_type": "image"
20
}
21
},
22
{
23
"dst": "example_drop_noise",
24
"src": [
25
"$output"
26
],
27
"action": "supervisely",
28
"settings": {}
29
}
30
]
Copied!
Last modified 1yr ago
Copy link