Advertisement
czlowiekzgon

Untitled

Apr 27th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. def Histogram(obraz,iloscP):
  2. unique_elements, counts_elements = np.unique(obraz, return_counts=True)
  3. uniqueElements = np.arange(256)
  4. countsElements = np.zeros(256,dtype=int)
  5. for x,y in zip(unique_elements, counts_elements):
  6. countsElements[x] = y
  7.  
  8. zakres = math.ceil(255 / iloscP)
  9. X = []
  10. Y = []
  11. for x in np.array_split(uniqueE, 15):
  12. X.append(x[-1])
  13. for y in np.array_split(countsE, 15):
  14. Y.append(np.sum(y))
  15.  
  16. return X,Y,uniqueElements,countsElements
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement