Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # risanje histograma
- y_pos = numpy.arange(len(histogram))
- f = plt.figure(1)
- plt.bar(y_pos, histogram, color="r")
- plt.title("naslov")
- plt.xlim([0, 256])
- # izračunan po formuli iz predavanj
- Q = len(histogram)
- velikost = len(histogram)
- novi_histogram = numpy.zeros(velikost)
- for y in range(velikost):
- sum = 0
- for x in range(y+1):
- sum += histogram[x]
- novi_histogram[i] = (Q / img.shape[0] * img.shape[1]) * sum
- # apply histogram
- for i in range(dimenzija[0]):
- for j in range(dimenzija[1]):
- img[i,j] = hisogram[img[i,j]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement