Skip to main content

Colormaps and their labels

Description

binary_colormap is black background, white foreground: the ordinary two-class problem. voc_colormap is the twenty-one class palette used by Pascal VOC, kept because datasets and other people’s masks still arrive in it.

Usage

binary_colormap

binary_labels

voc_colormap

voc_labels

Format

A list of RGB triples, or a character vector of names.

Details

The labels are the matching class names, for figure legends and mask_coverage(). Position in the list is the class index throughout, counting from 1.

Value

Four exported objects rather than functions. binary_colormap and voc_colormap are lists of integer vectors of length three - one RGB triple per class, 2 entries and 21 entries respectively - where position in the list is the class index, counting from 1. binary_labels and voc_labels are character vectors of the matching class names, the same length as their colormap and in the same order, so the nth label names the class the nth triple draws.

Examples

library("rplatypus")

mask_coverage(matrix(c(1, 2, 2, 1), 2), labels = binary_labels)
  class      label pixels fraction
1     1 background      2      0.5
2     2     object      2      0.5