library("rplatypus")
image <- array(0.5, dim = c(5, 11, 3))
truth <- matrix(0L, nrow = 5, ncol = 11)
truth[2:4, 2:4] <- 1L
truth[2:4, 6:8] <- 2L
predicted <- matrix(0L, nrow = 5, ncol = 11)
predicted[2:4, 2:4] <- 1L # one found
predicted[2:4, 9:11] <- 2L # one invented, and object 2 missed
shown <- overlay_instance_agreement(image, predicted, truth)
# Three different colours: hit, missed, invented.
nrow(unique(rbind(shown[3, 2, ], shown[3, 6, ], shown[3, 10, ])))[1] 3