IMG_SPLIT
Name
IMG_SPLIT
Purpose
Returns the color components of a color image.
Category
Calling Sequence
img_split, img, c1, c2, c3
Inputs
img = Input image. in
Keyword Parameters
Keywords
/HSV means return HSV color components (def RGB).
TRUE=tr Returned interleave dimension (0 means 2-D image).
May send this in for cases that are ambiguous.
NX=nx, NY=ny Returned image dimensions.
ALPHA=a Returned alpha channel if any (else -1).
0 is full transparency, 255 is no transparency.
ERROR=err error flag: 0=ok, 1=not 2-D or 3-D,
2=wrong number of color channels for 3-D array.
3=Ambiguous, cannot determine interleave dimension.
Outputs
c1 = component 1. out
c2 = component 2. out
c3 = component 3. out
By default c1,c2,c3 = Red, Green, Blue.
/HSV requests Hue, Saturation, Value.
Common Blocks
Notes
Note: Deals with 2-D or 3-D image arrays.
A 1-D array is treated like a NX x 1 array.
Modification History
R. Sterner, 2001 Mar 27
R. Sterner, 2001 Jun 18 --- Renamed from img_rgb.pro
R. Sterner, 2001 Jun 21 --- Renamed from img_splitrgb.pro
R. Sterner, 2001 Jun 21 --- Added new keyword /HSV.
R. Sterner, 2010 May 04 --- Converted arrays from () to [].
R. Sterner, 2010 Sep 08 --- Now allows 1-D arrays.
R. Sterner, 2011 May 12 --- Handled Alpha channel.
R. Sterner, 2011 Jul 18 --- Rewrote the interleave finder.
R. Sterner, 2011 Jul 18 --- Allowed TRUE=tr to be given.
R. Sterner, 2012 Jan 24 --- Make sure nch is defined.
Copyright (C) 2001, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.