Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

colorLabels

Color Code Labels


Description

Color codes the labels of object masks by a random permutation.

Usage

colorLabels(x, normalize = TRUE)

Arguments

x

an Image object in Grayscale color mode or an array containing object masks. Object masks are sets of pixels with the same unique integer value

normalize

if TRUE normalizes the resulting color image

Details

Performs color coding of object masks, which are typically obtained using the bwlabel function. Each label from x is assigned an unique color. The colors are distributed among the labels using a random permutation. If normalize is set to TRUE the intensity values of the resulting image are mapped to the [0,1] range.

Value

An Image object containing color coded objects of x.

Author(s)

Bernd Fischer, Andrzej Oles, 2013-2014

See Also

Examples

x = readImage(system.file('images', 'shapes.png', package='EBImage'))
  x = x[110:512,1:130]
  y = bwlabel(x)
  z = colorLabels(y)
  display(z, title='Colored segmentation')

EBImage

Image processing and analysis toolbox for R

v4.32.0
LGPL
Authors
Andrzej Oleś, Gregoire Pau, Mike Smith, Oleg Sklyar, Wolfgang Huber, with contributions from Joseph Barry and Philip A. Marais
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.