Skip to content

Latest commit

 

History

History
61 lines (51 loc) · 1.07 KB

random_color.md

File metadata and controls

61 lines (51 loc) · 1.07 KB

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:

A = np.eye(3) + np.random.randn(3, 3) * strength / 5

Settings

  • strength (type: number, min: 0, max: 1)

The only setting strength controls how much image will change its colors.

{
  "action": "random_color",
  "src": ["$sample1"],
  "dst": "$sample2",
  "settings": {
    "strength": 0.25
  }
}

Example

Original image

Resulting image

[
  {
    "dst": "$data",
    "src": [
      "example/*"
    ],
    "action": "data",
    "settings": {
      "classes_mapping": "default"
    }
  },
  {
    "action": "random_color",
    "src": ["$data"],
    "dst": "$output",
    "settings": {
      "strength": 0.5
    }
  },
  {
    "dst": "example_rnd_color",
    "src": [
      "$output"
    ],
    "action": "supervisely",
    "settings": {}
  }
]