Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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