Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- fname = 'dH2si.png'
- img = plt.imread(fname)[220:290, 590:660, :3].sum(axis=2)
- img = img/img.max()
- a, b = np.histogram(img.flatten(), bins=255)
- plt.figure()
- plt.subplot(1, 2, 1)
- plt.imshow(img, cmap='gray', vmin=0, vmax=1)
- plt.subplot(1, 2, 2)
- plt.plot(b[:-1], a)
- plt.ylim(0, 40)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement