Skip to main content
Log in

Multivariate Median Filters and Partial Differential Equations

  • Published:
Journal of Mathematical Imaging and Vision Aims and scope Submit manuscript

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.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

References

  1. 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)

    Article  MathSciNet  MATH  Google Scholar 

  2. 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)

    Article  MathSciNet  MATH  Google Scholar 

  3. Anandan, P.: A computational framework and an algorithm for the measurement of visual motion. Int. J. Comput. Vis. 2, 283–310 (1989)

    Article  Google Scholar 

  4. Astola, J., Haavisto, P., Neuvo, Y.: Vector median filters. Proc. IEEE 78(4), 678–689 (1990)

    Article  Google Scholar 

  5. Austin, T.L.: An approximation to the point of minimum aggregate distance. Metron 19, 10–21 (1959)

    MathSciNet  MATH  Google Scholar 

  6. Barbara, R.: The Fermat–Torricelli points of \(n\) lines. Math. Gazette 84, 24–29 (2001)

    Article  Google Scholar 

  7. 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)

    Article  MATH  Google Scholar 

  8. 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)

    Chapter  Google Scholar 

  9. 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)

    Article  MathSciNet  MATH  Google Scholar 

  10. 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)

    Article  MathSciNet  MATH  Google Scholar 

  11. Chakraborty, B., Chaudhuri, P.: A note on the robustness of multivariate medians. Stat. Probab. Lett. 45, 269–276 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  12. Chung, D.H., Sapiro, G.: On the level lines and geometry of vector-valued images. IEEE Signal Process. Lett. 7(9), 241–243 (2000)

    Article  Google Scholar 

  13. Eckhardt, U.: Root images of median filters. J. Math. Imaging Vis. 19, 63–70 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  14. Gini, C., Galvani, L.: Di talune estensioni dei concetti di media ai caratteri qualitativi. Metron 8, 3–209 (1929)

    MATH  Google Scholar 

  15. 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)

    Google Scholar 

  16. 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)

    Google Scholar 

  17. Hettmansperger, T.P., Randles, R.H.: A practical affine equivariant multivariate median. Biometrika 89(4), 851–860 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  18. Horn, B., Schunck, B.: Determining optical flow. Artif. Intell. 17, 185–203 (1981)

    Article  Google Scholar 

  19. 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)

    Chapter  Google Scholar 

  20. 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)

    Article  Google Scholar 

  21. Oja, H.: Descriptive statistics for multivariate distributions. Stat. Probab. Lett 1, 327–332 (1983)

    Article  MathSciNet  MATH  Google Scholar 

  22. Rao, C.R.: Methodology based on the \(l_1\)-norm in statistical inference. Sankhyā A 50, 289–313 (1988)

    MATH  Google Scholar 

  23. 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)

    Chapter  Google Scholar 

  24. Small, C.G.: A survey of multidimensional medians. Int. Stat. Rev. 58(3), 263–277 (1990)

    Article  Google Scholar 

  25. Spence, C., Fancourt, C.: An iterative method for vector median filtering. Proc. IEEE Int. Conf. Image Process. 5, 265–268 (2007)

  26. Struyf, A., Hubert, M., Rousseeuw, P.J.: Clustering in an object-oriented environment. J. Stat. Softw. 1(4), 1–30 (1997)

    Google Scholar 

  27. Tukey, J.W.: Exploratory Data Analysis. Addison-Wesley, Menlo Park (1971)

    MATH  Google Scholar 

  28. Vardi, Y., Zhang, C.H.: A modified Weiszfeld algorithm for the Fermat–Weber location problem. Math. Program. A 90, 559–566 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  29. Weber, A.: Über den Standort der Industrien. Mohr, Tübingen (1909)

    Google Scholar 

  30. 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)

    MATH  Google Scholar 

  31. 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)

    Google Scholar 

  32. Welk, M.: Corrected PDE approximation result for the multivariate \({L}^1\) median filter. Technical report (In preparation)

  33. 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)

    Google Scholar 

  34. Welk, M., Breuß, M., Vogel, O.: Morphological amoebas are self-snakes. J. Math. Imaging Vis. 39, 87–99 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  35. 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)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Martin Welk.

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 (uv) up to second order around (0, 0) reads as

$$\begin{aligned} \begin{pmatrix}u(x,y)\\ v(x,y)\end{pmatrix}&= \begin{pmatrix}x\\ y\end{pmatrix} + \begin{pmatrix} \alpha _1 x^2+\beta _1 xy+\delta _1 y^2\\ \alpha _2 x^2+\beta _2 xy+\delta _2 y^2 \end{pmatrix}\;, \end{aligned}$$
(50)

where the coefficients are given by derivatives of u, v at \((x,y)=(0,0)\) as

$$\begin{aligned} \alpha _1&=\tfrac{1}{2}u_{xx}(0,0)\;,&\beta _1&=u_{xy}(0,0)\;,&\delta _1&=\tfrac{1}{2}u_{yy}(0,0)\;, \end{aligned}$$
(51)
$$\begin{aligned} \alpha _2&=\tfrac{1}{2}v_{xx}(0,0)\;,&\beta _2&=v_{xy}(0,0)\;,&\delta _2&=\tfrac{1}{2}v_{yy}(0,0)\;. \end{aligned}$$
(52)

Restating the definition of Oja’s simplex median for continuous datasets with density function f(uv), 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)\).

Fig. 10
figure 10

Anti-gradient vector \(F_{M;AB}\) for the area of a triangle MAB with variable point M. From [31]

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 (AB) 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

$$\begin{aligned} \varvec{\varPhi }(u^*,v^*) = \frac{1}{4} \int _{0}^{2\pi } \begin{pmatrix}\cos \varphi \\ \sin \varphi \end{pmatrix} F(u^*,v^*,\varphi ) \,{\mathrm {d}}\varphi = 0\;. \end{aligned}$$
(53)

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

$$\begin{aligned} \begin{pmatrix}u^*\\ v^*\end{pmatrix}&= -\bigl ({\mathrm {D}}\varvec{\varPhi }(0,0)\bigr )^{-1}\varvec{\varPhi }(0,0)\;. \end{aligned}$$
(54)

We therefore turn now to derive an expression for \(F(0,0,\varphi )\). Considering first \(\varphi =0\), this means that all point pairs (AB) in the u-v right half-plane with \(u_1=u_2\) contribute to F(0, 0, 0), yielding

$$\begin{aligned} F(0,0,0)&= \int _{0}^{+\infty } \int _{-\infty }^{+\infty } \int _{-\infty }^{+\infty } f(u,v_1) f(u,v_2)\nonumber \\&\quad \times (v_2-v_1)^2 \,{\mathrm {d}}v_2 \,{\mathrm {d}}v_1 \,{\mathrm {d}}u. \end{aligned}$$
(55)

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 (AB) 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

$$\begin{aligned} F_{u^*}(0,0,0)&= -\int _{-\infty }^{+\infty } \int _{-\infty }^{+\infty } f(0,v_1) f(0,v_2)\nonumber \\&\qquad \qquad \quad \times (v_2-v_1)^2 \,{\mathrm {d}}v_2 \,{\mathrm {d}}v_1 \;, \end{aligned}$$
(56)
$$\begin{aligned} F_{v^*}(0,0,0)&=0\;. \end{aligned}$$
(57)

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 (uv) within a \(\varrho \)-neighborhood of \((x,y)=(0,0)\), the density f(uv) 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

$$\begin{aligned} F(0,0,0)&= \int _{0}^{\bar{u}} \int _{\underline{v}(u)}^{\bar{v}(u)} \int _{\underline{v}(u)}^{\bar{v}(u)} f(u,v_1) f(u,v_2) \times \nonumber \\&\qquad \qquad \times (v_2-v_1)^2 \,{\mathrm {d}}v_2 \,{\mathrm {d}}v_1 \,{\mathrm {d}}u \;. \end{aligned}$$
(58)

Expanding \((v_2-v_1)^2=v_2^2-2v_1v_2+v_1^2\), (58) can be further decomposed into

$$\begin{aligned} F(0,0,0)&= \int _{0}^{\bar{u}} \bigl (2J_2(u)J_0(u)-2J_1(u)^2\bigr ) \,{\mathrm {d}}u \end{aligned}$$
(59)

where

$$\begin{aligned} J_k(u)&:=\int _{\underline{v}(u)}^{\bar{v}(u)}f(u,v)\,v^k\,{\mathrm {d}}v \end{aligned}$$
(60)

for \(k=0,1,2\). Similarly, (56) yields

$$\begin{aligned} F_{u^*}(0,0,0)&= -\bigl (2J_2(0)J_0(0)-2J_1(0)^2\bigr ) \;. \end{aligned}$$
(61)

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

$$\begin{aligned} G\doteq G^0&+G^0_{\alpha _1}\alpha _1+G^0_{\beta _1}\beta _1+G^0_{\delta _1}\delta _1 \nonumber \\&+G^0_{\alpha _2}\alpha _2+G^0_{\beta _2}\beta _2+G^0_{\delta _2}\delta _2 \;, \end{aligned}$$
(62)
$$\begin{aligned} H\doteq H^0&+H^0_{\alpha _1}\alpha _1+H^0_{\beta _1}\beta _1+H^0_{\delta _1}\delta _1 \nonumber \\&+H^0_{\alpha _2}\alpha _2+H^0_{\beta _2}\beta _2+H^0_{\delta _2}\delta _2 \end{aligned}$$
(63)

where \(G^0\), \(G^0_{\alpha _1}\) etc. are short for \(G(\varvec{0})\), \(G_{\alpha _1}(\varvec{0})\) etc.

Table 6 Integration bounds, densities, integrals \(J_k(u)\) and resulting coefficients \(G^0_{\omega }\), \(H^0_{\omega }\) of the expansions (62), (63) for \(\omega \in \{\alpha _1,\beta _1,\delta _1,\alpha _2,\beta _2,\delta _2\}\). \(J_1(u)\) and \(H^0_\omega \) are always zero and therefore omitted

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

$$\begin{aligned} J_2(u)&=\tfrac{2}{3}(\varrho ^2-u^2)^{3/2}\;, \end{aligned}$$
(64)
$$\begin{aligned} J_1(u)&=0\;, \end{aligned}$$
(65)
$$\begin{aligned} J_0(u)&=2(\varrho ^2-u^2)^{1/2} \end{aligned}$$
(66)

and via (59) and (61) finally

$$\begin{aligned} G^0&= \tfrac{64}{45}\varrho ^5\;,&H^0&= -\tfrac{8}{3}\varrho ^4\;. \end{aligned}$$
(67)

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(uv) within the so-given bounds is \(1/{\mathrm {det}}({\mathrm {D}}\varvec{u})\) at the location (x(uv), y(uv)) 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

$$\begin{aligned} J_2(u)&\doteq \tfrac{2}{3}(1-2\alpha _1 u)(\varrho ^2-u^2+2\alpha _1 u^3)^{3/2}\;, \end{aligned}$$
(68)
$$\begin{aligned} J_1(u)&= 0\;, \end{aligned}$$
(69)
$$\begin{aligned} J_0(u)&\doteq 2(1-2\alpha _1 u)(\varrho ^2-u^2+2\alpha _1 u^3)^{1/2} \end{aligned}$$
(70)

and therefore by (59), (61)

$$\begin{aligned} G^0_{\alpha _1}&\doteq \frac{{\mathrm {d}}}{{\mathrm {d}}\alpha _1} \int _0^{\bar{u}} \frac{8}{3}(1-2\alpha _1 u)^2(\varrho ^2-u^2+2\alpha _1 u^3)^2 \,{\mathrm {d}}u \,\bigg |_{\alpha _1=0} \nonumber \\ {}&= -\frac{8}{9}\varrho ^6\;, \end{aligned}$$
(71)
$$\begin{aligned} H^0_{\alpha _1}&\doteq -\frac{{\mathrm {d}}}{{\mathrm {d}}\alpha _1} \,\frac{8}{3}\varrho ^4 \,\bigg |_{\alpha _1=0} = 0\;. \end{aligned}$$
(72)

Proceeding analogously for the other coefficients, we find the values of \(\bar{u}\), \(\bar{v}\), \(\underline{v}\) and f(uv) and the resulting coefficients compiled in Table 6.

Inserting the values from Table 6 into (62) and (63), we have

$$\begin{aligned} F(0,0,0)&= \tfrac{64}{45}\varrho ^5 +\tfrac{8}{9}\varrho ^6(-\alpha _1+2\delta _1+\beta _2)\;, \end{aligned}$$
(73)
$$\begin{aligned} F_{u^*}(0,0,0)&= \tfrac{8}{3}\varrho ^4\;, \end{aligned}$$
(74)

and by orthogonal transform in the u-v plane

$$\begin{aligned}&F(0,0,\varphi )\nonumber \\&\quad = \tfrac{64}{45}\varrho ^5 +\tfrac{8}{9}\varrho ^6\Bigl ( -(\alpha _1\cos \varphi +\alpha _2\sin \varphi )\cos ^2\varphi \nonumber \\ {}&\qquad -(\beta _1\cos \varphi +\beta _2\sin \varphi )\cos \varphi \sin \varphi \nonumber \\&\qquad -(\delta _1\cos \varphi +\delta _2\sin \varphi )\sin ^2\varphi \nonumber \\&\qquad +2(\alpha _1\cos \varphi +\alpha _2\sin \varphi )\sin ^2\varphi \nonumber \\&\qquad -2(\beta _1\cos \varphi +\beta _2\sin \varphi )\cos \varphi \sin \varphi \nonumber \\&\qquad +2(\delta _1\cos \varphi +\delta _2\sin \varphi )\cos ^2\varphi \nonumber \\&\qquad -2(-\alpha _1\sin \varphi +\alpha _2\cos \varphi )\cos \varphi \sin \varphi \nonumber \\&\qquad +(-\beta _1\sin \varphi +\beta _2\cos \varphi )(\cos ^2\varphi -\sin ^2\varphi ) \nonumber \\&\qquad +2(-\delta _1\sin \varphi +\delta _2\cos \varphi )\cos \varphi \sin \varphi \Bigr ) \;, \end{aligned}$$
(75)
$$\begin{aligned}&F_{u^*}(0,0,\varphi ) = \tfrac{8}{3}\varrho ^4\cos \varphi \;, \end{aligned}$$
(76)
$$\begin{aligned}&F_{v^*}(0,0,\varphi ) = \tfrac{8}{3}\varrho ^4\sin \varphi \;. \end{aligned}$$
(77)

Integration (53) then yields

$$\begin{aligned} \varvec{\varPhi }(0,0)&= \frac{\pi }{18}\varrho ^6 \begin{pmatrix} \alpha _1+3\delta _1-\beta _2\\ 3\alpha _2-\delta _2-\beta _1 \end{pmatrix}\;, \end{aligned}$$
(78)
$$\begin{aligned} {\mathrm {D}}\varvec{\varPhi }(0,0)&= -\frac{2}{3}\pi \varrho ^4\begin{pmatrix}1&{}0\\ 0&{}1\end{pmatrix} \end{aligned}$$
(79)

and via (54) eventually

$$\begin{aligned} \begin{pmatrix}u^*\\ v^*\end{pmatrix}&= \frac{\varrho ^2}{12} \begin{pmatrix} \alpha _1+3\delta _1-\beta _2\\ 3\alpha _2+\delta _2-\beta _1 \end{pmatrix}\;. \end{aligned}$$
(80)

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

$$\begin{aligned} F_{M;AB} = \begin{pmatrix} v_2-v_1\\ u_1-u_2 \end{pmatrix} = \begin{pmatrix} v_2\\ -u_2\end{pmatrix} - \begin{pmatrix} v_1\\ -u_1 \end{pmatrix} +{\mathcal {O}}(\varrho ^2) \end{aligned}$$
(81)

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

$$\begin{aligned} A&= (u(x_1,y_1),v(x_1,y_1))\;, \end{aligned}$$
(82)
$$\begin{aligned} B&= (u(x_2,y_2),v(x_2,y_2)) \end{aligned}$$
(83)

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

$$\begin{aligned} \varvec{\varPhi }&:= \frac{1}{2} \iint _{D_\varrho }\iint _{D_\varrho }F_{M;AB} \,{\mathrm {d}}x_2\,{\mathrm {d}}y_2\,{\mathrm {d}}x_1\,{\mathrm {d}}y_1 \nonumber \\&\doteq \frac{1}{2}\iint _{D_\varrho }\iint _{{\mathcal {A}}_+(x_1,y_1)} \begin{pmatrix} v_2-v_1\\ u_1-u_2\end{pmatrix} \,{\mathrm {d}}x_2\,{\mathrm {d}}y_2\,{\mathrm {d}}x_1\,{\mathrm {d}}y_1 \nonumber \\&\quad -\frac{1}{2}\iint _{D_\varrho }\iint _{{\mathcal {A}}_-(x_1,y_1)} \begin{pmatrix} v_2-v_1\\ u_1-u_2\end{pmatrix} \,{\mathrm {d}}x_2\,{\mathrm {d}}y_2\,{\mathrm {d}}x_1\,{\mathrm {d}}y_1 \nonumber \\&= \frac{1}{2}\iint _{D_\varrho }\iint _{{\mathcal {A}}_+(x_1,y_1)} \begin{pmatrix}v_2\\ -u_2 \end{pmatrix} \,{\mathrm {d}}x_2\,{\mathrm {d}}y_2\,{\mathrm {d}}x_1\,{\mathrm {d}}y_1 \nonumber \\&\quad - \frac{1}{2}\iint _{D_\varrho }\iint _{{\mathcal {A}}_+(x_1,y_1)} \begin{pmatrix} v_1\\ -u_1 \end{pmatrix} \,{\mathrm {d}}x_2\,{\mathrm {d}}y_2\,{\mathrm {d}}x_1\,{\mathrm {d}}y_1 \nonumber \\&\quad - \frac{1}{2}\iint _{D_\varrho }\iint _{{\mathcal {A}}_-(x_1,y_1)} \begin{pmatrix} v_2\\ -u_2\end{pmatrix} \,{\mathrm {d}}x_2\,{\mathrm {d}}y_2\,{\mathrm {d}}x_1\,{\mathrm {d}}y_1 \nonumber \\&\quad + \frac{1}{2}\iint _{D_\varrho }\iint _{{\mathcal {A}}_-(x_1,y_1)} \begin{pmatrix} v_1\\ -u_1\end{pmatrix} \,{\mathrm {d}}x_2\,{\mathrm {d}}y_2\,{\mathrm {d}}x_1\,{\mathrm {d}}y_1 \end{aligned}$$
(84)

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

$$\begin{aligned} \varvec{\varPhi }&\doteq {-}\iint _{D_\varrho }\iint _{{\mathcal {A}}_+(x_1,y_1)} \begin{pmatrix} v_1\\ -u_1 \end{pmatrix} \,{\mathrm {d}}x_2\,{\mathrm {d}}y_2\,{\mathrm {d}}x_1\,{\mathrm {d}}y_1 \nonumber \\&\quad + \iint _{D_\varrho }\iint _{{\mathcal {A}}_-(x_1,y_1)} \begin{pmatrix} v_1\\ -u_1\end{pmatrix} \,{\mathrm {d}}x_2\,{\mathrm {d}}y_2\,{\mathrm {d}}x_1\,{\mathrm {d}}y_1 \nonumber \\&={-}\iint _{D_\varrho } \begin{pmatrix} v_1\\ {-}u_1 \end{pmatrix} \left( |{\mathcal {A}}_{+}(x_1,y_1)|{-}|{\mathcal {A}}_{-}(x_1,y_1)|\right) \,{\mathrm {d}}x_1\,{\mathrm {d}}y_1 \end{aligned}$$
(85)

where \(|{\mathcal {A}}_{\pm }(x_1,y_1)|\) denote the areas of the respective regions.

It remains to determine the area differences

$$\begin{aligned} \varDelta {\mathcal {A}}(x_1,y_1):= |{\mathcal {A}}_+(x_1,y_1)|-|{\mathcal {A}}_-(x_1,y_1)|\end{aligned}$$
(86)

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

$$\begin{aligned}&x_1y_2-x_2y_1 +\alpha _1(x_1^2y_2-x_2^2y_1) +\beta _1(x_1y_1y_2-x_2y_1y_2) \nonumber \\ {}&\quad +\delta _1(y_1^2y_2-y_1y_2^2) +\alpha _2(x_1x_2^2-x_1^2x_2) \nonumber \\ {}&\quad +\beta _2(x_1x_2y_2-x_1x_2y_1) +\delta _2(x_1y_2^2-x_2y_1^2) \nonumber \\ {}&\quad -u^*(y_2-y_1) -v^*(x_1-x_2) =0\;. \end{aligned}$$
(87)

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

$$\begin{aligned} t&=t(s) \doteq s^2(\alpha _1\cos ^2\varphi \sin \varphi +\beta _1\cos \varphi \sin ^2\varphi +\delta _1\sin ^3\varphi \nonumber \\&\quad -\alpha _2\cos ^3\varphi -\beta _2\cos ^2\varphi \sin \varphi -\delta _2\cos \varphi \sin ^2\varphi ) \nonumber \\&\quad +s\Bigl (\frac{u^*}{r}\sin \varphi -\frac{v^*}{r}\cos \varphi \nonumber \\&\quad -r\alpha _1\cos ^2\varphi \sin \varphi -r\beta _1\cos \varphi \sin ^2\varphi -r\delta _1\sin ^3\varphi \nonumber \\&\quad +r\alpha _2\cos ^3\varphi +r\beta _2\cos ^2\varphi \sin \varphi +r\delta _2\cos \varphi \sin ^2\varphi \Bigr ) \nonumber \\&\quad -\frac{u^*}{r}\sin \varphi +\frac{v^*}{r}\cos \varphi \;. \end{aligned}$$
(88)

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.,

$$\begin{aligned}&\varDelta {\mathcal {A}}(x_1,y_1) \doteq -2\int _{-\varrho }^\varrho t(s)\,{\mathrm {d}}s \nonumber \\&\doteq 4\varrho (u^*\sin \varphi -v^*\cos \varphi ) \nonumber \\&\quad -\frac{4}{3}\varrho ^3( \alpha _1\cos ^2\varphi \sin \varphi +\beta _1\cos \varphi \sin ^2\varphi +\delta _1\sin ^3\varphi \nonumber \\&\qquad -\alpha _2\cos ^3\varphi -\beta _2\cos ^2\varphi \sin \varphi -\delta _2\cos \varphi \sin ^2\varphi ) \;. \end{aligned}$$
(89)

Inserting (50), (86) and (89) into (85) yields

$$\begin{aligned} \varvec{\varPhi }&\doteq {-}\iint _{D_\varrho } \begin{pmatrix}{-}y{-}\alpha _2x^2{-}\beta _2xy-\delta ^2y^2\\ x+\alpha _1x^2+\beta _1xy+\delta _1y^2\end{pmatrix} \varDelta {\mathcal {A}}(x,y) \,{\mathrm {d}}x\,{\mathrm {d}}y \nonumber \\&\doteq \frac{1}{2}\int _0^\varrho \int _0^{2\pi }r^2 \begin{pmatrix}\sin \varphi \\ cos\varphi \end{pmatrix} \varDelta {\mathcal {A}}(x,y) \,{\mathrm {d}}\varphi \,{\mathrm {d}}r \nonumber \\&= \int _0^\varrho r^2\,{\mathrm {d}}r \Biggl (2\varrho \biggl (u^* \int _0^{2\pi }\begin{pmatrix}\sin ^2\varphi \\ cos\varphi \sin \varphi \end{pmatrix}\,{\mathrm {d}}\varphi \nonumber \\ {}&\qquad \qquad \qquad \qquad -v^* \int _0^{2\pi }\begin{pmatrix}\cos \varphi \sin \varphi \\ cos^2\varphi \end{pmatrix}\,{\mathrm {d}}\varphi \biggr ) \nonumber \\&\qquad \qquad \qquad -\frac{2}{3}\varrho ^3 \biggl ( \alpha _1\int _0^{2\pi }\begin{pmatrix} \cos ^2\varphi \sin ^2\varphi \\ -\cos ^3\varphi \sin \varphi \end{pmatrix}\,{\mathrm {d}}\varphi \nonumber \\&\qquad \qquad \qquad \qquad +\beta _1\int _0^{2\pi }\begin{pmatrix} \cos \varphi \sin ^3\varphi \\ cos^2\varphi \sin ^2\varphi \end{pmatrix}\,{\mathrm {d}}\varphi \nonumber \\&\qquad \qquad \qquad \qquad +\delta _1\int _0^{2\pi }\begin{pmatrix} \sin ^4\varphi \\ cos\varphi \sin ^3\varphi \end{pmatrix}\,{\mathrm {d}}\varphi \nonumber \\&\qquad \qquad \qquad \qquad -\alpha _2\int _0^{2\pi }\begin{pmatrix} \cos ^3\varphi \sin \varphi \\ cos^4\varphi \end{pmatrix}\,{\mathrm {d}}\varphi \nonumber \\&\qquad \qquad \qquad \qquad -\beta _2\int _0^{2\pi }\begin{pmatrix} \cos ^2\varphi \sin ^2\varphi \\ cos^3\varphi \sin \varphi \end{pmatrix}\,{\mathrm {d}}\varphi \nonumber \\&\qquad \qquad \qquad \qquad -\delta _2\int _0^{2\pi }\begin{pmatrix} \cos \varphi \sin ^3\varphi \\ cos^2\varphi \sin ^2\varphi \end{pmatrix}\,{\mathrm {d}}\varphi \biggr )\Biggr ) \nonumber \\&=\frac{2}{3}\pi \varrho ^4\begin{pmatrix}u^*\\ v^*\end{pmatrix} -\frac{1}{18}\pi \varrho ^6\begin{pmatrix}\alpha _1+3\delta _1-\beta _2\\ 3\alpha _2+\delta _2-\beta _1\end{pmatrix} \;, \end{aligned}$$
(90)

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

$$\begin{aligned} u(x,y,z) = x&+ \alpha _1 x^2 + \beta _1 xy + \gamma _1 xz \nonumber \\&+ \delta _1 y^2 + \varepsilon _1 yz + \zeta _1 z^2 \;, \end{aligned}$$
(91)
$$\begin{aligned} v(x,y,z) = y&+ \alpha _2 x^2 + \beta _2 xy + \gamma _2 xz \nonumber \\&+ \delta _2 y^2 + \varepsilon _2 yz + \zeta _2 z^2 \;, \end{aligned}$$
(92)
$$\begin{aligned} w(x,y,z) = z&+ \alpha _3 x^2 + \beta _3 xy + \gamma _3 xz \nonumber \\&+ \delta _3 y^2 + \varepsilon _3 yz + \zeta _3 z^2 \end{aligned}$$
(93)

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 (ABC) 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}\),

$$\begin{aligned} \begin{pmatrix}u^*\\ v^*\\ w^*\end{pmatrix}&= - \bigl ({\mathrm {D}}\varvec{\varPhi }(0,0,0)\bigr )^{-1}\varvec{\varPhi }(0,0,0) \end{aligned}$$
(94)

(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

$$\begin{aligned}&F(0,0,0,{\mathbf {e}}_1) {=} \int _0^{+\infty } \int _{-\infty }^{+\infty } \int _{-\infty }^{+\infty } \int _{-\infty }^{+\infty } \int _{-\infty }^{+\infty } \int _{-\infty }^{+\infty } \int _{-\infty }^{+\infty } \nonumber \\&\quad f(u,v_1,w_1)f(u,v_2,w_2)f(u,v_3,w_3) \nonumber \\&\quad \bigl ((v_2-v_1)(w_3-w_1)-(v_3-v_1)(w_2-w_1)\bigr )^2 \nonumber \\&\quad \,{\mathrm {d}}w_3 \,{\mathrm {d}}v_3 \,{\mathrm {d}}w_2 \,{\mathrm {d}}v_2 \,{\mathrm {d}}w_1 \,{\mathrm {d}}v_1 \,{\mathrm {d}}u \;. \end{aligned}$$
(95)

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.

Table 7 Integration bounds, densities and resulting coefficients \(G^0_{\omega }\) of the expansion (99) for \(\omega \in \{\alpha _i,\beta _i,\gamma _i,\delta _i,\varepsilon _i,\zeta _i ~|~i=1,2,3\}\)

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

$$\begin{aligned}&\bigl ((v_2-v_1)(w_3-w_1)-(v_3-v_1)(w_2-w_1)\bigr )^2 \nonumber \\&\quad =\sum _{\begin{array}{c} i,j\in \{1,2,3\}\\ i\ne j \end{array}}v_i^2w_j^2 -2\sum _{\begin{array}{c} i,j\in \{1,2,3\}\\ i<j \end{array}}v_iw_iv_jw_j \nonumber \\&\quad \quad -2\sum _{\begin{array}{c} i,j,k\in \{1,2,3\}\\ i<j;k\ne i,j \end{array}}v_iv_jw_k^2 -2\sum _{\begin{array}{c} i,j,k\in \{1,2,3\}\\ j<k;i\ne j,k \end{array}}v_i^2w_jw_k \nonumber \\&\quad \quad +2\sum _{\begin{array}{c} i,j,k\in \{1,2,3\}\\ i\ne j\ne k\ne i \end{array}}v_iw_jv_kw_k \end{aligned}$$
(96)

then leads to

$$\begin{aligned}&F(0,0,0,{\mathbf {e}}_1) = \int _0^{\bar{u}} \bigl (6J_{20}(u)J_{02}(u)J_{00}(u) \nonumber \\ {}&\quad -6J_{11}(u)^2J_{00}(u) -6J_{02}(u)J_{10}(u)^2 \nonumber \\ {}&\quad -6J_{20}(u)J_{01}(u)^2 +12J_{10}(u)J_{01}(u)J_{00}(u) \bigr ) \,{\mathrm {d}}u \end{aligned}$$
(97)

with

$$\begin{aligned} J_{kl}(u)&:= \int _{\underline{v}(u)}^{\bar{v}(u)} \int _{\underline{w}(u,v)}^{\bar{w}(u,v)} f(u,v,w)v^kw^l \,{\mathrm {d}}w \,{\mathrm {d}}v \end{aligned}$$
(98)

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)

$$\begin{aligned} F(0,0,0,{\mathbf {e}}_1) = G^0&+ \sum \limits _{\omega } G^0_\omega \omega \;. \end{aligned}$$
(99)

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.

Table 8 Integrals \(J_{kl}(u)\) from the computation of the coefficients \(G^0_{\omega }\) from Table 7

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(uvw) 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

$$\begin{aligned} F_{u^*}(0,0,0,{\mathbf {e}}_1)&= H^0 (1+{\mathcal {O}}(\varrho ^2))\;,\end{aligned}$$
(100)
$$\begin{aligned} F_{v^*}(0,0,0,{\mathbf {e}}_1)&= 0\;,\end{aligned}$$
(101)
$$\begin{aligned} F_{w^*}(0,0,0,{\mathbf {e}}_1)&= 0\;. \end{aligned}$$
(102)

Here, \(H^0\) is calculated from the unperturbed case \(u=x\), \(v=y\), \(w=z\) via

$$\begin{aligned} J_{20}(0)&=J_{02}(0)=\tfrac{1}{4}\pi \varrho ^4\;,\end{aligned}$$
(103)
$$\begin{aligned} J_{00}(0)&=\pi \varrho ^2\;\end{aligned}$$
(104)
$$\begin{aligned} J_{11}(0)&=J_{10}(0)=J_{01}(0)=0 \;. \end{aligned}$$
(105)

Thus only the first summand of the integrand of (97) is non-zero, leading to

$$\begin{aligned} H^0&= -6J_{20}(0)J_{02}(0)J_{00}(0) =-\tfrac{3}{8}\pi ^3\varrho ^{10}\;. \end{aligned}$$
(106)

From the so obtained expressions

$$\begin{aligned} F(0,0,0,{\mathbf {e}}_1)&\doteq G^0 + \tfrac{1}{32}\pi ^3\varrho ^{12}( -4\alpha _1+5\delta _1+5\zeta _1 \nonumber \\&\qquad \qquad \qquad \qquad +2\beta _2+2\gamma _3)\;, \end{aligned}$$
(107)
$$\begin{aligned} F_{u^*}(0,0,0,{\mathbf {e}}_1)&\doteq -\tfrac{3}{8}\pi ^3\varrho ^{10} \end{aligned}$$
(108)

general expressions for \(F(0,0,0,\varvec{p})\) and its derivatives w.r.t. \(u^*\), \(v^*\), \(w^*\) can be obtained. Given the parametrization

$$\begin{aligned} \varvec{p}&=\varvec{p}(\varphi ,\psi ) =(\cos \varphi ,\sin \varphi \cos \psi ,\sin \varphi \sin \psi )^{\mathrm {T}}\end{aligned}$$
(109)

one can use, e.g., the rotation matrix:

$$\begin{aligned} R&= \begin{pmatrix} \cos \varphi &{}\sin \varphi \cos \psi &{}\sin \varphi \sin \psi \\ -\sin \varphi &{}\cos \varphi \cos \psi &{}\cos \varphi \sin \psi \\ 0&{}\sin \psi &{}-\cos \psi \end{pmatrix} \end{aligned}$$
(110)

to transform the (uvw) and (xyz) 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

$$\begin{aligned}&\varvec{\varPhi }(0,0,0) =\int _{{\mathrm {S}}^2}F(0,0,0,\varvec{p})\varvec{p} \,{\mathrm {d}}\sigma (\varvec{p}) \nonumber \\&\quad =\int _0^\pi \int _0^{2\pi }F(0,0,0,\varvec{p}(\varphi ,\psi )) \begin{pmatrix} \cos \varphi \\ \sin \varphi \cos \psi \\ \sin \varphi \sin \psi \end{pmatrix} \sin \varphi \,{\mathrm {d}}\psi \,{\mathrm {d}}\varphi \nonumber \\&\quad = \frac{\pi ^6}{40}\varrho ^{12} \begin{pmatrix} 2\alpha _1+4(\delta _1+\zeta _1)-(\beta _2+\gamma _3)\\ 2\delta _2+4(\alpha _2+\zeta _2)-(\beta _1+\varepsilon _3)\\ 2\zeta _3+4(\alpha _3+\delta _3)-(\gamma _1+\varepsilon _2) \end{pmatrix} \end{aligned}$$
(111)

and similarly

$$\begin{aligned} {\mathrm {D}}\varvec{\varPhi }(0,0,0)&= -\frac{\pi ^4}{2}\varrho ^{10} \begin{pmatrix}1&{}0&{}0\\ 0&{}1&{}0\\ 0&{}0&{}1\end{pmatrix} \end{aligned}$$
(112)

and by (94)

$$\begin{aligned} \begin{pmatrix}u^*\\ v^*\\ w^*\end{pmatrix}&=\frac{\varrho ^2}{20} \begin{pmatrix} 2\alpha _1+4(\delta _1+\zeta _1)-(\beta _2+\gamma _3)\\ 2\delta _2+4(\alpha _2+\zeta _2)-(\beta _1+\varepsilon _3)\\ 2\zeta _3+4(\alpha _3+\delta _3)-(\gamma _1+\varepsilon _2) \end{pmatrix}\;, \end{aligned}$$
(113)

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

$$\begin{aligned} 0&= \int \!\!\int \!\!\int _{B_\varrho } \frac{\varvec{u}(x,y,z)-\varvec{u}^*}{|\varvec{u}(x,y,z)-\varvec{u}^*|} \,{\mathrm {d}}z\,{\mathrm {d}}y\,{\mathrm {d}}x \;. \end{aligned}$$
(114)

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

$$\begin{aligned}&0 = \int \!\!\int \!\!\int _{B_\varrho } \frac{x+\alpha _1x^2-u^*}{\sqrt{N(x,y,z)}} \,{\mathrm {d}}z\,{\mathrm {d}}y\,{\mathrm {d}}x \;, \end{aligned}$$
(115)
$$\begin{aligned}&0 = \int \!\!\int \!\!\int _{B_\varrho } \frac{y-v^*}{\sqrt{N(x,y,z)}} \,{\mathrm {d}}z\,{\mathrm {d}}y\,{\mathrm {d}}x \;, \end{aligned}$$
(116)
$$\begin{aligned}&0 = \int \!\!\int \!\!\int _{B_\varrho } \frac{z-w^*}{\sqrt{N(x,y,z)}} \,{\mathrm {d}}z\,{\mathrm {d}}y\,{\mathrm {d}}x \;, \end{aligned}$$
(117)

where

$$\begin{aligned} N(x,y,z)=(x+\alpha _1x^2-u^*)^2+(y-v^*)^2+(z-w^*)^2 \;. \end{aligned}$$
(118)

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

$$\begin{aligned} 0&= \int \!\!\int \!\!\int _{B_1} \frac{\xi +(\alpha _1\xi ^2-\lambda )\varrho }{\sqrt{(\xi +(\alpha _1\xi ^2-\lambda )\varrho )^2+\eta ^2+\zeta ^2}} \,{\mathrm {d}}\zeta \,{\mathrm {d}}\eta \,{\mathrm {d}}\xi \;. \end{aligned}$$
(119)

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

$$\begin{aligned}&((\xi +(\alpha _1\xi ^2-\lambda )\varrho )^2+\eta ^2+\zeta ^2)^{-1/2} \nonumber \\&\quad = (\xi ^2+\eta ^2+\zeta ^2)^{-1/2}\left( 1 - \frac{(\alpha _1\xi ^2-\lambda )\varrho }{\xi ^2+\eta ^2+\zeta ^2}+ (\varrho ^{6/5})\right) \end{aligned}$$
(120)

which leads to

$$\begin{aligned} 0&= \underbrace{ \int \!\!\int \!\!\int _{B_1\setminus B_{\varrho ^{2/5}}} \frac{\xi }{\sqrt{\xi ^2+\eta ^2+\zeta ^2}} \,{\mathrm {d}}\zeta \,{\mathrm {d}}\eta \,{\mathrm {d}}\xi }_{{}=0} \nonumber \\&\quad + \varrho \int \!\!\int \!\!\int _{B_1\setminus B_{\varrho ^{2/5}}} \frac{\alpha _1\xi ^2-\lambda }{\sqrt{\xi ^2+\eta ^2+\zeta ^2}} \,{\mathrm {d}}\zeta \,{\mathrm {d}}\eta \,{\mathrm {d}}\xi \nonumber \\&\quad - \varrho \int \!\!\int \!\!\int _{B_1\setminus B_{\varrho ^{2/5}}} \frac{\alpha _1\xi ^2-\lambda }{(\xi ^2+\eta ^2+\zeta ^2)^{3/2}} \,{\mathrm {d}}\zeta \,{\mathrm {d}}\eta \,{\mathrm {d}}\xi +{\mathcal {O}}(\varrho ^{6/5}) \nonumber \\&= \varrho \int \!\!\int \!\!\int _{B_1\setminus B_{\varrho ^{2/5}}} \frac{(\alpha _1\xi ^2-\lambda )(\xi ^2+\eta ^2+\zeta ^2-\xi ^2)}{(\xi ^2+\eta ^2+\zeta ^2)^{3/2}} \,{\mathrm {d}}\zeta \,{\mathrm {d}}\eta \,{\mathrm {d}}\xi \nonumber \\&\quad +{\mathcal {O}}(\varrho ^{6/5}) \end{aligned}$$
(121)

and finally, by neglecting \({\mathcal {O}}(\varrho ^{1/5})\) terms, to

$$\begin{aligned} \frac{\lambda }{\alpha _1}&= \frac{\int \!\!\int \!\!\int _{B_1\setminus B_{\varrho ^{2/5}}} \xi ^2(\eta ^2+\zeta ^2)/(\xi ^2+\eta ^2+\zeta ^2)^{3/2} \,{\mathrm {d}}\zeta \,{\mathrm {d}}\eta \,{\mathrm {d}}\xi }{\int \!\!\int \!\!\int _{B_1\setminus B_{\varrho ^{2/5}}} (\eta ^2+\zeta ^2)/(\xi ^2+\eta ^2+\zeta ^2)^{3/2} \,{\mathrm {d}}\zeta \,{\mathrm {d}}\eta \,{\mathrm {d}}\xi } \nonumber \\&= \frac{(1-\varrho ^{8/5})\cdot 2\pi /15}{(1-\varrho ^{4/5})\cdot 4\pi /3} \underset{\varrho \rightarrow 0}{\longrightarrow }\frac{1}{10}\;, \end{aligned}$$
(122)

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

$$\begin{aligned}&0 = \int \!\!\int \!\!\int _{B_\varrho } \frac{x+\delta _1y^2-u^*}{\sqrt{N(x,y,z)}} \,{\mathrm {d}}z\,{\mathrm {d}}y\,{\mathrm {d}}x \;, \end{aligned}$$
(123)
$$\begin{aligned}&N(x,y,z) = (x+\delta _1y^2-u^*)^2+(y-v^*)^2+(z-w^*)^2\;, \end{aligned}$$
(124)

we proceed by the same substitutions, splitting of the integral domain, and Taylor expansion of the denominator to finally obtain

$$\begin{aligned} \frac{\lambda }{\delta _1}&= \frac{\int \!\!\int \!\!\int _{B_1\setminus B_{\varrho ^{2/5}}} \eta ^2(\eta ^2+\zeta ^2)/(\xi ^2+\eta ^2+\zeta ^2)^{3/2} \,{\mathrm {d}}\zeta \,{\mathrm {d}}\eta \,{\mathrm {d}}\xi }{\int \!\!\int \!\!\int _{B_1\setminus B_{\varrho ^{2/5}}} (\eta ^2+\zeta ^2)/(\xi ^2+\eta ^2+\zeta ^2)^{3/2} \,{\mathrm {d}}\zeta \,{\mathrm {d}}\eta \,{\mathrm {d}}\xi } \nonumber \\&= \frac{(1-\varrho ^{8/5})\cdot 4\pi /15}{(1-\varrho ^{4/5})\cdot 4\pi /3} \underset{\varrho \rightarrow 0}{\longrightarrow }\frac{1}{5}\;, \end{aligned}$$
(125)

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

$$\begin{aligned} \frac{\mu }{\beta _1}&= -\frac{\int \!\!\int \!\!\int _{B_1\setminus B_{\varrho ^{2/5}}} \xi ^2\eta ^2/(\xi ^2+\eta ^2+\zeta ^2)^{3/2} \,{\mathrm {d}}\zeta \,{\mathrm {d}}\eta \,{\mathrm {d}}\xi }{\int \!\!\int \!\!\int _{B_1\setminus B_{\varrho ^{2/5}}} (\xi ^2+\zeta ^2)/(\xi ^2+\eta ^2+\zeta ^2)^{3/2} \,{\mathrm {d}}\zeta \,{\mathrm {d}}\eta \,{\mathrm {d}}\xi } \nonumber \\&= -\frac{(1-\varrho ^{8/5})\cdot \pi /15}{(1-\varrho ^{4/5})\cdot 4\pi /3} \underset{\varrho \rightarrow 0}{\longrightarrow }-\frac{1}{20}\;, \end{aligned}$$
(126)

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

$$\begin{aligned} u(x,y)&= x + \alpha _1 x^2 + \beta _1 xy + \delta _1 y^2, \end{aligned}$$
(127)
$$\begin{aligned} v(x,y)&= y + \alpha _2 x^2 + \beta _2 xy + \delta _2 y^2, \end{aligned}$$
(128)
$$\begin{aligned} w(x,y)&= \alpha _3 x^2 + \beta _3 xy + \delta _3 y^2 , \end{aligned}$$
(129)

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 (AB) 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 (AB) 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

$$\begin{aligned} 0&= \iint _{D_\varrho }\iint _{D_\varrho } \frac{MH}{|MH|} |AB|\,{\mathrm {d}}y_2\,{\mathrm {d}}x_2\,{\mathrm {d}}y_1\,{\mathrm {d}}x_1 \end{aligned}$$
(130)

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

$$\begin{aligned} 0&= \int _0^\varrho \int _{-\sqrt{\varrho ^2-x^2}}^{\sqrt{\varrho ^2-x^2}} \int _{-\sqrt{\varrho ^2-x^2}}^{\sqrt{\varrho ^2-x^2}} \nonumber \\&\qquad \quad \frac{ (y_2-y_1)^2 \bigl (\alpha (x^2-y_1y_2)-w^*\bigr )}{\sqrt{x^2+\bigl (\alpha (x^2-y_1y_2)-w^*\bigr )^2}} \,{\mathrm {d}}y_2\,{\mathrm {d}}y_1\,{\mathrm {d}}x \;, \end{aligned}$$
(131)

and after substituting \(x=\xi \varrho \), \(y_1=\eta _1\varrho \), \(y_2=\eta _2\varrho \), \(w^*=\nu \varrho ^2\) one has

$$\begin{aligned} 0&= \int _0^1 \int _{-\sqrt{1-\xi ^2}}^{\sqrt{1-\xi ^2}} \int _{-\sqrt{1-\xi ^2}}^{\sqrt{1-\xi ^2}} \nonumber \\&\qquad \quad \frac{ (\eta _2-\eta _1)^2 \bigl (\alpha (\xi ^2-\eta _1\eta _2)-\nu \bigr )}{\sqrt{\xi ^2+\varrho ^2\bigl (\alpha (\xi ^2-\eta _1\eta _2)-\nu \bigr )^2}} \,{\mathrm {d}}\eta _2\,{\mathrm {d}}\eta _1\,{\mathrm {d}}\xi \;. \end{aligned}$$
(132)

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

$$\begin{aligned} 0&= \int _{\varrho ^{2/3}}^1 \int _{-\sqrt{1-\xi ^2}}^{\sqrt{1-\xi ^2}} \int _{-\sqrt{1-\xi ^2}}^{\sqrt{1-\xi ^2}} \nonumber \\&\qquad \quad \frac{ (\eta _2-\eta _1)^2 \bigl (\alpha (\xi ^2-\eta _1\eta _2)-\nu \bigr )}{\xi } \,{\mathrm {d}}\eta _2\,{\mathrm {d}}\eta _1\,{\mathrm {d}}\xi \nonumber \\ {}&\quad +{\mathcal {O}}(\varrho ^{2/3}) \end{aligned}$$
(133)

from which we obtain

$$\begin{aligned} \frac{\nu }{\alpha }&= \frac{\begin{array}{@{}r@{}} \int _{\varrho ^{2/3}}^1 \int _{-\sqrt{1-\xi ^2}}^{\sqrt{1-\xi ^2}} \int _{-\sqrt{1-\xi ^2}}^{\sqrt{1-\xi ^2}} (\eta _2-\eta _1)^2(\xi ^2-\eta _1\eta _2)\xi ^{-1} \quad \\ \,{\mathrm {d}}\eta _2\,{\mathrm {d}}\eta _1\,{\mathrm {d}}\xi \end{array}}{\int _{\varrho ^{2/3}}^1 \int _{-\sqrt{1-\xi ^2}}^{\sqrt{1-\xi ^2}} \int _{-\sqrt{1-\xi ^2}}^{\sqrt{1-\xi ^2}} (\eta _2-\eta _1)^2\xi ^{-1} \,{\mathrm {d}}\eta _2\,{\mathrm {d}}\eta _1\,{\mathrm {d}}\xi } \end{aligned}$$
(134)

and after integral evaluation

$$\begin{aligned} \frac{\nu }{\alpha }&= \frac{-\ln \varrho \cdot 16/27-10/27}{-\ln \varrho \cdot 16/9-16/9} \underset{\varrho \rightarrow 0}{\longrightarrow }\frac{1}{3} \;. \end{aligned}$$
(135)

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 (ij) in time step k. The numerical scheme for the PDE (38) proceeds for each pixel (ij) as follows.

  1. 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. 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. 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 (xy) plane.

  4. 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. 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. 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. 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. 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. 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. 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. 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. 12.

    Compute \(\varvec{u}_{i,j}^{k+1} = \varvec{u}_{i,j}^k + \tau [\varvec{u}_t]\).

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10851-016-0645-9

Keywords

Navigation