densities over $\mathbb{R}$.

Whereas practical computations always act on finite, thus discrete, data, the continuous case is important for a proper theoretical foundation of the intended application of medians in image and shape analysis since we always understand discrete images and shapes as samples of space-continuous objects.

We put special emphasis on characterisations of the median by minimisation properties as these play a central role for the later generalisation to the multivariate case.

Median for Unweighted Discrete Data {#ssec-med}
-----------------------------------

**Rank-order definition.**

The most basic concept of the median relies on rank order, taking the middle element of an ordered sequence.

Let a finite multiset $\mathcal{X}=\{x_1,\ldots,x_N\}$ of real numbers $x_1,\ldots,x_N\in\mathbb{R}$ be given. Assume that the elements of $\mathcal{X}$ are arranged in ascending order, $x_1\le \ldots\le x_N$. If $N$ is odd, the *median* of $\mathcal{X}$ is given by $x_{(N+1)/2}$. If $N$ is even, the median is given by the interval $[x_{N/2},x_{N/2+1}]$.

In the case of even $N$, there is an ambiguity; one could define either of the two values in the middle or e.g. their arithmetic mean as the median of $\mathcal{X}$. As this ambiguity does not play a central role in the context of this work, we will prefer the 