library("rplatypus")
image <- array(0.5, dim = c(5, 9, 3))
labels <- matrix(0L, nrow = 5, ncol = 9)
labels[2:4, 2:4] <- 1L
labels[2:4, 5:7] <- 2L # touching object 1 along a seam
shown <- overlay_instances(image, labels)
# Two touching objects, two colours.
!identical(shown[3, 2, ], shown[3, 6, ])[1] TRUE