Given multiple images $$X_1,\ldots,X_N$$, the Wasserstein median of order 2 is computed. The proposed method relies on a choice of barycenter computation in that we opt for an algorithm of imagebary15B, which uses entropic regularization for barycenter computation. Please note the followings; (1) we only take a matrix as an image so please make it grayscale if not, (2) all images should be of same size - no resizing is performed.

## Usage

imagemed22Y(images, weights = NULL, lambda = NULL, ...)

## Arguments

images

a length-$$N$$ list of same-size image matrices of size $$(m\times n)$$.

weights

a weight of each image; if NULL (default), uniform weight is set. Otherwise, it should be a length-$$N$$ vector of nonnegative weights.

lambda

a regularization parameter; if NULL (default), a paper's suggestion would be taken, or it should be a nonnegative real number.

...

extra parameters including

abstol

stopping criterion for iterations (default: 1e-8).

init.image

an initial weight image (default: uniform weight).

maxiter

maximum number of iterations (default: 496).

number of threads for OpenMP run (default: 1).

print.progress

a logical to show current iteration (default: TRUE).

## Value

an $$(m\times n)$$ matrix of the Wasserstein median image.

## Examples

if (FALSE) {
#----------------------------------------------------------------------
#                       MNIST Data with Digit 3
#
# EXAMPLE : Very Small Example for CRAN; just showing how to use it!
#----------------------------------------------------------------------
data(digit3)
datsmall = digit3[1:10]

# COMPUTE
outsmall = imagemed22Y(datsmall, maxiter=5)

# VISUALIZE