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 as specified. First consider equalization transform of the given image $x$:


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

If the desired image $z$ were available, it could also be equalized:


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

Here $p_z(u)$ is the histogram of the output image which is specified. The inverse of the above transform is


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

Since images $y$ and $y'$ 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 as:

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

where both $f$ and $g$ can be found from the histogram of the given image $x$ and the desired histogram, respectively.

hist_specify.gif

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

Programming issues:


\begin{displaymath}
\par
j=0;
\par
for\;\; (i=0; \;\;i<256; \;\;i++)\;\; \{
\par...
...\;\;\;\;\;\;else\;\;\; lookup[i]=j;
\par
\;\;\;\}
\par
\}
\par
\end{displaymath}


next up previous
Next: About this document ... Up: contrast_transform Previous: Histogram Equalization
Ruye Wang 2011-12-13