Advertisement
Guest User

Untitled

a guest
Sep 8th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. fname = 'dH2si.png'
  5. img = plt.imread(fname)[220:290, 590:660, :3].sum(axis=2)
  6. img = img/img.max()
  7. a, b = np.histogram(img.flatten(), bins=255)
  8. plt.figure()
  9. plt.subplot(1, 2, 1)
  10. plt.imshow(img, cmap='gray', vmin=0, vmax=1)
  11. plt.subplot(1, 2, 2)
  12. plt.plot(b[:-1], a)
  13. plt.ylim(0, 40)
  14. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement