Skip to content

Instantly share code, notes, and snippets.

View wiryawan46's full-sized avatar

Manggala Pramuditya Wiryawan wiryawan46

  • Yogyakarta, Indonesia
View GitHub Profile
@wiryawan46
wiryawan46 / hist.py
Created September 27, 2017 07:20 — forked from bistaumanga/hist.py
Histogram Equalization in python
import numpy as np
def imhist(im):
# calculates normalized histogram of an image
m, n = im.shape
h = [0.0] * 256
for i in range(m):
for j in range(n):
h[im[i, j]]+=1
return np.array(h)/(m*n)