next up previous contents
Next: Selecting a Target Histogram Up: Shading and Lighting Normalization Previous: Shading and Lighting Normalization

Histogram Fitting

Let H(i) be the histogram function of an image, and let G(i) be the desired histogram we wish to map to via a transfer function $f_{H \rightarrow
G}(i)$. First, we compute a transfer function for both H(i) and G(i)that will map the histogram to a uniform distribution histogram, U(i). The functions are $f_{H \rightarrow U}(i)$ and $f_{G \rightarrow U}(i)$respectively. Equation [*] and Equation [*] depict the mapping to a uniform distribution which is also known as histogram equalization [14]:


 \begin{displaymath}f_{H \rightarrow U}(i) = \frac{\sum_{j=0}^{i} H(i) }{\sum_{j=0}^{n-1} H(i)}
\end{displaymath} (4.20)


 \begin{displaymath}f_{G \rightarrow U}(i) = \frac{\sum_{j=0}^{i} G(i) }{\sum_{j=0}^{n-1} G(i)}
\end{displaymath} (4.21)

where n is the number of discrete intensity levels, for 8-bit images, n=256.

To find the mapping function, $f_{H \rightarrow
G}(i)$, we invert the function $f_{G \rightarrow U}(i)$ to obtain $f_{U \rightarrow G}(i)$. Since the domain and the range of the functions of this form are identical, the inverse mapping is trivial and is found by cycling through all values of the function. However, due to the discrete nature of these functions, inverting can yield a function which is undefined for certain values. Thus, we use linear interpolation and assume smoothness to fill undefined points of the inverse function according to the values of well-defined points in the function. Thus, we generate a fully defined mapping $f_{U \rightarrow G}(i)$ which transforms a uniform histogram distribution to the distribution found in histogram G(i). The mapping $f_{H \rightarrow
G}(i)$ can then be defined as in Equation [*]:


 \begin{displaymath}f_{H \rightarrow G}(i) = f_{U \rightarrow G}(f_{H \rightarrow U}(i))
\end{displaymath} (4.22)


next up previous contents
Next: Selecting a Target Histogram Up: Shading and Lighting Normalization Previous: Shading and Lighting Normalization
Tony Jebara
2000-06-23