Abhilash
Abhilash

Reputation: 245

Histogram specification using matlab for image enhancement

In histogram specification we specify the shape of the desired histogram. For an image we should modify the histogram such that it is close to the shape of the desired histogram. Can anyone tell me how can I do that.

Histogram equalization used histeq(). Is there any special function for histogram specification.

Upvotes: 0

Views: 6463

Answers (1)

nhowe
nhowe

Reputation: 929

If you look at the documentation for histeq you will see that it accepts an optional second argument which is the desired histogram:

J = histeq(I, hgram) transformsthe intensity image I so that the histogram of the output intensity image J with length(hgram) bins approximately matches hgram. The vector hgram should contain integer counts for equally spaced bins with intensity values in the appropriate range: [0, 1] for images of class double, [0, 255] for images of class uint8, and [0, 65535] for images of class uint16. histeq automatically scales hgram so that sum(hgram) = prod(size(I)). The histogram of J will better match hgram when length(hgram) is much smaller than the number of discrete levels in I.

Upvotes: 1

Related Questions