Last active
July 7, 2019 17:48
-
-
Save WillKoehrsen/52c48a4c983258d56f9b29dd67ae1e83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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