next up previous
Next: About this document ... Up: contrast_transform Previous: Histogram Equalization

Histogram Specification

Here we want to convert the image so that it has a particular histogram that can be arbitrarily specified. Such a mapping function can be found in three steps:

We first equalize the histogram $p_x$ of the input image $x$:

\begin{displaymath}y=f(x)=\int_0^x p_x(u) du \end{displaymath}

We then equalize the desired histogram $p_z$ of the output image $z$:

\begin{displaymath}y'=g(z)=\int_0^z p_z(u) du \end{displaymath}

The inverse of the above transform is

\begin{displaymath}z=g^{-1}(y') \end{displaymath}

As the two intermediate images $y$ and $y'$ both have the same equalized histogram, they are actually the same image, i.e., $y=y'$, and the overall transform from the given image $x$ to the desired image $z$ can be found to be:

\begin{displaymath}z=g^{-1}(y')=g^{-1}(y)=g^{-1}(f(x)) \end{displaymath}

However, as the image gray levels are discrete, the continuous mapping obtained above can only be approximated. The discrete histograms $h_y[i]$ and $h_{y'}[i]$ are not necessarily identical. We therefore need to relate each gray level in $x$ with $h_x[i]\ne 0$ to a gray level in $z$ with $h_z[j]\ne 0$, so that the mapping from $y$ to $y'$ can be established.

hist_specify.gif

Here are the specific steps of the algorithm:

Example:

The histogram of the given image and the histogram desired are shown below:

hist_specify_1.gif

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.

HistogramEqSp.jpg


next up previous
Next: About this document ... Up: contrast_transform Previous: Histogram Equalization
Ruye Wang 2014-10-02