Reputation: 245
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
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 imageJ
withlength(hgram)
bins approximately matcheshgram
. The vectorhgram
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 classuint16
.histeq
automatically scaleshgram
so thatsum(hgram) = prod(size(I))
. The histogram of J will better matchhgram
whenlength(hgram)
is much smaller than the number of discrete levels in I.
Upvotes: 1