Skip to content

Instantly share code, notes, and snippets.

@joschuck
Created July 5, 2020 14:55
Show Gist options
  • Save joschuck/da731d20988d42f5b482f628bd5d38f5 to your computer and use it in GitHub Desktop.
Save joschuck/da731d20988d42f5b482f628bd5d38f5 to your computer and use it in GitHub Desktop.
from matplotlib import pyplot as plt
gray = cv2.imread('book_page_1_cropped.jpg', 0) # open as grayscale
plt.hist(gray.ravel(), 256, [0,256])
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment