The RGB program is the inverse of the IHS program.
The Red-Green-Blue transformation is used by the FUSE and FUSEPCT procedures to perform data fusion.
Progress of this program can be monitored. See MONITOR section.
Name Prompt Count Type FILE Database File Name 1-64 Char DBIC Database Input Channel List 3 Int DBOC Database Output Channel List 3 Int DBOW Database Input Window 0-4 Int IHSMODEL IHS Model: CYLINDER/HEXCONE 1-8 Char
EASI>FILE="filename"
EASI>DBIC=intensity,hue,saturation
EASI>DBOC=red,green,blue
EASI>DBIW=Xoffset,Yoffset,Xsize,Ysize EASI>DBIW= | transform entire image
Valid Values: CYLINDER, HEXCONE Default: CYLINDERSpecifies which type of IHS colour model to use.
EASI>IHSMODEL="HEXCONE" | Hexcone model EASI>IHSMODEL= | defaults to CYLINDER EASI>IHSMODEL="CYLINDER" | Cylinder model (original method)See the BACKGROUND and ALGORITHM sections for more information about these IHS models.
RGB is used by the FUSE and FUSEPCT procedures to perform data fusion of colour imagery with a black-and-white image.
The three input channels represent the intensity, hue, and saturation channels. The three output channels are used for the output of red, green, and blue channels.
A specified rectangular window of image data (DBIW) can be transformed.
IHSMODEL specifies the IHS model (HEXCONE or CYLINDER) that was originally used to transform RGB values to IHS values. CYLINDER was the original method used by the IHS and RGB programs in older PCI software releases (Version 6.0.1 and before). The Hexcone model is used by many commercial Image Processing software packages. One model can produce more visually pleasing results than the other, depending on the circumstances. The Hexcone model runs about 15% faster than the Cylinder model.
Input channels may be used as output channels, in which case the original input image is overwritten by the output image. Duplicate channel numbers can be specified for input channels, but NOT for output channels.
Only the following configurations of input and output channel types are allowed:
Input channels (DBIC) Output channels (DBOC) Scaled results: 8-bit channels --> 3 any-type channels Exact results: 16/32-bit channels --> 3 any-type channelsWhen all three input channels are 8-bit, the IHS data are linearly scaled between 0 and 255. When the three input channels are any combination of 16-bit signed, 16-bit unsigned, or 32-bit real, the IHS data are not scaled. The output channels may be any type. If the output values are outside the range the output channels can support, the values are truncated.
EASI>MONITOR="ON" | turn monitor ON (default)
EASI>MONITOR="OFF" | turn monitor OFF (recommended if
| running in batch/background mode)
I = Intensity, H = Hue, S = Saturation R = Red, G = Green, B = BlueIf input channels are all 8-bit, then scaled Intensity, Hue and Saturation values are unscaled first:
I = I * (442 / 255) H = H * (360 / 255) S = S * (208.2066 / 255) K2 = 1 / sqrt(2) K3 = 1 / sqrt(3) K6 = 1 / sqrt(6) PI is the constant PI (3.14159) DegToRad = PI / 180 (factor to convert degrees to radians) B1 = S * cos(DegToRad * H) X1 = S * sin(DegToRad * H) R = (K3 * I) - (K6 * B1) - (K2 * X1) G = (K3 * I) - (K6 * B1) + (K2 * X1) B = (K3 * I) + (2 * K6 * B1)The above algorithm was derived from the following references:
Kruse, F.A. and G.L. Raines, 1984. "A Technique For Enhancing Digital Colour Images by Contrast Stretching in Munsell Colour Space", Proceedings of the International Symposium on Remote Sensing of Environment, 3rd Thematic Conference, Environmental Research Institute of Michigan, Colorado Springs, Colorado, pp. 755-773. Bonham-Carter, Graeme F., 1994. Geographic Informations Systems for Geoscientists: Modelling with GIS. Computer Methods in the Geosciences, Volume 13, published by Pergamon (Elsevier Science Ltd), pp. 120-125.
I = Intensity, H = Hue, S = Saturation R = Red, G = Green, B = BlueIf input channels are all 8-bit, then scaled Hue and Saturation values are unscaled first:
H = H * (360 / 255)
S = S * (1 / 255)
If (S = 0) (R,G,B) = (I,I,I)
If (S > 0) then
H = H / 60
J = floor(H)
F = H - J
P = I * (1 - S)
Q = V * (1 - (S * F))
T = V * (1 - (S * (1 - F)))
If (J = 0) (R,G,B) = (I,T,P)
If (J = 1) (R,G,B) = (Q,I,P)
If (J = 2) (R,G,B) = (P,I,T)
If (J = 3) (R,G,B) = (P,Q,I)
If (J = 4) (R,G,B) = (T,P,I)
If (J = 5) (R,G,B) = (I,P,Q)
The above algorithm was obtained from page 593 of the following text
book:
Foley, J.D., A. van Dam, S.K. Feiner and J.F. Hughes, 1990. Computer Graphics: Principles and Practice (second edition). Addison-Wesley Publishing Company.