Abstract
We propose two models for the interpolation between RGB images based on the dynamic optimal transport model of Benamou and Brenier (Numer Math 84:375–393, 2000). While the application of dynamic optimal transport and its extensions to unbalanced transform were examined for gray-value images in various papers, this is the first attempt to generalize the idea to color images. The non-trivial task to incorporate color into the model is tackled by considering RGB images as three-dimensional arrays, where the transport in the RGB direction is performed in a periodic way. Following the approach of Papadakis et al. (SIAM J Imaging Sci 7:212–238, 2014) for gray-value images we propose two discrete variational models, a constrained and a penalized one which can also handle unbalanced transport. We show that a minimizer of our discrete model exists, but it is not unique for some special initial/final images. For minimizing the resulting functionals we apply a primal-dual algorithm. One step of this algorithm requires the solution of a four-dimensional discretized Poisson equation with various boundary conditions in each dimension. For instance, for the penalized approach we have simultaneously zero, mirror, and periodic boundary conditions. The solution can be computed efficiently using fast Sin-I, Cos-II, and Fourier transforms. Numerical examples demonstrate the meaningfulness of our model.
Similar content being viewed by others
Notes
Images from Wikimedia Commons: AGOModra_aurora.jpg by Comenius University under CC BY SA 3.0, Aurora-borealis_andoya.jpg by M. Buschmann under CC BY 3.0.
Images from Wikimedia Commons: Europe_satellite_orthographic.jpg and Earthlights_2002.jpg by NASA, Köhlbrandbrücke5478.jpg by G. Ries under CC BY SA 2.5, Köhlbrandbrücke.jpg by HafenCity1 under CC BY 3.0.
References
Ambrosio, L., Gigli, N., Savaré, G.: Gradient Flows in Metric Spaces and in the Space of Probability Measures. Springer, Heidelberg (2006)
Angenent, S., Haker, S., Tannenbaum, A.: Minimizing flows for the Monge-Kantorovich problem. SIAM J. Math. Anal. 35, 61–97 (2003)
Aravkin, A.Y., Burke, J.V., Friedlander, M.P.: Variational properties of value functions. SIAM J. Optim. 23(3), 1689–1717 (2013)
Auslender, A., Teboulle, M.: Asymptotic Cones and Functions in Optimization and Variational Inequalities. Springer, New York (2003)
Baiocchi, C., Buttazzo, G., Gastaldi, F., Tomarelli, F.: General existence theorems for unilateral problems in continuum mechanics. Arch. Ration. Mech. Anal. 100(2), 149–189 (1988)
Benamou, J.D.: A domain decomposition method for the polar factorization of vector-valued mappings. SIAM J. Numer. Anal. 32(6), 1808–1838 (1995)
Benamou, J.-D.: Numerical resolution of an ‘unbalanced’ mass transport problem. ESAIM Math. Model. Numer. Anal. 37(5), 851–868 (2003)
Benamou, J.-D., Brenier, Y.: A computational fluid mechanics solution to the Monge-Kantorovich mass transfer problem. Numer. Math. 84(3), 375–393 (2000)
Benning, M., Calatroni, L., Düring, B., Schönlieb, C.-B.: A primal-dual approach for a total variation Wasserstein flow. Geometric Science of Information. LNCS, pp. 413–421. Springer, Berlin (2013)
Bertalmio, M.: Image Processing for Cinema. CRC Press, Boca Raton (2014)
Björck, A.: Numerical Methods for Least Squares Problems. SIAM, Philadelphia (1996)
Brune, C.: 4D imaging in tomography and optical nanoscopy. Dissertation, PhD Thesis, Münster (Westfalen) University, (2010)
Burger, M., Franek, M., Schönlieb, C.-B.: Regularized regression and density estimation based on optimal transport. Appl. Math. Res. eXpress 2012(2), 209–253 (2012)
Burger, M., Sawatzky, A., Steidl, G.: First order algorithms in variational image processing. ArXiv:1412.4237 (2014)
Caffarelli, L.A.: A localization property of viscosity solutions to the monge-ampere equation and their strict convexity. Ann. Math. 131(1), 129–134 (1990)
Carlier, G., Oberman, A., Oudet, E.: Numerical methods for matching for teams and Wasserstein barycenters. ArXiv:1411.3602 (2014)
Chambolle, A., Pock, T.: A first-order primal-dual algorithm for convex problems with applications to imaging. J. Math. Imaging Vision 40(1), 120–145 (2011)
Chizat, L., Schmitzer, B., Peyré, G., Vialard, F.-X.: An interpolating distance between optimal transport and Fisher-Rao. ArXiv:1506.06430 (2015)
Cullen, M.J.: Implicit finite difference methods for modelling discontinouos atmospheric flows. J. Comput. Phys. 81, 319–348 (1989)
Cullen, M.J., Purser, R.J.: An extended Lagrangian theory of semigeostrophic frontogenesis. J. Atmos. Sci. 41, 1477–1497 (1989)
Cuturi, M.: Sinkhorn distances: lightspeed computation of optimal transport. Adv. Neural Inf. Process. Syst. 26, 2292–2300 (2013)
Cuturi, M., Coucet, A.: Fast computation of Wasserstein barycenters. In: Proceedings of the 31st International Conference on Machine Learning, pp. 685–693 (2014)
Dacorogna, B., Maréchal, P.: The role of perspective functions in convexity, polyconvexity, rank-one convexity and separate convexity. J. Convex Anal. 15(2), 271–284 (2008)
Dedieu, J.-P.: Cônes asymptotes d’un ensemble non convexe. Application à l’optimisation. C. R. Acad. Sci. 287, 91–103 (1977)
Delon, J.: Midway image equalization. J. Math. Imaging Vision 21(2), 119–134 (2004)
Ferradans, S., Papadakis, N., Peyré, G., Aujol, J.-F.: Regularized discrete optimal transport. SIAM J. Imaging Sci. 7(3), 1853–1882 (2014)
Fitschen, J.H., Laus, F., Steidl, G.: Dynamic optimal transport with mixed boundary condition for color image processing. In: International Conference on Sampling Theory and Applications (SampTA). ArXiv:1501.04840, pp. 558–562 (2015)
Frogner, C., Zhang, C., Mobahi, H., Araya, M., Poggio, T.A.: Learning with a Wasserstein loss. Adv. Neural Inf. Process. Syst. 28, 2044–2052 (2015)
Galerne, B., Gousseau, Y., Morel, J.-M.: Random phase textures: theory and synthesis. IEEE Trans. Image Process. 20(1), 257–267 (2011)
Haber, E., Rehman, T., Tannenbaum, A.: An efficient numerical method for the solution of the \(l_2\) optimal mass transfer problem. SIAM J. Sci. Comput. 32(1), 197–211 (2010)
Jimenez, C.: Dynamic formulation of optimal transport problems. J. Convex Anal. 15(3), 593–622 (2008)
Kochengin, S.A., Oliker, V.I.: Determination of reflector surfaces from near-field scattering data. Inverse Probl. 13(2), 363–373 (1997)
Maas, J., Rumpf, M., Schönlieb, C., Simon, S.: A generalized model for optimal transport of images including dissipation and density modulation. ArXiv:1504.01988 (2015)
Nikolova, M., Steidl, G.: Fast hue and range preserving histogram specification: theory and new algorithms for color image enhancement. IEEE Trans. Image Process. 23(9), 4087–4100 (2014)
Papadakis, N., Peyré, G., Oudet, E.: Optimal transport with proximal splitting. SIAM J. Imaging Sci. 7(1), 212–238 (2014)
Patankar, S.: Numerical Heat Transfer and Fluid Flow. CRC Press, New York (1980)
Peyré, G., Fadili, J., Rabin, J.: Wasserstein active contours. In: 19th IEEE ICIP, pp. 2541–2544 (2012)
Pock, T., Chambolle, A., Cremers, D., Bischof, H.: A convex relaxation approach for computing minimal partitions. In: IEEE Conference Computer Vision and Pattern Recognition, pp. 810–817 (2009)
Potts, D., Steidl, G.: Optimal trigonometric preconditioners for nonsymmetric Toeplitz systems. Linear Algebra Appl. 281, 265–292 (1998)
Rabin, J., Delon, J., Gousseau, Y.: Transportation distances on the circle. J. Math. Imaging Vision 41(1–2), 147–167 (2011)
Rabin, J., Peyré, G., Delon, J., Bernot, M.: Wasserstein barycenter and its application to texture mixing. In: SSVM, pp. 435–446. Springer (2012)
Rockafellar, R.T.: Convex Analysis. Princeton University Press, Princeton (1970)
Santambrogio, F.: Optimal Transport for Applied Mathematicians. Springer, New York (2015)
Schmitzer, B.: A sparse multi-scale algorithm for dense optimal transport. ArXiv:1510.05466 (2015)
Schmitzer, B., Schnörr, C.: A hierarchical approach to optimal transport. In: SSVM, pp. 452–464. Springer (2013)
Strang, G., MacNamara, S.: Functions of difference matrices are Toeplitz plus Hankel. SIAM Rev. 56, 525–546 (2014)
Swoboda, P., Schnörr, C.: Convex variational image restoration with histogram priors. SIAM J. Imaging Sci. 6(3), 1719–1735 (2013)
Teuber, T., Steidl, G., Chan, R.H.: Minimization and parameter estimation for seminorm regularization models with I-divergence constraints. Inverse Probl. 29, 1–28 (2013)
Trouvé, A., Younes, L.: Metamorphoses through Lie group action. Found. Comput. Math. 5(2), 173–198 (2005)
Villani, C.: Optimal Transport: Old and New. Springer, Berlin (2008)
Acknowledgments
Funding by the DFG within the Research Training Group 1932 is gratefully acknowledged.
Author information
Authors and Affiliations
Corresponding author
Appendices
Appendix 1: Diagonalization of Structured Matrices
In the following we collect known facts on the eigenvalue decomposition of various difference matrices. For further information we refer, e.g., to [39, 46]. The following matrices \(F_n\), \(C_n\) and \(S_n\) are unitary, resp., orthogonal matrices. The Fourier matrix
diagonalizes circulant matrices, i.e., for \(a := (a_j)_{j=0}^{n-1} \in \mathbb R^n\) we have
In particular it holds
with \(\mathrm{d}^{\mathrm{per}}_n := \left( 4 \sin ^2 \frac{k\pi }{n}\right) _{k=0}^{n-1}\). The operator \(\varDelta _n^{\mathrm{per}}\) typically appears when solving the one-dimensional Poisson equation with periodic boundary conditions by finite difference methods.
The DST-I matrix
and the DCT-II matrix
with \(\epsilon _0 := 1/\sqrt{2}\) and \(\epsilon _j := 1\), \(j=1,\ldots ,n-1\) are related by
where \( \mathrm{d}^{\mathrm{zero}}_{n-1} := \left( 4 \sin ^2 \frac{k\pi }{2n}\right) _{k=1}^{n-1} \). Further they diagonalize sums of certain symmetric Toeplitz and persymmetric Hankel matrices. In particular it holds
and
with \( \mathrm{d}^{\mathrm{mirr}}_n := \begin{pmatrix} 0\\ \mathrm{d}_{n-1}^{\mathrm{zero}} \end{pmatrix} = \left( 4\sin ^2 \frac{j \pi }{2n} \right) _{j=0}^{n-1} \). The operators \(\varDelta _{n-1}^{\mathrm{zero}}\) and \(\varDelta _{n}^{\mathrm{mirr}}\) are related to the Poisson equation with zero boundary conditions and mirror boundary conditions, respectively.
Appendix 2: Computation with Tensor Products
The tensor product (Kronecker product) of matrices
and
is defined by
The tensor product is associative and distributive with respect to the addition of matrices.
Lemma 2
(Properties of Tensor Products)
-
(i)
\(( A \otimes B)^{\scriptscriptstyle {\text {T}}}= A^{\scriptscriptstyle {\text {T}}}\otimes B^{\scriptscriptstyle {\text {T}}}\) for \( A \in \mathbb {C}^{m, n}\), \( B \in \mathbb {C}^{s , t}\). Let \(A, C \in \mathbb {C}^{m, m}\) and \( B, D \in \mathbb {C}^{n , n}\). Then the following holds:
-
(ii)
\(( A \otimes B)( C \otimes D) = A C \otimes B D\) for \(A, C \in \mathbb {C}^{m, m}\) and \( B, D \in \mathbb {C}^{n , n}\).
-
(iii)
If A and B are invertible, then \( A \otimes B\) is also invertible and
$$\begin{aligned} ( A \otimes B)^{-1} = A^{-1} \otimes B^{-1} \, . \end{aligned}$$
The tensor product is needed to establish the connection between images and their vectorized versions, i.e., we consider images \(F\in \mathbb {R}^{n_1\times n_2}\) columnwise reshaped as
Then the following relation holds true:
Appendix 3: Proofs and Generalization of the Tensor Product Approach to 3D
Proof of Proposition 3
By definition of A and using (25), (22), we obtain for periodic boundary conditions
Similarly we get with (25) for mirror boundary conditions
which finishes the proof. \(\square \)
Proof of Proposition 4
By definition of A we obtain
so that the inverse can be written by the help of the Schur complement
as
By (22) and (24) we have with \(D \in \{D_N^{\mathrm{per}},D_N\}\) that
The Schur complement reads as
By (21) we have
and
so that we obtain for periodic boundary boundary conditions
Therewith it follows with (24)
which yields the assertion for \(S^{-1}\) in the periodic case.
For mirror boundary conditions we compute using (23)
and inverting this matrix finishes the proof. \(\square \)
Discretization for three spatial dimensions + time For RGB images of size \(N_1 \times N_2 \times N_3\), where \(N_3 = 3\), we have to work in three spatial dimensions. Setting \(N :=(N_1,N_2,N_3)\), \(j :=(j_1,j_2,j_3)\) and defining the quotient \(\tfrac{j}{N}\) componentwise we obtain
-
\(f_i = \bigg (f_i \Big ( \tfrac{j-1/2}{N}\Big ) \bigg )_{j=(1,1,1)}^{N} \in \mathbb R^{N_1,N_2,N_3}\), \(i= 0,1\),
-
\(f = \bigg ( f \Big ( \tfrac{j-1/2}{N}, \tfrac{k}{P} \Big ) \bigg )_{j={(1,1,1)},k=1}^{N,P-1} \in \mathbb R^{N_1,N_2,3,P-1}\),
-
\(m = (m_1, m_2, m_3)\), with
$$\begin{aligned}&\bigg (m_1 \Big (\tfrac{j_1}{N_1},\tfrac{j_2-1/2}{N_2},\tfrac{j_3-1/2}{3},\tfrac{k-1/2}{P} \Big )\bigg )_{j_1=1,j_2=1,j_3=1,k=1}^{N_1-1,N_2,3,P}\\&\in \mathbb R^{N_1-1,N_2,3,P},\\&\bigg (m_2\Big (\tfrac{j_1-1/2}{N_1},\tfrac{j_2}{N_2},\tfrac{j_3-1/2}{3},\tfrac{k-1/2}{P}\Big )\bigg )_{j_1=1,j_2=1,j_3=1,k=1}^{N_1,N_2-1,3,P}\\&\in \mathbb R^{N_1,N_2-1,3,P},\\&\bigg (m_3\Big (\tfrac{j_1-1/2}{N_1},\tfrac{j_2-1/2}{N_2},\tfrac{j_3}{3},\tfrac{k-1/2}{P}\Big )\bigg )_{j_1=1,j_2=1,j_3=0,k=1}^{N_1,N_2,2,P}\\&\in \mathbb R^{N_1,N_2,3,P}. \end{aligned}$$
In the definition of m we take the periodic boundary for the third spatial direction into account. Analogously as in the one-dimensional case, when reshaping m and f into long vectors, the interpolation and differentiation operators can be written using tensor products. For the interpolation operator we have
and
which means, that \(S_{\text {m}}m\) computes the average of \(m_i\) with respect to the i-th coordinate, \(i=1,2,3\), and \(S_{\text {f}}f\) computes the average of f with respect to the time variable. Similarly we generalize the difference operator. Then, reordering f and m into large vectors, the matrix form of the operator A is
so that \(AA^{\scriptscriptstyle {\text {T}}}\) reads as
where
For the three-dimensional spatial setting we have to solve a four-dimensional Poisson equation, which can be handled separately in each dimension. For the constrained problem, this can be computed using fast cosine and Fourier transforms with a complexity of \(\mathcal {O}(N_1 N_2 P\log (N_1 N_2 P))\).
Rights and permissions
About this article
Cite this article
Fitschen, J.H., Laus, F. & Steidl, G. Transport Between RGB Images Motivated by Dynamic Optimal Transport. J Math Imaging Vis 56, 409–429 (2016). https://doi.org/10.1007/s10851-016-0644-x
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10851-016-0644-x