Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Histogram(obraz,iloscP):
- unique_elements, counts_elements = np.unique(obraz, return_counts=True)
- uniqueElements = np.arange(256)
- countsElements = np.zeros(256,dtype=int)
- for x,y in zip(unique_elements, counts_elements):
- countsElements[x] = y
- zakres = math.ceil(255 / iloscP)
- X = []
- Y = []
- for x in np.array_split(uniqueElements, iloscP):
- X.append(x[-1])
- for y in np.array_split(countsElements, iloscP):
- Y.append(np.sum(y))
- return X,Y,uniqueElements,countsElements
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement