Random Color
This layer (random_color) changes image colors by random moving each of RGB components.
Pixels (in matrix of width 3) are right multiplied by a random matrix A using the following formula:
1
A = np.eye(3) + np.random.randn(3, 3) * strength / 5
Copied!

Settings

  • strength (type: number, min: 0, max: 1)
The only setting strength controls how much image will change its colors.
1
{
2
"action": "random_color",
3
"src": ["$sample1"],
4
"dst": "$sample2",
5
"settings": {
6
"strength": 0.25
7
}
8
}
Copied!

Example

Original image
Resulting image
1
[
2
{
3
"dst": "$data",
4
"src": [
5
"example/*"
6
],
7
"action": "data",
8
"settings": {
9
"classes_mapping": "default"
10
}
11
},
12
{
13
"action": "random_color",
14
"src": ["$data"],
15
"dst": "$output",
16
"settings": {
17
"strength": 0.5
18
}
19
},
20
{
21
"dst": "example_rnd_color",
22
"src": [
23
"$output"
24
],
25
"action": "supervisely",
26
"settings": {}
27
}
28
]
Copied!
Last modified 1yr ago
Copy link