binssim: Categorical Structural Similarity Index Metric (whole image)
Description
This computes the categorical or binary structural similarity index metric
on a whole-image scale. The difference between this and the default 2-D
method is that this considers the whole image at once and one scale rather
than computing the index over a sliding window and downsampling to consider
it at other scales.
small normalization constant for the c function,
by default 0.01
c2
small normalization constant for the s function,
by default 0.01
method
whether to use Cohen's kappa (Cohen),
Jaccard Index (Jaccard), Dice index (Dice),
accuracy (accuracy), Rand index (Rand),
Adjusted Rand Index (AdjRand or ARI), or normalized mutual
information (NMI or MI) as the similarity index.
Note Jaccard and Dice should only be used on binary data.
...
Constants can be passed to the components of the index.
set.seed(20181207)
x <- matrix(sample(1:4, 10000, replace = TRUE), nrow = 100)
y <- x
for (i in1:100) y[i, i] <- 1for (i in1:99) y[i, i + 1] <- 1binssim(x, y)