Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PIXEL_NORMALIZATION_FACTOR = 12.5
PIXEL_OFFSET_FACTOR = 150
for row_index in range(row_count):
for column_index in range(column_count):
for color_channel_index in range(color_channel_count):
normalized_pixel_value = (
original_pixel_array[row_index][column_index][color_channel_index]
* PIXEL_NORMALIZATION_FACTOR
)
transformed_pixel_array[row_index][column_index][color_channel_index] = (
normalized_pixel_value + PIXEL_OFFSET_FACTOR
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment