Created
August 8, 2016 20:58
-
-
Save YaronBlinder/7fd44818d581865febdaa21bb77449c0 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
def im2double_m(img, *args, **kwargs): | |
# return normalize(img.astype(np.float64), None, 0.0, 1.0, NORM_MINMAX) | |
img = img.astype(np.float64) | |
min_val = np.min(img.ravel()) | |
max_val = np.max(img.ravel()) | |
out = img*max_val/(max_val - min_val) | |
out = out/(255.0) | |
return out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment