Advertisement
czlowiekzgon

Untitled

Apr 17th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. image = np.array(plt.imread("kierowca.jpg"))
  2. image = image[:,:,2]
  3. image2 = image
  4. mean = np.mean(image)
  5.  
  6. unique_elements, counts_elements = np.unique(image2, return_counts=True)
  7. cumulativeSumCounts = np.cumsum(counts_elements)
  8. for x,y in zip(unique_elements,cumulativeSumCounts):
  9. image2[image2 == x] = ((y - min(cumulativeSumCounts)) * 255)/ (np.size(image2))
  10. X,Y,uniqueE,countsE = Histogram(image2,iloscP)
  11. plt.bar(X,Y,width = zakres,edgecolor='red',align = "edge")
  12. plt.xticks(X,fontsize = 10)
  13.  
  14. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement