Last active
January 27, 2020 08:20
-
-
Save quocdat32461997/910ef44cda1eda81f1b66864ddd77475 to your computer and use it in GitHub Desktop.
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
def upcontrastImage(image): | |
hist = histogram.histogram(image) | |
stretched_hist = histogram.eq_hist(hist, 256, image.size) | |
enhanced_image = np.zeros(shape = image.shape) | |
height = len(image) | |
width = len(image[0]) | |
for row in range(height): | |
for col in range(width): | |
enhanced_image[row, col] = stretched_hist[image[row, col]] | |
return enhanced_image |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment