BRDFCOR

Reduce cross-swath brightness variation


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Acknowledgements

Back to top

Description


Corrects for cross-swath image brightness variation.
Back to top

Parameters


brdfcor(fili, filo, dbic, dboc, dbiw, dbow, dbib, dbob, order, imean)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
FILO str Output file name 0 -    
DBIC * List[int] Input raster channel(s) 1 -    
DBOC List[int] Output raster channel(s) 0 -    
DBIW List[int] Raster input window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
DBOW List[int] Raster output window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
DBIB List[int] Input training bitmap segment(s) 0 - 16  
DBOB List[int] Output control bitmap segment(s) 0 - 16  
ORDER List[int] Order of polynomial equation 0 - 1 1 - 5
Default: 1
IMEAN List[float] Input mean gray-level value 0 - 16  

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the input file that contains the uncorrected image data.

FILO

Specifies the name of the output file to receive the corrected image data. If this parameter is not specified, all processing is done by BRDFCOR except for the actual correction and output of the corrected data.

If the specified output file does not already exist, BRDFCOR creates it. If the specified output file already exists, it must have the same dimensions as the input file (FILI).

DBIC

Specifies the input image channels to correct.

Duplicate channels are not allowed.

DBOC

Specifies the image channels in the output file (FILO) to receive the corrected image channels.

Duplicate channels are not allowed.

DBIW

Optionally specifies the rectangular window (Xoffset, Yoffset, Xsize, Ysize) of image data read from the input channels. If this parameter is not specified, the entire image is processed by default.

Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

The area sampled by DBIW should be homogeneous across the range of the window to reduce the influence of natural scene variations on the transformation model.

DBIW only specifies the sampled input window in order to generate the least-squares polynomial; it does not affect the output window (DBOW) of corrected imagery, unless the output window is explicitly set with the same values as the input window.

DBOW

Optionally specifies a rectangular window of image data in the output file (FILO) to which the BRDF corrected data is generated.

Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

This parameter is not affected by DBIW unless DBOW is explicitly set with the same values as DBIW.

DBIB

Specifies the input bitmap segment(s) that define the training sites that sample data from the input channels and generate the linear regression polynomial.

Duplicate segments are not allowed.

DBOB

Specifies the output bitmap segment(s) that define the area that is corrected and generated to the output file. If this parameter is specified, the bitmaps must exist in the input file (FILI).

Duplicate segments are not allowed.

ORDER

Specifies the order of the polynomial equation used to estimate the mean gray-level value for each column.

Supported values are:

IMEAN

Specifies the mean gray level to which each column of data is adjusted. If this parameter is not set to a meaningful value, it must be cleared before running BRDFCOR; otherwise, the function uses the average gray level from the samples collected under DBIW (input training site window) and DBIB (input training site bitmap).

Back to top

Details

BRDFCOR corrects for the along-line image brightness variation caused by the scene's bi-directional reflectance distribution function (BRDF) and the change in sensor view-direction with image-pixel coordinates. For example, an appropriate image to correct with BRDFCOR appears darker on one side than the other. The shift in brightness occurs column-by-column as you move from one side of the image to the other.

BRDFCOR adjusts the gray-level value of the output image column-by-column so that the brightness of all columns is similar to the brightness of the average gray level of the samples read under the input window or bitmap segment (DBIW or DBIB).

FILI specifies the input file to be corrected and DBIC (Input) specifies the input channels to be sampled and corrected. A window of data to process may be specified (DBIW).

Depending on the specified input bitmaps (DBIB), two modes of adjustment are available:

If both the input window (DBIW) and input bitmaps (DBIB) are specified, only those pixels that satisfy both conditions are sampled; that is, only those pixels that lie within the window AND that lie under the bitmap(s) are used to generate the best-fit polynomial.

The column-specific gain is computed based on a linear regression of the specified columns. The order of the polynomial equation (ORDER) may be specified in the range of 1 to 5; that is, either first order (straight line), second order (parabola or or quadratic curve), third order (cubic curve), fourth order (quadric curve), or fifth order (fifth-degree curve).

If the output file (FILO) is specified, it is used for the output. If it does not already exist, a new output file is created with the same dimensions as the input file (FILI). If the specified output file already exists, it must have the same dimensions as the input file.

The DBOW parameter optionally specifies an output window in the output file to receive the generated data. DBOB (OutputBitmaps) specifies any non-rectangular areas in the output file to receive the generated data. If DBOB is specified, the output bitmaps reside in the input file (FILI). If both DBOW and DBOB are specified, only those pixels that satisfy both criteria are generated.

If FILO is not specified, all processing is done except for the actual adjustment to create the output bands.

If IMEAN (Input Mean Gray-Level Value) is not set to a meaningful value, BRDFCOR uses the average gray level from the samples read from the input window and input bitmaps (DBIW and DBIB), and IMEAN is updated with these values in the PRM.PRM file. If BRDFCOR is run more than once on the same data set, IMEAN should remain unchanged; this way, the same mean value is re-used each time BRDFCOR is run on the input data set.

Back to top

Example

TBD

from pci.brdfcor import brdfcor

fili	=	"irvine.pix"
filo	=	"brdfcor.pix"	# file to be created
dbic	=	[1]	# input channel
dboc	=	[]	# output channel
dbiw	=	[]	# entire input window
dbow	=	[]	# entire output window
dbib	=	[]	# do not sample under bitmaps
dbob	=	[]	# do not generate under bitmaps
order	=	[]	# first order
imean	=	[]	# use average gray level

brdfcor( fili, filo, dbic, dboc, dbiw, dbow, dbib, dbob, order, imean )
          Y

73.703125 +                                                        
          |           **                                           
          |          ***  ***                                      
          |O        *********                                      
69.271354 + OOOOO   ************                                   
          |      OOOOOO*********                                   
          |      * ****OOOOOO***                                   
          |     ** **********OOOOOO *                              
64.839583 +  *  *******************OOOOO**                         
          |*****************************OOOOOO    ***              
          |********************************* *OOOOOO*  **          
          |************************************ ****OOOOO          
60.407812 +**********************************************OOOOOO    
          |*************************************************** OOO 
          |***************************************************** * 
57.083984 |******************************************************* 
          +-------+-------+-------+-------+-------+-------+-------+  X
           1     66     140     215     289     364     438     512

Plot Symbols: ***, Mean Gray-level for the columns
              OOO, Least-squares fit polynomial

Plot Cell:   X (Columns                     ) =       9.3090909
             Y (Average gray-level of column) =       1.1079427

Y =   6.985303e+01        - 2.080670e-02 * X    

Creating     512P     512L    1C file: brdfcor.pix
 Creating segment:  1  [ 150: Georeferencing ]        8 Blocks long

Processing the output channel(s)...
(BRDFCOR 100%)
Back to top

Acknowledgements

PCI Geomatics received financial support from the Canadian Space Agency/L'Agence Spatiale Canadienne through the Earth Observation Application Development Program (EOADP) for the development of this software, under contract 9F028-0-4902/12.

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