Colourizer

From Pyxis public wiki
Jump to: navigation, search



Summary: This process translates the cell values from the input coverage to RGB (Red/Green/Blue) values in the output coverage.

Input:

  • Coverage to Colour (1 Coverage) The coverage data set to which you want to apply a colour.

Output: Coverage , Feature

  • Description: The colourized coverage.

Attributes:

  • Minimum The lower value to use in the normalizing equation applied by the process. This is typically set to the minimum value represented in the input coverage.
  • Maximum The upper value to use in the normalizing equation applied by the process. This is typically set to the maximum value represented in the input coverage.

Details

This process is currently only used by WorldView when importing data in a Gridded Binary Image (.GRB) format, but it could be used with other coverage data. When translating a cell value from the input coverage, WorldView begins by applying the following normalizing equation:

(original data value - minimum value) / (maximum value - minimum value)

If the Minimum and Maximum values are set to the minimum and maximum values found in the input coverage (as they are by default when importing data in a GRB format), this has the effect of converting all of the values to a range of 0-1.

WorldView then multiplies these values by 255 to determine the intensity value for the output colour. As the input coverage is one dimensional, WorldView uses the same calculated intensity value for the red, green, and blue components of the output colour value. For example, if the product of the equation was 180, the value for the cell in the output coverage would be 180 180 180. So, although the process is a colourizer, the actual colours it produces will always be shades of grey somewhere between black (0 0 0) and white (255 255 255).

  • Note: If the input to this process is a multi-channel coverage, the process ignores all but the first channel.

Example

As mentioned, when you import data in a GRB format, WorldView automatically inspects the data source to determine the minimum and maximum cell values. For example, a layer of a GRB file might contain data about wind speeds measured in a North-South direction. In such a data source the strongest North wind measured might be 14 metres/second, while the strongest South wind measured might be 17 metres/second. Representing this information as a vector, the South wind would be recorded in the data as -17. WorldView would then set the Minimum and Maximum attributes to 14 and -17 respectively. These Minimum and Maximum values ensure that the translated data from this data source fall within the range of 0-1 ( see the following sample equations).

Input data value=-17
(-17 - (-17)) / (14 - (-17)) = 0 / 31 = 0
Output value = 0 * 255 = (0 0 0)
Input data value=-10
(-10 - (-17)) / (14 - (-17)) = 7 / 31 = 0.226
Output value = 0.226 * 255 = (58 58 58)
Input data value=0
(0 - (-17)) / (14 - (-17)) = 17 / 31 = 0.548
Output value = 0.548 * 255 = (140 140 140)
Input data value=10
(10 - (-17)) / (14 - (-17)) = 27 / 31 = 0.871
Output value = 0.871 * 255 = (222 222 222)
Input data value=14
(14 - (-17)) / (14 - (-17)) = 31 / 31 = 1
Output value = 1 * 255 = (255 255 255)

Using different Minimum and Maximum values

In most cases you will get the best results if the Minimum and Maximum values are set to the minimum and maximum values from the input coverage data. However, you can edit the values for the Minimum and Maximum attributes if you want to. If you are considering editing these values, be aware that using different values can skew the translation. For example, consider what would happen if you used the same input data as in the previous example, but set the Minimum value to 0 instead of -17.

Input data value=-17
(-17 - 0) / (14 - 0) = -17 / 14 = -1.214
Output value = 0 * 255 = (0 0 0)
Input data value=-10
(-10 - 0) / (14 - 0) = -10 / 14 = -0.714
Output value = 0 * 255 = (0 0 0)
Input data value=0
(0 - 0) / (14 - 0) = 0 / 14 = 0
Output value = 0 * 255 = (0 0 0)
Input data value=10
(10 - 0) / (14 - 0) = 10 / 14 = 0.714
Output value = 0.714 * 255 = (182 182 182)
Input data value=14
(14 - 0) / (14 - 0) = 14 / 14 = 1
Output value = 1 * 255 = (255 255 255)

When using the new Minimum value in the calculation, notice that negative values from the data source now result in a product that is also negative. When translating the product into an intensity value, WorldView treats a negative product as if it were 0. In our example, all input data values less than 0 (in other words, all of the southerly winds) would become 0 values, resulting in them being displayed as black (0 0 0).

Note also the effect this change has on how the positive values from the input coverage are translated. Using the default Minimum and Maximum values the positive input values 0 and 10 result in intensity values of 140 and 222 respectively. When the Minimum value is changed to 0, the same input values are translated to intensity values of 0 and 182 respectively. Essentially, the entire spectrum is downshifted toward the darker end.

Personal tools
Namespaces

Variants
Actions
Navigation
Wiki Navigation
Toolbox