Home > freetb4matlab > image > label2rgb.m

label2rgb

PURPOSE ^

% Converts a labeled image to an RGB image.

SYNOPSIS ^

function rgb = label2rgb(L, map = 'jet', background = 'w', order = 'noshuffle')

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} @var{RGB} = label2rgb(@var{L})
% @deftypefnx{Function File} @var{RGB} = label2rgb(@var{L}, @var{map})
% @deftypefnx{Function File} @var{RGB} = label2rgb(@var{L}, @var{map}, @var{background})
% @deftypefnx{Function File} @var{RGB} = label2rgb(@var{L}, @var{map}, @var{background}, @var{order})
% Converts a labeled image to an RGB image.
%
% label2rgb(@var{L}) returns a color image, where the background color
% (the background is the zero-labeled pixels) is white, and all other
% colors come from the @code{jet} colormap.
%
% label2rgb(@var{L}, @var{map}) uses colors from the given colormap.
% @var{map} can be
% @itemize
% @item A string containing the name of a function to be called to
% produce a colormap. The default value is 'jet'.
% @item A handle to a function to be called to produce a colormap.
% @item A @var{N}-by-3 colormap matrix.
% @end itemize
%
% label2rgb(@var{L}, @var{map}, @var{background}) sets the background
% color. @var{background} can be a 3-vector corresponding to the wanted
% RGB color, or one of the following strings
% @table @samp
% @item 'b'
% The background color will be blue.
% @item 'c'
% The background color will be cyan.
% @item 'g'
% The background color will be green.
% @item 'k'
% The background color will be black.
% @item 'm'
% The background color will be magenta.
% @item 'r'
% The background color will be red.
% @item 'w'
% The background color will be white. This is the default behavior.
% @item 'y'
% The background color will be yellow.
% @end table
%
% label2rgb(@var{L}, @var{map}, @var{background}, @var{order}) allows for random
% permutations of the colormap. @var{order} must be one of the following strings
% @table @samp
% @item 'noshuffle'
% The colormap is not permuted in any ways. This is the default.
% @item 'shuffle'
% The used colormap is permuted randomly.
% @end table
% @seealso{bwlabel, ind2rgb}
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003