kmatdist {kanjistat} | R Documentation |
Compute the unbalanced or balanced Wasserstein distance between two kanjimat objects
Description
This gives the dissimilarity of pixel-images of the kanji based on how far mass (or "ink") has to be transported to transform one image into the other.
Usage
kmatdist(
k1,
k2,
p = 1,
C = 0.2,
type = c("unbalanced", "balanced"),
output = c("dist", "all")
)
Arguments
k1 , k2 |
two objects of type |
p |
the order of the Wasserstein distance. All distances and a potential penalty are taken
to the |
C |
the penalty for extra mass if |
type |
the type of Wasserstein metric. |
output |
the requested output. See return value below. |
Value
If output = "dist"
, a single non-negative number: the unbalanced or balanced Wasserstein
distance between the kanji. If output = "all"
a list with detailed information on the transport plan
and the disposal of pixel mass. See unbalanced
for details.
See Also
Examples
res <- kmatdist(fivetrees1[[1]], fivetrees1[[5]], p=1, C=0.1, output="all")
plot(res, what="plan", angle=20, lwd=1.5)
plot(res, what="trans")
plot(res, what="extra")
plot(res, what="inplace")