Created
October 7, 2015 18:13
-
-
Save yosemitebandit/299a36aae03afe9326bb to your computer and use it in GitHub Desktop.
histogram of an image
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
import matplotlib.pyplot as plt | |
import numpy as np | |
from skimage import io | |
raw_image = io.imread('test.jpg') | |
figure_grid = gridspec.GridSpec(1, 1) | |
ax0 = plt.subplot(figure_grid[0, 0]) | |
hist, bin_edges = np.histogram(raw_image, bins=np.arange(0, 256)) | |
ax0.bar(bin_edges[:-1], hist, width=1) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment