View source: R/image_median22Y.R
imagemed22Y | R Documentation |
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.
imagemed22Y(images, weights = NULL, lambda = NULL, ...)
images |
a length- |
weights |
a weight of each image; if |
lambda |
a regularization parameter; if |
... |
extra parameters including
|
an (m\times n)
matrix of the Wasserstein median image.
## Not run:
#----------------------------------------------------------------------
# MNIST Data with Digit 3
#
# EXAMPLE : Very Small Example for CRAN; just showing how to use it!
#----------------------------------------------------------------------
# LOAD THE DATA
data(digit3)
datsmall = digit3[1:10]
# COMPUTE
outsmall = imagemed22Y(datsmall, maxiter=5)
# VISUALIZE
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,4), pty="s")
image(outsmall, xaxt='n', yaxt='n', main="Wasserstein Median")
image(datsmall[[3]], xaxt='n', yaxt='n', main="3rd image")
image(datsmall[[6]], xaxt='n', yaxt='n', main="6th image")
image(datsmall[[9]], xaxt='n', yaxt='n', main="9th image")
par(opar)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.