During my search for image normalization or standardization, I found an auto brightness topic to be a start of the mentioned process. The need for having comparable (satellite) images is currently a great challenge for machine learning algorithms and that’s what is my aim here. Below in this article, you will find out how I did it in FME.

Example 1

Methods

I would like to avoid describing every step in FME, let’s focus on the most important matter. What I needed was an index of brightness or luminance of the image. There are a couple of methods to calculate it, check this topic on StackOverflow. I have tried two of it:

@round((@Value(band0.mean) / 255.0) * 0.2126 + (@Value(band1.mean) / 255.0) * 0.7152 + (@Value(band2.mean) / 255.0) * 0.0722,2)
@round((@Value(band0.mean) / 255.0) * 0.3 + (@Value(band1.mean) / 255.0) * 0.59 + (@Value(band2.mean) / 255.0) * 0.11,2)

First one is relative luminance and the second “color visibility suggested algorithm”. I have tested two of it and the results are close to each other but eventually, I left relative luminance in the workspace. What is more, an index should represent the whole image, so as you can see above I took the mean value of each RGB band. All 3 band mean numbers are divided by 255 to give us a value between 0 and 1. Finally, the result is rounded to two decimal places.

To make an image more bright (or not) I used a simple multiplying method described on FME websites. Basically all RGB band values are multiplied by the needed value.

Making it more usable

Value to which image would be adjusted could be hardcoded but I parameterized it. User is asked to provide a value between 0 and 1 (0 to 100%) by which the image will be transformed.

Parameter of custom Brigtness Adjuster transformer

Example 2

Example 3

FME Workspace for brightness adjustment

Workspace is created in FME Desktop 2020.1.

fme workspace

FMEHub Repository

Link to custom transformer: https://hub.safe.com/publishers/skime/transformers/brightness-adjuster

Description:
This transformer will adjust the brightness of your raster by given value (0.0-1.0)
Methods are described at https://www.smartcarto.com

Usage:
Connect the transformer and provide values in range 0 to 1 (0 to 100%) for Brightness.
Values between 0.0 – 0.5 will produce a darker image, values between 0.5 – 1.0 will provide a brighter image.
The output image is RGB24 type.

Final thoughts

All of this is only about brightness adjusting. The future work or upgrades may include contrast and other satellite image indexes or properties.

Tags: