Home > ISET > color > RGB2XWFormat.m

RGB2XWFormat

PURPOSE ^

Transform an RGB form matrix into an XW (space-wavelength) matrix

SYNOPSIS ^

function [XW,r,c,w] = RGB2XWFormat(imRGB)

DESCRIPTION ^

 Transform an RGB form matrix into an XW (space-wavelength) matrix
    
   [XW,r,c,w] = RGB2XWFormat(imRGB);

 This  routine converts from RGB format to XW format.  The row and
 column of the imRGB are also returned, if requested.

 We say matrices in (r,c,w) format are in RGB format.  The dimension, w,
 represents the number of data color bands.  When w=3, the data are an RGB
 image. But w can be almost anything (e.g., 31 wavelength samples from
 400:10:700).  We use this format frequently for spectral data.

 The RGB format is useful for imaging.  When w = 3, you can use
 conventional image() routines.  When w > 3, use imageSPD.

 The XW (space-wavelength) format is useful for computation.  In this
 format, for example, XW*spectralFunction yields a spectral response.

 The inverse routine is XW2RGBFormat

 See also, imageSPD, imagescRGB, imagescM, XW2RGBFormat

 Copyright ImagEval Consultants, LLC, 2003.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Thu 20-Nov-2008 22:09:04 by m2html © 2003