Cumulative Histogram

Photogrammetry-1

I had previously written about Image Histogram here:

A cumulative histogram sums the number of pixels having the current value or smaller than the current value.

The following function computes the cumulative histogram

def cumulativeHistogram(hist):

"""The function takes as input a histogram [np.array] and returns the cumulative histogram [np.array]"""

cum_hist = np.zeros((256,1))

for i in range(256):

cum_hist[i] = sum(hist[:i+1])

return cum_hist

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response