Created
March 12, 2021 12:41
-
-
Save alegoritma/4227282cbda3a00d6ba07a105bea78f4 to your computer and use it in GitHub Desktop.
tf.stretch_histogram
This file contains hidden or 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
| @tf.function | |
| def tf_strech_histogram(image): | |
| rmax = tf.reduce_max(image, axis=[-3,-2]) | |
| rmin = tf.reduce_min(image, axis=[-3,-2]) | |
| return (image-rmin)/(rmax-rmin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment