Abstract
Multivariate median filters have been proposed as generalizations of the well-established median filter for gray-value images to multichannel images. As multivariate median, most of the recent approaches use the \(L^1\) median, i.e., the minimizer of an objective function that is the sum of distances to all input points. Many properties of univariate median filters generalize to such a filter. However, the famous result by Guichard and Morel about approximation of the mean curvature motion PDE by median filtering does not have a comparably simple counterpart for \(L^1\) multivariate median filtering. We discuss the affine equivariant Oja median and the affine equivariant transformation–retransformation \(L^1\) median as alternatives to \(L^1\) median filtering. We analyze multivariate median filters in a space-continuous setting, including the formulation of a space-continuous version of the transformation–retransformation \(L^1\) median, and derive PDEs approximated by these filters in the cases of bivariate planar images, three-channel volume images, and three-channel planar images. The PDEs for the affine equivariant filters can be interpreted geometrically as combinations of a diffusion and a principal-component-wise curvature motion contribution with a cross-effect term based on torsions of principal components. Numerical experiments are presented, which demonstrate the validity of the approximation results.
Similar content being viewed by others
References
Aloupis, G., Langerman, S., Soss, M., Toussaint, G.: Algorithms for bivariate medians and a Fermat–Torricelli problem for lines. Comput. Geom. 26, 69–79 (2003)
Alvarez, L., Lions, P.L., Morel, J.M.: Image selective smoothing and edge detection by nonlinear diffusion. II. SIAM J. Numer. Anal. 29, 845–866 (1992)
Anandan, P.: A computational framework and an algorithm for the measurement of visual motion. Int. J. Comput. Vis. 2, 283–310 (1989)
Astola, J., Haavisto, P., Neuvo, Y.: Vector median filters. Proc. IEEE 78(4), 678–689 (1990)
Austin, T.L.: An approximation to the point of minimum aggregate distance. Metron 19, 10–21 (1959)
Barbara, R.: The Fermat–Torricelli points of \(n\) lines. Math. Gazette 84, 24–29 (2001)
Boris, J.P., Book, D.L.: Flux corrected transport. I. SHASTA, a fluid transport algorithm that works. J. Comput. Phys. 11(1), 38–69 (1973)
Breuß, M., Brox, T., Sonar, T., Weickert, J.: Stabilised nonlinear inverse diffusion for approximating hyperbolic PDEs. In: Kimmel, R., Sochen, N., Weickert, J. (eds.) Scale Space and PDE Methods in Computer Vision. Lecture Notes in Computer Science, vol. 3459, pp. 536–547. Springer, Berlin (2005)
Caselles, V., Sapiro, G., Chung, D.H.: Vector median filters, inf-sup operations, and coupled PDE’s: theoretical connections. J. Math. Imaging Vis. 8, 109–119 (2000)
Chakraborty, B., Chaudhuri, P.: On a transformation and re-transformation technique for constructing an affine equivariant multivariate median. Proc. AMS 124(6), 2539–2547 (1996)
Chakraborty, B., Chaudhuri, P.: A note on the robustness of multivariate medians. Stat. Probab. Lett. 45, 269–276 (1999)
Chung, D.H., Sapiro, G.: On the level lines and geometry of vector-valued images. IEEE Signal Process. Lett. 7(9), 241–243 (2000)
Eckhardt, U.: Root images of median filters. J. Math. Imaging Vis. 19, 63–70 (2003)
Gini, C., Galvani, L.: Di talune estensioni dei concetti di media ai caratteri qualitativi. Metron 8, 3–209 (1929)
Guichard, F., Morel, J.M.: Partial differential equations and image iterative filtering. In: Duff, I.S., Watson, G.A. (eds.) The State of the Art in Numerical Analysis. IMA Conference Series (New Series), vol. 63, pp. 525–562. Clarendon Press, Oxford (1997)
Hayford, J.F.: What is the center of an area, or the center of a population? J. Am. Stat. Assoc. 8(58), 47–58 (1902)
Hettmansperger, T.P., Randles, R.H.: A practical affine equivariant multivariate median. Biometrika 89(4), 851–860 (2002)
Horn, B., Schunck, B.: Determining optical flow. Artif. Intell. 17, 185–203 (1981)
Kleefeld, A., Breuß, M., Welk, M., Burgeth, B.: Adaptive filters for color images: median filtering and its extensions. In: Trémeau, A., Schettini, R., Tominaga, S. (eds.) Computational Color Imaging. Lecture Notes in Computer Science, vol. 9016, pp. 149–158. Springer, Cham (2015)
Mémin, E., Pérez, P.: Dense estimation and object-based segmentation of the optical flow with robust techniques. IEEE Trans. Image Process. 7(5), 703–719 (1998)
Oja, H.: Descriptive statistics for multivariate distributions. Stat. Probab. Lett 1, 327–332 (1983)
Rao, C.R.: Methodology based on the \(l_1\)-norm in statistical inference. Sankhyā A 50, 289–313 (1988)
Ronkainen, T., Oja, H., Orponen, P.: Computation of the multivariate Oja median. In: Dutter, R., Filzmoser, P., Gather, U., Rousseeuw, P.J. (eds.) Developments in Robust Statistics, pp. 344–359. Physica-Verlag, Heidelberg (2003)
Small, C.G.: A survey of multidimensional medians. Int. Stat. Rev. 58(3), 263–277 (1990)
Spence, C., Fancourt, C.: An iterative method for vector median filtering. Proc. IEEE Int. Conf. Image Process. 5, 265–268 (2007)
Struyf, A., Hubert, M., Rousseeuw, P.J.: Clustering in an object-oriented environment. J. Stat. Softw. 1(4), 1–30 (1997)
Tukey, J.W.: Exploratory Data Analysis. Addison-Wesley, Menlo Park (1971)
Vardi, Y., Zhang, C.H.: A modified Weiszfeld algorithm for the Fermat–Weber location problem. Math. Program. A 90, 559–566 (2001)
Weber, A.: Über den Standort der Industrien. Mohr, Tübingen (1909)
Weiszfeld, E.: Sur le point pour lequel la somme des distances de \(n\) points donnés est minimum. Tôhoku Math. J. 43, 355–386 (1937)
Welk, M.: Partial differential equations for bivariate median filters. In: Aujol, J.F., Nikolova, M., Papadakis, N. (eds.) Scale Space and Variational Methods in Computer Vision. Lecture Notes in Computer Science, vol. 9087, pp. 53–65. Springer, Cham (2015)
Welk, M.: Corrected PDE approximation result for the multivariate \({L}^1\) median filter. Technical report (In preparation)
Welk, M., Breuß, M.: Morphological amoebas and partial differential equations. In: Hawkes, P.W. (ed.) Advances in Imaging and Electron Physics, vol. 185, pp. 139–212. Elsevier Academic Press, San Diego (2014)
Welk, M., Breuß, M., Vogel, O.: Morphological amoebas are self-snakes. J. Math. Imaging Vis. 39, 87–99 (2011)
Welk, M., Feddern, C., Burgeth, B., Weickert, J.: Median filtering of tensor-valued images. In: Michaelis, B., Krell, G. (eds.) Pattern Recognition. Lecture Notes in Computer Science, vol. 2781, pp. 17–24. Springer, Berlin (2003)
Author information
Authors and Affiliations
Corresponding author
Appendices
Appendix 1: First Proof of Lemma 2
We restate here the proof from [31] with slight modifications and additional details.
The Taylor expansion of (u, v) up to second order around (0, 0) reads as
where the coefficients are given by derivatives of u, v at \((x,y)=(0,0)\) as
Restating the definition of Oja’s simplex median for continuous datasets with density function f(u, v), we seek the point \(M:=(u^*,v^*)\) which minimizes the integral over all areas of triangles MAB with \(A=(u_1,v_1)\) and \(B=(u_2,v_2)\) with \((u_1,v_1)=\bigl (u(x_1,y_1),v(x_1,y_1)\bigr ), \bigl (u_2,v_2)=(u(x_2,y_2),v(x_2,y_2)\bigr )\), \((x_1,y_1),(x_2,y_2)\in D_{\varrho }(0,0)\), weighted with the density \(f(u_1,v_1)f(u_2,v_2)\).
For each triangle MAB, the negative gradient of its area as function of M is a force vector \(\tfrac{1}{2} F_{M;AB}\) where \(F_{M;AB}\) is perpendicular to AB with a length proportional to the length \(|AB|\), see Fig. 10. Assuming that MAB is positively oriented, this vector equals \((v_2-v_1,-u_2+u_1)\).
Sorting the pairs (A, B) by the orientation angles \(\varphi \) of the lines \(F_{M;AB}\), we see that the minimization condition for the Oja median can be expressed as
Here, \(F(\varphi )\) is essentially the resultant of all forces \(F_{M;AB}\) for which the line AB intersects the ray from M in direction \((\cos \varphi ,\sin \varphi )\) perpendicularly. Each force \(F_{M;AB}\) is weighted with the combined density \(f(A)f(B)=f(u_1,v_1)f(u_2,v_2)\).
The factor 1 / 4 in front of the integral (53) combines the factor 1 / 2 from the force vector mentioned above with another factor 1 / 2 to compensate that each triangle MAB enters the integral twice (once as MAB and once as MBA, where the orientation factor cancels by squaring). Note that in [31] the integral was stated differently, integrating only over the triangles with positive orientation.
Moreover, \(u^*,v^*\) will be of order \({\mathcal {O}}(\varrho )\) (in fact, even \({\mathcal {O}}(\varrho ^2)\)). Thus, \((u^*,v^*)\) can be expressed up to higher order terms via linearization as
We therefore turn now to derive an expression for \(F(0,0,\varphi )\). Considering first \(\varphi =0\), this means that all point pairs (A, B) in the u-v right half-plane with \(u_1=u_2\) contribute to F(0, 0, 0), yielding
Note that the factor \((v_2-v_1)\) occurs squared in the integrand. One factor \(|v_2-v_1|\) originates from the length of the triangle baseline AB. The second factor \(|v_2-v_1|\) results from the fact that we have organized in (53), (55) an integration over point pairs (A, B) in the plane using a polar coordinate system similar to a Radon transform; \(v_2-v_1\) arises as the Jacobian of the corresponding coordinate transform from Cartesian to Radon coordinates. The derivatives of \(F(u^*,v^*,0)\) with regard to the coordinates of M are
Forces \(F(0,0,\varphi )\) and their derivatives for arbitrary angles \(\varphi \) will later be obtained from (55), (56), (57) by rotating the u, v coordinates accordingly.
For the median of the values (u, v) within a \(\varrho \)-neighborhood of \((x,y)=(0,0)\), the density f(u, v) is zero outside of an \({\mathcal {O}}(\varrho )\)-neighborhood of (0, 0), allowing to limit the indefinite integrals from (55) to the intervals \(u\in [0,\bar{u}]\), \(v_1,v_2\in \bigl [\underline{v}(u),\bar{v}(u)\bigr ]\) such that
Expanding \((v_2-v_1)^2=v_2^2-2v_1v_2+v_1^2\), (58) can be further decomposed into
where
for \(k=0,1,2\). Similarly, (56) yields
To compute F(0, 0, 0) and \(F_{u^*}(0,0,0)\), we write them as functions of the coefficients of (50), i.e., \(F(0,0,0)=:G(\alpha _1,\beta _1,\delta _1,\alpha _2,\beta _2,\delta _2)\) and \(F_{u^*}(0,0,0)=:H(\alpha _1,\beta _1,\delta _1,\alpha _2,\beta _2,\delta _2)\).
We will linearize G and H around the point \((\alpha _1,\beta _1,\delta _1,\alpha _2,\beta _2,\delta _2)=\varvec{0}\) that represents the linear function \(\bigl (u(x,y),v(x,y)\bigr )=(x,y)\). To justify this linearization, remember that we are interested in the limit \(\varrho \rightarrow 0\), such that only the terms of lowest order in \(\varrho \) matter. Cross-effects between the different coefficients occur only in higher order terms. Denoting from now on by \(\doteq \) equality up to higher order terms, we have therefore
where \(G^0\), \(G^0_{\alpha _1}\) etc. are short for \(G(\varvec{0})\), \(G_{\alpha _1}(\varvec{0})\) etc.
To compute \(G^0\) and \(H^0\), we insert into (55) the bounds \(\bar{u}=\varrho \), \(\bar{v}(u)=\sqrt{\varrho ^2-u^2}\), \(\underline{v}(u)=-\bar{v}(u)\). The density becomes constant within the region defined by \(\bar{u}\), \(\underline{v}(u)\) and \(\bar{v}(u)\), with \(f(u,v)=1\). Thus we have
For \(G^0_{\alpha _1}\) and \(H^0_{\alpha _1}\), one has to vary \(\alpha _1\) to obtain the bounds \(\bar{u}=\varrho +\alpha _1 \varrho ^2\), \(\bar{v}(u)=\sqrt{\varrho ^2-u^2+2\alpha _1 u^3}\), \(\underline{v}(u)\doteq -\bar{v}(u)\). The density f(u, v) within the so-given bounds is \(1/{\mathrm {det}}({\mathrm {D}}\varvec{u})\) at the location (x(u, v), y(u, v)) with \(x=u-\alpha _1 u^2+{\mathcal {O}}(\varrho ^3)\), \(y=v\), i.e., \(f(u,v)=1-2\alpha _1 u+{\mathcal {O}}(\varrho ^2)\). Thus we have
Proceeding analogously for the other coefficients, we find the values of \(\bar{u}\), \(\bar{v}\), \(\underline{v}\) and f(u, v) and the resulting coefficients compiled in Table 6.
Inserting the values from Table 6 into (62) and (63), we have
and by orthogonal transform in the u-v plane
Integration (53) then yields
and via (54) eventually
Inserting (51), (52) into (80), we see that for \({\mathrm {D}}\varvec{u}={\mathrm {diag}}(1,1)\) the Oja median filtering step approximates an explicit time step of size \(\tau =\varrho ^2/24\) of the PDE system (22)–(23). \(\square \)
Appendix 2: Second Proof of Lemma 2
As in the previous proof, we express the minimization condition as \(\varvec{\varPhi }(u^*,v^*)=0\) where \(\varvec{\varPhi }(u^*,v^*)\) expresses an anti-gradient of the objective function of the Oja median (the sum of triangle areas) at the median candidate point \(M=(u^*,v^*)\).
Let \(M=(u^*,v^*)\) with \(u^*,v^*={\mathcal {O}}(\varrho ^2)\). For two points \(A=(u_1,v_1)\), \(B=(u_2,v_2)\) in the u-v plane, the force exercised on M by the negative gradient of the area of triangle MAB is \(\frac{1}{2}F_{M;AB}\) where
provided the triangle MAB is positively oriented. If MAB is negatively oriented, the sign of \(F_{M;AB}\) changes.
Let now A and B given by
with \((x_1,y_1),(x_2,y_2)\in D_\varrho (\varvec{0})\).
Aggregating the forces \(F_{M;AB}\) directly by integration over \(x_1\), \(y_1\), \(x_2\), \(y_2\), and denoting again by \(\doteq \) equality up to higher order terms, one sees that the resulting force can be stated as
Here, \({\mathcal {A}}_{\pm }(x_1,y_1)\) denote the regions for \((x_2,y_2)\in D_\varrho \) for which MAB is positively or negatively oriented, respectively. Since \(B\in {\mathcal {A}}_+(x_1,y_1)\) if and only if \(A\in {\mathcal {A}}_-(x_2,y_2)\) and vice versa, we can switch the roles of \((x_1,y_1)\) and \((x_2,y_2)\) in two of the integrals to combine the previous expressions into
where \(|{\mathcal {A}}_{\pm }(x_1,y_1)|\) denote the areas of the respective regions.
It remains to determine the area differences
for all \((x_1,y_1)\in D_\varrho \).
To this end, we use again the Taylor expansion (50). For \(u^*=v^*=0\) and \(\alpha _1=\beta _1=\delta _1=\alpha _2=\beta _1=\delta _2=0\) we have \(u(x,y)=x\), \(v(x,y)=y\), and \(\mathcal {A}_+(x_1,y_1)\) and \({\mathcal {A}}_-(x_1,y_1)\) are half-disks separated by the diameter of \(D_\varrho \) through M and A. Generally, the two regions are separated by the curve \((u_1-u^*)(v_2-v^*)-(u_2-u^*)(v_1-v^*)=0\), which after inserting (50) and dropping higher order terms becomes
To determine the deviation of this line from the bisecting diameter mentioned above, we introduce coordinates aligned to the line MA by \(x_1=r\cos \varphi \), \(y_1=r\sin \varphi \) and \(x_2=s\cos \varphi -t\sin \varphi \), \(y_2=s\sin \varphi +t\cos \varphi \). We can then write (87) up to higher order terms as
Up to higher order terms, the area difference \(\varDelta {\mathcal {A}}(x_1,y_1)\) is minus double the area between this line and the s-axis in the interval \(s\in [-\varrho ,\varrho ]\), i.e.,
Inserting (50), (86) and (89) into (85) yields
which reproduces the result (78), (79) from the first proof such that one can again infer (80) and thereby (22), (23). \(\square \)
Appendix 3: Proof of Lemma 3
We start with the Taylor expansion of \(\varvec{u}(x,y,z)\) around (0, 0, 0) up to second order given as
where \(\alpha _1=\frac{1}{2}u_{xx}\), \(\beta _1=u_{xy}\) etc.
Similarly as in Appendix 1 for the bivariate planar case, we seek the point \(M:=(u^*,v^*,w^*)\) that minimizes the integral over all volumes of tetrahedra MABC with \(A=(u_1,v_1,w_1)\), \(B=(u_2,v_2,w_2)\), \(C=(u_3,v_3,w_3)\) where \((u_i,v_i,w_i)=(u(x_i,y_i,z_i),v(x_i,y_i,z_i),w(x_i,y_i,z_i))\) with \((x_i,y_i,z_i)\in B_\varrho (0,0,0)\), weighted with the density \(f(u_1,v_1,w_1)f(u_2,v_2,w_2)f(u_3,v_3,w_3)\).
For each tetrahedron MABC, the negative gradient of its volume as a function of M is a force vector \(\frac{1}{6}F_{M;ABC}\) perpendicular to the plane ABC with a length proportional to the area \(|ABC|\) of the triangle ABC. Assuming positive orientation of that triangle, \(F_{M;ABC}\) equals the vector (cross) product \(-(u_2-u_1,v_2-v_1,w_2-w_1)\times (u_3-u_1,v_3-v_1,w_3-w_1)\).
Organizing the integration over point triples (A, B, C) again by orientations of the force vectors, we consider the resultant \(F(u^*,v^*,w^*,\varvec{p})\) of all forces in direction of any given unit vector \(\varvec{p}\in {\mathrm {S}}^2\). Linearizing for \((u^*,v^*,w^*)\) around \(\varvec{0}\),
(compare (54)), and considering first the case where \(\varvec{p}{=}{\mathbf {e}}_1=(1,0,0)\) is the first coordinate vector, we can state the analogue of (55) as
The appearance of the square of the area \((v_2-v_1)(w_3-w_1)-(v_3-v_1)(w_2-w_1)\) is again due to the Radon-like polar coordinates underlying the integration over directions.
As in Appendix 1, the indefinite integrals can be limited to finite intervals \(u\in [0,\bar{u}]\), \(v_i\in \bigl [\underline{v}(u),\bar{v}(u)\bigr ]\), \(w_i\in \bigl [\underline{w}(u,v_i),\bar{w}(u,v_i)\bigr ]\) for \(i=1,2,3\). Expanding
then leads to
with
for \(k,l=0,1,2\).
We linearize \(F(0,0,0,{\mathbf {e}}_1)\) with regard to the 18 coefficients \(\omega \in \{\alpha _i,\beta _i,\gamma _i,\delta _i, \varepsilon _i,\zeta _i~|~i=1,2,3\}\) of the Taylor expansion (91)–(93)
Like in the bivariate case of Appendix 1, cross-effects between the coefficients \(\omega \) take effect only in higher-order terms that can be neglected for our purpose. Moreover, \(G^0\) is again a constant that vanishes in the integration over directions, so we refrain from explicitly calculating it.
To calculate the value \(G^0_\omega \) for each coefficient \(\omega \) one can then assume that only this particular coefficient varies around 0 while all other coefficients vanish. For 10 of the coefficients \(\omega \) one calculates then the integration bounds \(\bar{u}\), \(\underline{v}(u)\), \(\bar{v}(u)\), \(\underline{w}(u,v)\), \(\bar{w}(u,v)\) and the density function f(u, v, w) as stated in Table 7, the respective integrals \(J_{kl}(u)\) as given in Table 8 and finally using (97) the coefficients \(G^0_\omega \) which are again listed in Table 7. The remaining eight coefficients need not be calculated in this tedious way as they can be derived from the obvious symmetry of \(F(0,0,0,{\mathbf {e}}_1)\) under the exchange of y and z; the detailed symmetries of coefficients are also stated in Table 7.
For the derivatives of F we have
Here, \(H^0\) is calculated from the unperturbed case \(u=x\), \(v=y\), \(w=z\) via
Thus only the first summand of the integrand of (97) is non-zero, leading to
From the so obtained expressions
general expressions for \(F(0,0,0,\varvec{p})\) and its derivatives w.r.t. \(u^*\), \(v^*\), \(w^*\) can be obtained. Given the parametrization
one can use, e.g., the rotation matrix:
to transform the (u, v, w) and (x, y, z) coordinates simultaneously. (There is a degree of freedom in the choice of R that corresponds to a rotation around the direction of \(\varvec{p}\).)
Integration over directions then yields
and similarly
and by (94)
hence an explicit time step of size \(\tau =\varrho ^2/20\) of the PDE system (35)–(37). \(\square \)
Appendix 4: Proof of Lemma 4
We start again from the Taylor expansion (91)–(93) of the function \(\varvec{u}\) around the point \(\varvec{x}=\varvec{0}\).
The \(L^1\) median \((\varvec{u}^*,\varvec{v}^*,\varvec{w}^*)\) of the function values of \(\varvec{u}\) within the structuring element \(B_\varrho \) is determined by the equilibrium conditions
With the goal of the PDE approximation, we will determine the median as linear function of the Taylor coefficients. Cross-effects between the Taylor coefficients will again be restricted to higher order terms in \(\varrho \) that can be neglected in our asymptotic analysis for \(\varrho \rightarrow 0\). We can therefore study the effects of the Taylor coefficients separately.
To start with \(\alpha _1\), we insert in (114) the function \(u=x+\alpha _1x^2\), \(v=y\), \(w=z\), and obtain the three conditions
where
Condition (116) can be turned by substituting \(-y\) for y into the same equation with \(-v^*\) in place of \(v^*\), i.e., for any triple \((u^*,v^*,w^*)\) that satisfies the three conditions, \((u^*,-v^*,w^*)\) does the same. By the convexity of the objective function of the \(L^1\) median it follows that \((u^*,0,w^*)\) is in this case also a minimizer. The same argument works for \(w^*\). Hence, we can seek the median as \((u^*,v^*,w^*)=(\lambda \varrho ^2,0,0)\) and need to consider only Condition (115). Using the substitution \(x=\xi \varrho \), \(y=\eta \varrho \), \(z=\zeta \varrho \) we obtain
Splitting this integral into the integrals over \(B_{\varrho ^{2/5}}\) and \(B_1\setminus B_{\varrho ^{2/5}}\), we see that the integral over \(B_{\varrho ^{2/5}}\) is of order \({\mathcal {O}}(\varrho ^{6/5})\) because the integrand is absolutely bounded by 1. In the domain of the second integral, we have that \((\alpha _1\xi ^2-\lambda )\varrho /(\xi ^2+\eta ^2+\zeta ^2)=\mathcal {O}(\varrho ^{3/5})\) and therefore by Taylor expansion
which leads to
and finally, by neglecting \({\mathcal {O}}(\varrho ^{1/5})\) terms, to
thus in the limit \((u^*,v^*,w^*) = \frac{1}{20}\varrho ^2(u_{xx},0,0)\).
By permutation of variables, one finds \((u^*,v^*,w^*) = \frac{1}{20}\varrho ^2(0,v_{yy},0)\) if \(u=x\), \(v=y+\delta _2y^2\), \(w=z\), and \((u^*,v^*,w^*) = \frac{1}{20}\varrho ^2(0,0,w_{zz})\) if \(u=x\), \(v=y\), \(w=z+\zeta _3z^2\).
Turning to the case \(u=x+\delta _1y^2\), \(v=y\), \(w=z\), we can conclude \(v^*=w^*=0\) by a similar symmetry argument as before. For the remaining condition
we proceed by the same substitutions, splitting of the integral domain, and Taylor expansion of the denominator to finally obtain
thus in the limit \((u^*,v^*,w^*) = \frac{1}{20}\varrho ^2(2u_{yy},0,0)\).
By permutation of variables this also determines the \(u_{zz}\), \(v_{xx}\), \(v_{zz}\), \(w_{xx}\) and \(w_{yy}\) contributions of the PDE system (35)–(37).
For \(u=x+\beta xy\), \(v=y\), \(w=z\) we find \(u^*=w^*=0\) by symmetry considerations and evaluate the second component of (114) with \(v^*=\mu \varrho ^2\) to
thus in the limit \((u^*,v^*,w^*) = \frac{1}{20}\varrho ^2(0,-u_{xy},0)\).
Permutation of the variables yields all remaining terms of (35)–(37). \(\square \)
Appendix 5: Proof of Lemma 5
The Taylor expansion of \(\varvec{u}(x,y)\) around (0, 0, 0) up to second order is given as
where \(\alpha _1=\frac{1}{2}u_{xx}\), \(\beta _1=u_{xy}\) etc.
We will again express the median of data values within the structuring element \(D_\varrho \) in terms of the Taylor coefficients, neglecting terms of higher order in \(\varrho \). As in the settings before, cross-effects between the Taylor coefficients influence only higher-order terms such that the Taylor coefficients can be considered separately.
As long as \(\alpha _3=\beta _3=\delta _3=0\), the component w is identically zero, and thus \(w^*=0\). Moreover, the effects of \(\alpha _1\), ..., \(\delta _2\) on \(u^*\) and \(v^*\) are the same as in Lemma 2, such that we need only to consider \(\alpha _3\), \(\beta _3\) and \(\delta _3\).
Since by the influence of w which varies just in order \({\mathcal {O}}(\varrho ^2)\) around zero, the triangles whose area sum is minimized by the 2D Oja median stay approximately in the u-v plane and their deformation is restricted to higher order terms, neither of \(\alpha _3\), \(\beta _3\) and \(\delta _3\) influences the first two median components \(u^*\), \(v^*\) asymptotically.
It remains to study \(w^*\). For the case \(u=x\), \(v=y\), \(w=\beta _3xy\) we notice that mirroring the structuring element by replacing y with \(-y\), followed by replacing w with \(-w\), restores the original function. Thus, for each minimizer \(w^*\) in this case, \(-w^*\) is also a minimizer, and by convexity of the objective function \(w^*=0\) is a minimizer.
Regarding \(\alpha _3\) and \(\delta _3\), notice that rotation of the structuring element by \(90^\circ \) switches the roles of \(\alpha \) and \(\delta \). As this rotation leaves the input value set unchanged, we see that \(\alpha _3\) and \(\delta _3\) must have equal effects. We can therefore consider the rotationally symmetric case \(\alpha _3=\delta _3\).
Assume therefore that we have \(u=x\), \(v=y\), and \(w=\alpha (x^2+y^2)\), and \(M=(0,0,w^*)\) is the sought 2D Oja median. The median point constitutes an equilibrium between forces exercised by point pairs (A, B) with \(A=(u_1,v_1,w_1)=\bigl (x_1,y_1,\alpha (x_1^2+y_1^2)\bigr )\), \(B=(u_2,v_2,w_2)=\bigl (x_2,y_2,\alpha (x_2^2+y_2^2)\bigr )\). The force coming from a single point pair (A, B) is expressed by a vector of length \(|AB|\) in direction MH, where H is the foot of the altitude on AB in the triangle MAB. Thus, the sought 2D Oja median is a weighted \(L^1\) median of the feet H, weighted with the base lengths \(|AB|\). The equilibrium condition for M can therefore be written similarly as in (114) as
where the points H, A, B still need to be expressed in coordinates. Before we do so, we notice that reorganization of the quadruple integral in Radon-like polar coordinates as in Appendix 1 creates an additional weight factor \(|AB|\) and an integrand that is rotationally symmetric with regard to the angular coordinate \(\varphi \). One can therefore drop the integration over \(\varphi \) and consider just \(\varphi =0\) as minimality condition. Denoting by \(H'\), \(A'\), \(B'\) the projections of H, A, B, respectively, to the u-v plane, the case \(\varphi =0\) describes a configuration in which \(A'B'\) is aligned in v direction, and the altitude in \(MA'B'\) therefore in u direction. Since \(H'\) deviates from the foot of the altitude in \(MA'B'\) at most by higher order terms, we can assume that \(H'=(x,0)\), \(A'=(x,y_1)\), \(B'=(x,y_2)\). The 3D points A and B are then given by \(A=\bigl (x,y_1,\alpha (x^2+y_1^2)\bigr )\), \(B=\bigl (x,y_2,\alpha (x^2+y_2^2)\bigr )\). H is given up to higher order terms by \(H=\bigl (x,0,\alpha (x^2-y_1y_2)\bigr )\).
This leads to the simplified equilibrium condition
and after substituting \(x=\xi \varrho \), \(y_1=\eta _1\varrho \), \(y_2=\eta _2\varrho \), \(w^*=\nu \varrho ^2\) one has
Splitting the integration range of the outer integral to the two intervals \([0,\varrho ^{2/3}]\) and \([\varrho ^{2/3},1]\) we see that the first integral yields \({\mathcal {O}}(\varrho ^{2/3})\) since its integrand is absolutely bounded by 1, whereas the second integral is simplified further by noticing that \(\sqrt{\xi ^2+\varrho ^2\bigl (\alpha (\xi ^2-\eta _1\eta _2)-\nu \bigr )^2} =\xi \bigl (1+{\mathcal {O}}(\varrho ^{2/3})\bigr )\) to
from which we obtain
and after integral evaluation
Since for the given function one has \(w_{xx}=w_{yy}=2\alpha \), it follows that each of \(w_{xx}\) and \(w_{yy}\) effects \(w^*\) with weight 1 / 12, which concludes the proof. \(\square \)
Appendix 6: Numerical Scheme for the PDE (38)
We use the notations from Sect. 4.2.1. By square brackets \([\ldots ]\) we denote discrete approximations of the enclosed derivative expressions at pixel (i, j) in time step k. The numerical scheme for the PDE (38) proceeds for each pixel (i, j) as follows.
-
1.
Compute the central difference approximations
$$\begin{aligned}{}[\varvec{u}_x]&:= \tfrac{1}{2h} (\varvec{u}^k_{i+1,j}-\varvec{u}^k_{i-1,j})\;, \end{aligned}$$(136)$$\begin{aligned} {[}\varvec{u}_y{]}&:= \tfrac{1}{2h} (\varvec{u}^k_{i,j+1}-\varvec{u}^k_{i,j-1})\;. \end{aligned}$$(137) -
2.
From \([{\mathrm {D}}\varvec{u}]=\bigl ([\varvec{u}_x]~|~[\varvec{u}_y]\bigr )\) compute the \(3\times 3\) tensor product matrix \(\varvec{C}:=[{\mathrm {D}}\varvec{u}][{\mathrm {D}}\varvec{u}]^{\mathrm {T}}\). Compute the spectral decomposition of \(\varvec{C}\),
$$\begin{aligned} \varvec{C}&= \varvec{Q} \varvec{\varLambda } \varvec{Q}^{\mathrm {T}}\end{aligned}$$(138)where \(\varvec{Q}\) is orthogonal, and \(\varvec{\varLambda }\) is the diagonal matrix of the (nonnegative) eigenvalues of \(\varvec{C}\) in decreasing order, \(\lambda _1\ge \lambda _2\ge \lambda _3\).
-
3.
Apply to the input values \(\varvec{u}_{i,j}^k\) the orthogonal transform
$$\begin{aligned} \hat{\varvec{u}}_{i,j}^k&:= \varvec{Q}^{\mathrm {T}}\varvec{u}_{i,j}^k\;. \end{aligned}$$(139)Note that hereafter, the first and second channels of \(\hat{\varvec{u}}\) hold the directions of dominant variation within the patch, i.e., the first two basis vectors of the transformed dataset span the tangential space of the image graph. Moreover, the gradients of the first two channels of \(\hat{\varvec{u}}\) are orthogonal in the (x, y) plane.
-
4.
Compute the central difference approximations
$$\begin{aligned}{}[\hat{\varvec{u}}_x]&:= \tfrac{1}{2h} (\hat{\varvec{u}}^k_{i+1,j}-\hat{\varvec{u}}^k_{i-1,j})\;, \end{aligned}$$(140)$$\begin{aligned} {[}\hat{\varvec{u}}_y{]}&:= \tfrac{1}{2h} (\hat{\varvec{u}}^k_{i,j+1}-\hat{\varvec{u}}^k_{i,j-1})\;, \end{aligned}$$(141)$$\begin{aligned} {[}\hat{\varvec{u}}_{xx}{]}&:= \tfrac{1}{h^2} (\hat{\varvec{u}}^k_{i+1,j}-2\hat{\varvec{u}}^k_{i,j} +\hat{\varvec{u}}^k_{i-1,j})\;, \end{aligned}$$(142)$$\begin{aligned} {[}\hat{\varvec{u}}_{yy}{]}&:= \tfrac{1}{h^2} (\hat{\varvec{u}}^k_{i,j+1}-2\hat{\varvec{u}}^k_{i,j} +\hat{\varvec{u}}^k_{i,j-1})\;, \end{aligned}$$(143)$$\begin{aligned} {[}\hat{\varvec{u}}_{xy}{]}&:= \tfrac{1}{4h^2} (\hat{\varvec{u}}^k_{i+1,j+1}-\hat{\varvec{u}}^k_{i+1,j-1} \nonumber \\&\quad \qquad -\hat{\varvec{u}}^k_{i-1,j+1}+\hat{\varvec{u}}^k_{i-1,j-1})\;. \end{aligned}$$(144) -
5.
Compute the first contribution to \(\hat{\varvec{u}}_t\) as
$$\begin{aligned} \hat{\varvec{z}}_1&:= [\hat{\varvec{u}}_{xx}] + [\hat{\varvec{u}}_{yy}]\;. \end{aligned}$$(145) -
6.
From the first component \(\hat{u}\) of \(\hat{\varvec{u}}\), determine the image adaptive directions
$$\begin{aligned} \varvec{\eta }&:= \begin{pmatrix}c\\ s\end{pmatrix} = \frac{1}{\sqrt{[\hat{u}_x]^2+[\hat{u}_y]^2}} \begin{pmatrix} [\hat{u}_x]\\ [\hat{u}_y] \end{pmatrix}\;,\end{aligned}$$(146)$$\begin{aligned} \varvec{\xi }&:= \begin{pmatrix}-s\\ c\end{pmatrix} \end{aligned}$$(147)and the directional derivatives
$$\begin{aligned}{}[\hat{\varvec{u}}_{\varvec{\eta }}]&:= c[\hat{\varvec{u}}_x]+s[\hat{\varvec{u}}_y]\;, \end{aligned}$$(148)$$\begin{aligned} {[}\hat{\varvec{u}}_{\varvec{\xi }}{]}&:= -s[\hat{\varvec{u}}_x]+c[\hat{\varvec{u}}_y]\;,\end{aligned}$$(149)$$\begin{aligned} {[}\hat{\varvec{u}}_{\varvec{\eta \eta }}{]}&:= c^2[\hat{\varvec{u}}_{xx}] +2cs[\hat{\varvec{u}}_{xy}]+s^2[\hat{\varvec{u}}_{yy}]\;,\end{aligned}$$(150)$$\begin{aligned} {[}\hat{\varvec{u}}_{\varvec{\xi \xi }}{]}&:= s^2[\hat{\varvec{u}}_{xx}] -2cs[\hat{\varvec{u}}_{xy}]+c^2[\hat{\varvec{u}}_{yy}]\;,\end{aligned}$$(151)$$\begin{aligned} {[}\hat{\varvec{u}}_{\varvec{\eta \xi }}{]}&:= cs\bigl ([\hat{\varvec{u}}_{yy}]-[\hat{\varvec{u}}_{xx}]\bigr ) +(c^2-s^2)[\hat{\varvec{u}}_{xy}]\;. \end{aligned}$$(152) -
7.
Compute the second contribution to \(\hat{\varvec{u}}_t\) as
$$\begin{aligned} \hat{\varvec{z}}_2&:= 2 \bigl ( [\hat{u}_{\xi \xi }], [\hat{v}_{\eta \eta }], 0 \bigr )^{\mathrm {T}}\;. \end{aligned}$$(153) -
8.
Compute one-sided derivatives
$$\begin{aligned}{}[\hat{\varvec{u}}_x]^+&:= \tfrac{1}{h} (\hat{\varvec{u}}^k_{i+1,j}-\hat{\varvec{u}}^k_{i,j})\;, \end{aligned}$$(154)$$\begin{aligned} {[}\hat{\varvec{u}}_x{]}^-&:= \tfrac{1}{h} (\hat{\varvec{u}}^k_{i,j}-\hat{\varvec{u}}^k_{i-1,j})\;, \end{aligned}$$(155)$$\begin{aligned} {[}\hat{\varvec{u}}_y{]}^+&:= \tfrac{1}{h} (\hat{\varvec{u}}^k_{i,j+1}-\hat{\varvec{u}}^k_{i,j})\;, \end{aligned}$$(156)$$\begin{aligned} {[}\hat{\varvec{u}}_y{]}^-&:= \tfrac{1}{h} (\hat{\varvec{u}}^k_{i,j}-\hat{\varvec{u}}^k_{i,j-1})\;. \end{aligned}$$(157)If \([\hat{\varvec{u}}_x]^+\) and \([\hat{\varvec{u}}_x]^-\) have opposite sign, replace the one with larger absolute value with their sum \([\hat{\varvec{u}}_x]^++[\hat{\varvec{u}}_x]^-\) and set the other one to zero (minmod stabilization). Proceed in the same way for \([\hat{\varvec{u}}_y]^\pm \). From the so obtained approximations, compute one-sided directional derivatives
$$\begin{aligned} {[}\hat{\varvec{u}}_{\varvec{\eta }}{]}^\pm&:= c[\hat{\varvec{u}}_x]^\pm +s[\hat{\varvec{u}}_y]^\pm \;,\end{aligned}$$(158)$$\begin{aligned} {[}\hat{\varvec{u}}_{\varvec{\xi }}{]}^\pm&:= -s[\hat{\varvec{u}}_x]^\mp +c[\hat{\varvec{u}}_y]^\pm \;, \end{aligned}$$(159)if \(c,s\ge 0\), and analogously for other sign combinations of c, s.
-
9.
Compute regularized approximations \(R_v\) for \(v_{\eta \xi }/v_{\xi }\) and \(R_u\) for \(u_{\eta \xi }/u_{\eta }\) as
$$\begin{aligned} R_v&:= \frac{2[\hat{v}_{\varvec{\eta \xi }}][\hat{v}_{\varvec{\xi }}]}{\bigl ([\hat{v}_{\varvec{\xi }}]^+\bigr )^2+ \bigl ([\hat{v}_{\varvec{\xi }}]^-\bigr )^2+2\varepsilon }\;, \end{aligned}$$(160)$$\begin{aligned} R_u&:= \frac{2[\hat{u}_{\varvec{\eta \xi }}][\hat{u}_{\varvec{\eta }}]}{\bigl ([\hat{u}_{\varvec{\eta }}]^+\bigr )^2+ \bigl ([\hat{u}_{\varvec{\eta }}]^-\bigr )^2+2\varepsilon } \end{aligned}$$(161)with a fixed numerical regularization parameter \(\varepsilon \).
-
10.
Compute the third contribution to \(\hat{\varvec{u}}_t\) by the upwind discretization
$$\begin{aligned} \varvec{z}_3&:= \bigl ( R_v [\hat{u}_{\varvec{\eta }}]^\mp , R_u [\hat{v}_{\varvec{\xi }}]^\mp , 0\bigr )^{\mathrm {T}}\;, \end{aligned}$$(162)choosing in each component the backward approximation \([\ldots ]^-\) if the preceding factor is positive, and \([\ldots ]^+\) otherwise.
-
11.
Let \([\hat{\varvec{u}}_t]:= \varvec{z}_1+\varvec{z}_2-\varvec{z}_3\) and by inverting the orthogonal transform
$$\begin{aligned}{}[\varvec{u}_t]&:= \varvec{Q}\,[\hat{\varvec{u}}_t] \;. \end{aligned}$$(163) -
12.
Compute \(\varvec{u}_{i,j}^{k+1} = \varvec{u}_{i,j}^k + \tau [\varvec{u}_t]\).
Rights and permissions
About this article
Cite this article
Welk, M. Multivariate Median Filters and Partial Differential Equations. J Math Imaging Vis 56, 320–351 (2016). https://doi.org/10.1007/s10851-016-0645-9
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10851-016-0645-9