Here we want to convert the image so that it has a particular histogram as
specified. First consider equalization transform of the given image
:
If the desired image
were available, it could also be equalized:
Here
is the histogram of the output image which is specified. The
inverse of the above transform is
For each gray level
, find
and then find a
level so that
best matches
:
Example:
The histogram of the given image and the histogram desired are shown below:
| 790 | 0.19 | 0.19 | ||
| 1023 | 0.25 | 0.44 | ||
| 850 | 0.21 | 0.65 | ||
| 985 | 0.24 | 0.89 | ||
| 448 | 0.11 | 1.00 |
| 0/7 | 0.0 | 0.0 |
| 1/7 | 0.0 | 0.0 |
| 2/7 | 0.0 | 0.0 |
| 3/7 | 0.15 | 0.15 |
| 4/7 | 0.20 | 0.35 |
| 5/7 | 0.30 | 0.65 |
| 6/7 | 0.20 | 0.85 |
| 7/7 | 0.15 | 1.0 |
This is the histogram of the resulting image:
In the following example, the desired histogram is a triangle with linear increase in the lower half of the the gray level range, and linear decrease in the upper half. Again the cumulative histogram shows indeed the density histogram is such a triangle.
Programming issues: