RGBFUS

IHS Data Fusion of Two Input Images


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Examples :: Algorithm :: Related

Back to top

Description


RGBFUS creates an output RGB color image by fusing an input RGB color with an input black-and-white intensity image, using the IHS transform (Cylinder or Hexcone model) or the Brovey transformation.
Back to top

Parameters


rgbfus(file1, dbic, dblut, file2, dbint, dbintlut, filo, dboc, resample, fusmodel)

Name Type Caption Length Value range
FILE1* str Input file name 1 1 -    
DBIC* List[int] Input image channels 3 - 3  
DBLUT List[int] Lookup table segments 0 - 3  
FILE2* str Input file name 2 1 -    
DBINT* List[int] Input intensity channel 1 - 1  
DBINTLUT List[int] Intensity lookup table segment 0 - 1  
FILO* str Output file name 1 -    
DBOC List[int] Output raster channels 0 - 3  
RESAMPLE* str Resample mode 4 - 8 Default: NEAR
FUSMODEL* str Fusion model 6 - 8 Default: CYLINDER

* Required parameter
Back to top

Parameter descriptions

FILE1

Specifies the name of the image file containing the three RGB color input channels used to define the color (hue and saturation) component of the fused output image.

FILE1 and FILE2 must be in the same georeferencing units.

DBIC

Specifies the input RGB image channels.

Exactly three channels must be specified and they must represent the red, green and blue bands respectively.

DBLUT can be specified for each band.

16-bit or 32-bit values are linearly scaled to 8-bit values between 0 and 255 before applying the lookup table.

DBLUT

Specifies three lookup table segments in the input file that will be used to enhance the three red, green, and blue input color channels. The LUT layers must be in the sequenced order of first LUT for red band, second LUT for green and last LUT for blue band.

This parameter is optional. If it is not specified, then the three input channels are not enhanced.

FILE2

Specifies name of the file that contains the input intensity image for data fusion.

The files specified by FILE1 and FILE2 must be in the same georeferencing units.

DBINT

Specifies the input black-and-white intensity image that defines the intensity component of the fused output color image.

DBINT (InputIntensity) must not be the same as DBOC (Output).

16-bit or 32-bit values are linearly scaled to 8-bit values between 0 and 255 before applying the lookup table.

DBINTLUT

Specifies a lookup table segment for enhancing the intensity input channel specified by DBINT(InputIntensity).

If this parameter is not specified, the intensity channel is not enhanced.

FILO

Specifies the name of the output PCIDSK file to receive the three output color channels (DBOC) resulting from data fusion.

FILE1, FILE2, and FILO can specify the same files. If the specified output file does not exist, a new file is created using the georeferencing bounds and minimum pixel resolution from FILE1 and FILE2.

DBOC

Specifies three output RGB channels to store the results of the data fusion. DBIC (InputColor) defines the color, and DBINT (InputIntensity) defines the intensity for the fused output color image.

DBOC must be specified if the file specified by FILO exists. DBOC defaults to 1, 2, and 3 if the file specified by FILO does not exist.

The specified output channel must not be the same as the specified intensity channel. Duplicate output channels are not allowed.

Results are always 8-bit values between 0 and 255.

RESAMPLE

Specifies the type of resampling method used on both input images.

Resampling extracts and interpolates the gray levels from the original pixel locations to corrected locations.

Three resampling modes are supported.

The default is NEAR (NEAREST).

FUSMODEL

Specifies the fusion model to use. Supported values are:

See the 'Details' and 'Algorithm' sections for more information about these fusion models.

Back to top

Details

RGBFUS performs data fusion of a Red-Green-Blue (RGB) color image with a black-and-white (B/W) intensity image using one of three different fusion models: Cylinder, Hexcone, or Brovey.

The Hexcone model is used by many commercial image processing software products. The Hexcone model runs about 15 percent faster than the Cylinder model.

The Brovey transform is a highly effective transform that generates a better looking image than the normal RGB image for many types of data, in particular for combining Landsat TM and SPOT Pan imagery. The Brovey transform is a formula-based process that is based on the band to display in a given color, the sum of all the color layers, and the intensity layer.

If FILE1 and FILO are the same and FILE2 is different then the black-white intensity image (DBINT) is resampled using the specified resampling method (RESAMPLE).

If FILE2 and FILO are the same and FILE1 is different, then the RGB input image is resampled using the specified resampling method (RESAMPLE).

If the output file does not exist, the new file is created with the georeferencing bounds of the input files and with the higher resolution of the two of them.

The lower resolution image is resampled using the specified resampling method.

If the output file (FILO) exists and it is different than the files specified by FILE1 and FILE2, then both FILE1 and FILE2 files are resampled to the FILO resolution using the specified resampling method (RESAMPLE).

The three input channels specified in DBIC (InputColor) represent the red, green, and blue channels, in that order. If one input channel is specified, the LUT segment must be specified. The three output channels specified by DBOC (Output) are used for the output of red, green, and blue, in that order.

FILE1, FILE2, and FILO (if it exists) must be in the same georeferencing units. The number of input channels (DBIC) must be one or three.

Back to top

Examples

A 30-meter resolution Thematic Mapper (TM) color image in irvine.pix is fused with a 10-meter resolution panchromatic Spot image in eltoro.pix. The result is a 10-meter resolution color image.

Step 1: For better results, enhance the RGB and intensity images first.

from pci.lut import *

fili      = "irvine.pix"
dbic      = [1,2,3]       # Use input image channel 1,2,3
lutfile   = ""            # default, use fili
dblut     = [2,3,4]       # Using LUT segment 2,3,4
maskfile  = ""            # process entire image
mask      = []            # entire image
filo      = "lut.pix"     # output file to be created
dboc      = [1,2,3]       # Overwrite input channels
datatype  = ""            # default, use 8U
ftype     = ""            # default, use PIX
foptions  = ""            # default, no options

lut (fili, dbic, lutfile, dblut, maskfile, mask, filo, dboc, datatype, ftype, foptions)

fili      = "eltoro.pix"
dbic      = [1]           #Use input image channel 1
lutfile   = ""            # default, use fili
dblut     = [2]           #Using LUT segment 2
maskfile  = ""            # process entire image
mask      = []            #entire image
filo      = "lut.pix"     # output file to be created
dboc      = [1]           #Overwrite input channel
datatype  = ""            # default, use 8U
ftype     = ""            # default, use PIX
foptions  = ""            # default, no options


lut (fili, dbic, lutfile, dblut, maskfile, mask, filo, dboc, datatype, ftype, foptions)
      

Step 2: Add three 8-bit channels to eltoro.pix to store the result.

from pci.pcimod import *

file='eltoro.pix'
pciop='ADD'
pcival=[3]                     #Add three 8-bit channels

pcimod(file,pciop,pcival)
        

Step 3: Use RGBFUS to fuse the data. Both the Cylinder model and the Hexcone model produce good results, but the Cylinder model has fewer false artifacts.

from pci.rgbfus import *

file1='irvine.pix'
dbic=[3,2,1]                   #Add three 8-bit channels
dblut = []
file2='eltoro.pix'
dbint = [1]
dbintlut = []
filo='eltoro.pix'
dboc = [2,3,4]
resample = 'CUBIC'
fusmodel = 'CYLINDER'

rgbfus(file1,dbic,dblut,file2,dbint,dbintlut,filo,dboc,
resample,fusmodel)

        
Back to top

Algorithm

The equations used to convert Red, Green, and Blue color values to Intensity, Hue, and Saturation color values for both the Cylinder and the Hexcone IHS models are described in the 'Algorithm' section of the RGB and IHS documentation.

The Brovey transform is a formula-based process that works by dividing the band to display in a given color by the sum of all the color layers (for example, Red, Green, and Blue) and then multiplying by the intensity layer (for example, SPOT Panchromatic layer).

R = Red, G = Green, B = Blue , I = Intensity (Panchromatic)

Red layer:

(R / (R + G + B)) * I

Green layer:

(G / (R + G + B)) * I

Blue layer:

(B / (R + G + B)) * I

© PCI Geomatics Enterprises, Inc.®, 2024. All rights reserved.