Skip to main content

Spatial and Frequency-Based Variational Methods for Perceptually Inspired Color and Contrast Enhancement of Digital Images

  • Chapter
  • First Online:
Color Image and Video Enhancement
  • 1438 Accesses

Abstract

In the past 20 years, variational principles in image processing and computer vision flourished, often allowing a deep comprehension and a more efficient solution to many problems. As this chapter presents, this also holds true for color image processing. We start by discussing the fundamental result about the interpretation of histogram equalization as the minimization of a suitable functional. This functional is given by two opponent terms: the first being a global quadratic adjustment to the middle gray level, and the second representing a global contrast enhancement term. It is proven here that this analytical form is shared by the so-called perceptual functionals, which allow an enhancement of color images in line with the most important human visual system features. For perceptual functionals, the adjustment is entropic and contrast enhancement is local and invariant under global illumination changes. It is also highlighted that the variational setting provides a unified framework where existing perceptually inspired color improvement models can be seen as particular instances. In the end, the wavelet version of this framework is discussed in detail.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Weber’s law is approximately valid not only for the visual sense, but also for all the other senses, with different values of Weber’s constant.

  2. 2.

    In general, the first variation of a homogeneous functional of degree \(n\) is a homogeneous functional of degree \(n-1\), in our case \(E_{\mu ,I_0,w,\varphi }(I)\) has degree 0, so its first variation has degree -1.

References

  1. Ambrosio, L., Gigli, N., Savaré, G.: Gradient flows in metric spaces and in the space of probability measures. Lectures in Mathematics, Birkhauser (2005)

    Google Scholar 

  2. Banich, N., Loncaric, S.: Light random sprays retinex: Exploiting the noisy illumination estimation. IEEE Signal Process. Lett. 20, 1240–1243 (2013)

    Article  Google Scholar 

  3. Bertalmío, M., Caselles, V., Provenzi, E., Rizzi, A.: Perceptual color correction through variational techniques. IEEE Trans. Image Process. 16, 1058–1072 (2007)

    Google Scholar 

  4. Bertalmío, M., Caselles, V., Provenzi, E.: Issues about the retinex theory and contrast enhancement. Int. J. Comput. Vision. 83,101–119 (2009)

    Article  Google Scholar 

  5. Ciarlet, P.: Introduction to numerical linear algebra and optimisation. Cambridge University Press, Melbourne (1989)

    Google Scholar 

  6. Frankle, J., McCann, JJ.: Method and apparatus for lightness imaging. United States Patent, US 4,348,336. (1983)

    Google Scholar 

  7. Gonzales, R., Woods, R.: Digital image processing. Prentice Hall, Upper Saddle River (2002)

    Google Scholar 

  8. Han, Y., Zheng, D., Baciu, G., Feng, X., Li, M.: Fuzzy region competition-based auto-color-theme design for textile images. Textile Res. J. 83(6), 638–650 (2013)

    Article  Google Scholar 

  9. Hubel, D.: Eye, brain, and vision. Scientific American Library, New York (1995)

    Google Scholar 

  10. Kimmel, R., Elad, M., Shaked, D., Keshet, R., Sobel, I.: A variational framework for retinex. Intern. J. Comput. Vis. 52(1), 07–23 (2003)

    Article  Google Scholar 

  11. Kuang, J., Johnson, G.M., Fairchild, M.D.: iCAM06: A refined image appearance model for HDR image rendering. J. Vis. Commun. Image R. 18, 406–414 (2007)

    Article  Google Scholar 

  12. Land, E., McCann, J.: Lightness and retinex theory. J. Opt. Soc. Am. 61(1), 1–11 (1971)

    Article  Google Scholar 

  13. Li, H., Zhang, L., Shen, H.: A perceptually inspired variational method for the uneven intensity correction of remote sensing images. IEEE Trans. Geosci. Remote Sens. 50(8), 3053–3065 (2012)

    Article  Google Scholar 

  14. Mallat, S.: A wavelet tour of signal processing, 3rd ed. Academic Press, San Diego (1999)

    Google Scholar 

  15. Montagna, R., Finlayson, G.D.: Constrained pseudo-Brownian motion and its application to image enhancement. J. Opt. Soc. Am. A. 28(8), 1677–1688 (2011)

    Article  Google Scholar 

  16. Palma-Amestoy, R., Provenzi, E., Bertalmío, M., Caselles, V.: A perceptually inspired variational framework for color enhancement. IEEE Trans. Pattern Anal. Mach. Intell. 31(3), 458–474 (2009)

    Article  Google Scholar 

  17. Provenzi, E.: Boosting the stability of wavelet-based contrast enhancement of color images through gamma transformations. J. Modern Opt. 60, 1145–1150 (2013)

    Article  MathSciNet  Google Scholar 

  18. Provenzi, E., Caselles, V.: A wavelet perspective on variational perceptually-inspired color enhancement. Int. J. Comput. Vis. 106, 153–171 (2014)

    Article  MathSciNet  Google Scholar 

  19. Provenzi, E., De Carli, L., Rizzi, A., Marini, D.: Mathematical definition and analysis of the Retinex algorithm. J. Opt. Soc. Am. A. 22(12), 2613–2621 (2005)

    Google Scholar 

  20. Provenzi, E., Fierro, M., Rizzi, A., De Carli, L., Gadia, D., Marini, D.: Random spray retinex: A new retinex implementation to investigate the local properties of the model. IEEE Trans. Image Process. 16(1), 162–171 (2007)

    Google Scholar 

  21. Rizzi, A., Gatta, C., Marini, D.: A new algorithm for unsupervised global and local color correction. Pattern Recognit. Lett. 24, 1663–1677 (2003)

    Article  Google Scholar 

  22. Sapiro, G., Caselles, V.: Histogram modification via differential equations. J. Diff. Eq. 135, 238–266 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  23. Shapley, R., Enroth-Cugell, C.: Visual adaptation and retinal gain controls. Prog. Retin. Res. 3 (Chap 9), 263–346 (1984)

    Article  Google Scholar 

  24. Strang, G., Nguyen, T.: Wavelets and filter banks. Wellesley-Cambridge Press, Wellesley (1996)

    Google Scholar 

  25. von Kries, J.: Chromatic Adaptation. Festschrift der Albrecht-Ludwigs-Universität 135:145–158 (1902)

    Google Scholar 

  26. Wyszecky, G., Stiles, W.S.: Color science: Concepts and methods, quantitative data and formulas. Wiley, New York (1982)

    Google Scholar 

Download references

Acknowledgements

The author would like to dedicate this work to the memory of Prof. Vicent Caselles with infinite gratitude for sharing his deep intelligence, culture, passion for science, and, last but not least, honesty.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Edoardo Provenzi .

Editor information

Editors and Affiliations

Appendices

Appendix 1

We provide here the proof of Theorem 5.1. We think that this proof is instructive because it explicitly shows the link between the variations of the functionals appearing in Theorem 5.1 and histogram equalization, which is far from being intuitive at the first sight.

Let us start with a useful lemma.

Lemma 5.1.

Given the two functionals

$$ E_1(I)=\int_{\Omega} \psi(I(x))\,dx, \quad E_2(I)=\iint_{\Omega^2} \phi(I(x),I(y))\,dxdy, $$
(5.26)

where \(\psi \) is a differentiable function defined on the codomain of \(I\), and \(\phi \) is a differentiable function defined on the 2-th Cartesian power of the codomain of \(I\), then their first variations are, respectively:

$$\delta E_1(I,J)=\int_{\Omega} \left.\frac{\partial \psi}{\partial I}\right|_{I(x)} \, J(x) dx \equiv \int_{\Omega} \psi'(I(x)) \, J(x) \, dx$$
(5.27)

and

$$\delta E_2(I,J)=\iint_{\Omega^2} \left(\left.\frac{\partial \phi}{\partial I}\right|_{I(x)} J(x) + \left.\frac{\partial \phi}{\partial I}\right|_{I(y)} J(y) \right) \, dxdy.$$
(5.28)

The proof of this lemma can be found in any book on variational principles and we do not report it here, preferring passing directly to the proof of Theorem 5.1.

Proof

By linearity, we can compute the first variation of the two terms of the energy functional separately and then add the results. For that, let us recall that we have written:

$$ D_{\frac{1}{2}}(I) = 2\int_\Omega \left(I(x)-\frac{1}{2}\right)^2 \, dx;$$
(5.29)
$$ C(I) = \frac{1}{|\Omega|}\iint_{\Omega^2} |I(x)-I(y)| \, dx dy.$$
(5.30)

By virtue of formula (5.27), we have

$$\delta D_{\frac{1}{2}}(I,J)=\int_\Omega 4\left(I(x)-\frac{1}{2}\right) J(x)\, dx,$$
(5.31)

and by virtue of formula (5.28), we have

$$ \begin{aligned} \delta C(I,J) & = \frac{1}{|\Omega|}\iint_{\Omega^2} \left[{\rm sign}(I(x)-I(y))J(x)-{\rm sign}(I(x)-I(y))J(y)\right] \, dx dy \\ & = \frac{1}{|\Omega|}\iint_{\Omega^2} {\rm sign}(I(x)-I(y))J(x) \, dx dy \; + \\ & - \frac{1}{|\Omega|}\iint_{\Omega^2} {\rm sign}(I(x)-I(y))J(y) \, dx dy. \end{aligned} $$
(5.32)

Now, interchanging the role of the “mute” variables \(x\) and \(y\) in the second integral of the last step, we have that

$$\frac{1}{|\Omega|}\iint_{\Omega^2} {\rm sign}(I(x)-I(y))J(y) \, dx dy=\frac{1}{|\Omega|}\iint_{\Omega^2} {\rm sign}(I(y)-I(x))J(x) \, dy dx$$
(5.33)

but then, using the oddness of the sign function,

$$\frac{1}{|\Omega|}\iint_{\Omega^2} {\rm sign}(I(x)-I(y))J(y) \, dx dy=-\frac{1}{|\Omega|}\iint_{\Omega^2} {\rm sign}(I(x)-I(y))J(x) \, dy dx.$$
(5.34)

Hence, we can write

$$ \begin{aligned} \delta C(I,J) & = \frac{1}{|\Omega|}\iint_{\Omega^2} {\rm sign}(I(x)-I(y))J(x) \, dy dx \; + \\ & + \frac{1}{|\Omega|}\iint_{\Omega^2} {\rm sign}(I(x)-I(y))J(x) \, dy dx = \\ & = \frac{2}{|\Omega|}\iint_{\Omega^2} {\rm sign}(I(x)-I(y))J(x) \, dy dx \end{aligned} $$
(5.35)

that can be conveniently rearranged as follows:

$$\delta C(I,J) = \int_{\Omega} \left(\frac{2}{|\Omega|}\int_\Omega {\rm sign}(I(x)-I(y))\, dy \right) J(x) \, dx.$$
(5.36)

Now, since \(\delta E_{\rm hist \; eq}(I,J)=\delta D_{\frac {1}{2}}(I,J)-\delta C(I,J)\), by using formulas (5.31) and (5.36) we have

$$\delta E_{\rm hist \; eq}(I,J)= \int_\Omega 4\left(I(x)-\frac{1}{2}\right) J(x)\, dx - \int_{\Omega} \left(\frac{2}{|\Omega|}\int_\Omega {\rm sign}(I(x)-I(y))\, dy \right) J(x) \, dx$$
(5.37)

that is,

$$\begin{aligned} \delta E_{\text{hist eq}}(I,J)= \int_\Omega \left[ 4\left( I(x)-\frac{1}{2}\right) - \frac{2}{|\Omega|}\int_\Omega \text{sign}(I(x)-I(y))\, dy \right] J(x)\, dx.\end{aligned}$$
(5.38)

The stationary condition \(\delta E_{\rm hist \; eq}(I,J)=0\), \(\forall J\), implies that the expression in the square bracket must be zero, that is,

$$ \delta E_{\rm hist \; eq}(I,J)=0 \quad \Longleftrightarrow \quad 4\left(I(x)-\frac{1}{2}\right) - \frac{2}{|\Omega|}\int_\Omega {\rm sign}(I(x)-I(y))\, dy=0,$$
(5.39)

so that the Euler–Lagrange equation relative to the energy functional \(E_{\rm hist \; eq}\) is the following implicit equation

$$2\left(I(x)-\frac{1}{2}\right) - \frac{1}{|\Omega|}\int_\Omega {\rm sign}(I(x)-I(y))\, dy=0,$$
(5.40)

that can be suitably rewritten as

$$\frac{1}{|\Omega|}\int_\Omega {\rm sign}(I(x)-I(y))\, dy=2I(x)-1.$$
(5.41)

Now, using the identity \({\rm sign} (t)=2{\rm sign} ^+(t)-1\), we can express the left-hand side of the Euler–Lagrange equation as

$$ \begin{aligned} \frac{1}{|\Omega|}\int_\Omega (2{\rm sign}^+(I(x)-I(y))-1)\, dy & =\frac{2}{|\Omega|}\int_\Omega {\rm sign}^+(I(x)-I(y))\, dy - \frac{\int_\Omega \, dy}{|\Omega|} \\ & = 2H(I(x))-1, \end{aligned} $$
(5.42)

where we have used the fact that \(\frac {1}{|\Omega |}\int _\Omega {\rm sign} ^+(I(x)-I(y))\, dy\) is the spatial version of the cumulative histogram \(H(I(x))\), as noticed in Eq. (5.5).

Thus, the Euler–Lagrange Eq. (5.41) is equivalent to \(2H(I(x))-1 = 2I(x)-1\), that is, to \(H(I(x))=I(x)\), but then

$$\delta E_{\rm hist \; eq}(I,J)=0 \quad \Longleftrightarrow \quad H(I(x))=I(x), \; \forall x\in \Omega,$$
(5.43)

which means that the image function \(I\) which satisfies the Euler–Lagrange equations of the functional \(E_{\rm hist \; eq}(I)\) has an equalized histogram.

The proof of existence and uniqueness of the solution of the gradient descent scheme written in Theorem 5.1 is quite long and technical and can be foundin[22]. □

Appendix 2

Let us start this section by briefly recalling the basic information about wavelet theory in 1D, then we will extend the discussion to 2D wavelets, the main reference for all the results quoted hereafter is [14]. A 1D (mother) wavelet \(\psi \in L^2(\mathbb{R} )\) is a unit norm and null-mean function. Of course this is possible only if \(\psi \) oscillates, but, unlike infinite waves, wavelets can have compact support. The \(\psi \)-wavelet transform \(W_\psi f\) of \(f\in L^2(\mathbb{R} )\) in the point \(\xi \) at the scale \(s\) is given by the inner product \(W_\psi f(\xi ,s) = \int _\mathbb {R} f(x) \frac {1}{\sqrt {s}} \overline \psi \left ( \frac {x-\xi }{s} \right ) dx\). \(W_\psi f\) gives a “measure of similarity” between \(f\) and \(\psi \) around the point \(\xi \) at the scale \(s\). So, if a signal is constant or do not vary “too much” in the support of a wavelet, then its wavelet transform will be zero or very small, this is how wavelets provide a multiscale information about the local contrast of a signal.

The set \(\{\psi _{j,k}\}_{(j,k)\in \mathbb {Z}^2} \subset L^2(\mathbb{R} )\) given by \(\psi _{j,k}(x)\equiv \frac {1}{\sqrt {2^j}}\psi \left (\frac {x-2^j k}{2^j}\right )\) is a complete orthonormal system of \(L^2(\mathbb{R} )\). Moreover, \(L^2(\mathbb{R} )\) can be recovered by the closure of the union of a sequence of nested closed subspaces \(V_j \subset V_{j-1}\) with suitable properties (see Mallat’s book [14] for more details). The orthogonal projections of \(f\in L^2(\mathbb{R} )\) onto \(V_j\) and \(V_{j-1}\) give the approximation of \(f\) at the scales \(2^j\) and \(2^{j-1}\), respectively. The \(2^j\)-approximation is coarser and the missing details with respect to the finer \(2^{j-1}\)-approximation are contained in the orthogonal complement \(W_j\) of \(V_j\) in \(V_{j-1}\): \(V_{j-1} = V_j \oplus W_j\). \(W_j\) is called the \(j\)-th detail space and it can be proven that the orthogonal projection of \(f\) on \(W_j\) is given by \(P_{W_j} f = \sum _{k\in \mathbb Z} \langle f,\psi _{j,k} \rangle \psi _{j,k} \equiv \sum _{k\in \mathbb Z} d_{j,k} \psi _{j,k}\). The coefficients \(d_{j,k}\) are called detail coefficients of \(f\) at the scale \(2^j\). Fine-scales detail coefficients at fine scale are sparse, in fact, they are non-null only when the support of \(\psi _{j,k}\) intersects a high contrast zone, that is, around sharp edges.

Finally, let us recall that every wavelet \(\psi \) is related to a mirror filter \(h\) and to a function \(\phi \), called scale function, through the following equation that involves their Fourier transforms: \(\hat \psi (2\omega ) = \frac {1}{\sqrt {2}} e^{-i\omega } \hat h^\ast \left ( \omega + \pi \right ) \hat \phi \left ( \omega \right )\), see [24] for a complete and detailed description of how to generate wavelets using the filter design methodology. \(\phi \) appears in the orthogonal projection of a signal \(f\) onto the approximation space \(V_j\), in fact it can be proven that \(P_{V_j} f = \sum _{k\in \mathbb Z} \langle f,\phi _{j,k} \rangle \phi _{j,k} \equiv \sum _{k\in \mathbb Z} a_{j,k} \phi _{j,k}\), where \(\phi _{j,k}(x) = \frac {1}{\sqrt {2^j}}\phi \left (\frac {x-2^j k}{2^j}\right )\) and \(a_{j,k}\) are called approximation coefficients at the scale \(2^j\). It follows that \(P_{V_{j-1}} f = P_{V_j}f + P_{W_j} f = \sum _{k\in \mathbb Z} a_{j,k} \phi _{j,k} + \sum _{k\in \mathbb Z} d_{j,k} \psi _{j,k}\).

In practical applications one is interested in a multiresolution analysis between two fixed scales \(2^L\) and \(2^J\), \(L,J\in \mathbb{Z} \), \(L<J\). In this case \(V_{J-1} = V_J \oplus W_J\), \(V_{J-2} = V_{J-1} \oplus W_{J-1} = V_J \oplus W_J \oplus W_{J-1}\) and so on, thus \(V_{L} = V_{J} \oplus \bigoplus _{2^J \geq 2^j \geq 2^{L+1}} \; W_j\). For this reason, following [14], we say that a discrete orthogonal wavelet multiresolution representation of a 1D signal \(f\) between two fixed scales \(2^L\) and \(2^J\), \(L,J\in \mathbb{Z} \), \(L<J\), is given by the collection of detail coefficients \(\{d_{j,k}\}\) at all scales, completed by the approximation coefficients at the coarser scale, that is, \(\{a_{J,k}\}\).

When we deal with 2D signals, as images, we have to consider a multiresolution analysis of \(L^2(\mathbb{R} ^2)\). Multidimensional wavelet bases can be generated with tensor products of separable basis functions defined along each dimension. In this case, an orthogonal wavelet multiresolution representation between two scales \(2^L\) and \(2^J\), \(L,J\in \mathbb{Z} \), \(L<J\), is given by three sets of detail coefficients \(\{d^H_{j,k},d^V_{j,k},d^D_{j,k}\}\) at all scales, which correspond to the horizontal, vertical, and diagonal detail coefficients, respectively, completed by the approximation coefficients at the coarser scale, that is, \(\{a_{J,k}\}\).

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Provenzi, E. (2015). Spatial and Frequency-Based Variational Methods for Perceptually Inspired Color and Contrast Enhancement of Digital Images. In: Celebi, E., Lecca, M., Smolka, B. (eds) Color Image and Video Enhancement. Springer, Cham. https://doi.org/10.1007/978-3-319-09363-5_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-09363-5_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-09362-8

  • Online ISBN: 978-3-319-09363-5

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics