Last active
January 27, 2020 08:09
-
-
Save quocdat32461997/dfb32ad56acdee74391895797ad7bf9b to your computer and use it in GitHub Desktop.
Compute image 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
def histogram(img_channel): | |
#hist, _ = np.histogram(im_channele, bins = 256, range = (0, 256)) | |
hist = np.array([0] * 256) | |
height = len(img_channel) | |
width = len(img_channel[0]) | |
for row in range(height): | |
for col in range(width): | |
hist[img_channel[row, col]] += 1 | |
return hist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment