STRPCOR

Remove periodic striping


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

Back to top

Description


Corrects for periodic striping in raster imagery caused by differences in signal response between different detectors.
Back to top

Parameters


strpcor(fili, filo, dbic, dboc, rowcol, smoothm, dbib, ksize, order)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
FILO str Output file name 0 -    
DBIC * List[int] Input raster channels 1 -    
DBOC List[int] Output raster channels 0 -    
ROWCOL str Correction process 0 - 3 ROW | COLUMN
Default: ROW
SMOOTHM str Smoothing method 0 - 3 LIN | SQU | TRI | EXP | GAU | POL
Default: LIN
DBIB List[int] Input bitmap segment 0 - 16  
KSIZE List[int] Kernel length 0 - 1 1 -
Default: 7
ORDER List[int] Order of polynomial equation 0 - 1 1 - 5
Default: 1

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the file that contains the uncorrected image data. If bitmaps are specified (DBIB) they are assumed to exist in FILI.

FILO

Specifies the name of the file to receive the output corrected image data. If this parameter is not specified, all processing will be done by STRPCOR except for the actual correction and output of the corrected data. If the output file is specified but does not exist, STRPCOR automatically creates it. If FILO is specified and it already exists, FILO must have the same dimensions as FILI.

DBIC

Specifies the image channels on to correct.

Duplicate channels are NOT allowed.

DBOC

Specifies the output image channels to receive the corrected image.

Duplicate channels are NOT allowed.

ROWCOL

Specifies whether to perform the correction on the rows or columns of the image.

SMOOTHM

Specifies the smoothing method to use to correct the striping in the imagery.

Supported methods are:

DBIB

Specifies the input bitmap segment(s) that indicate the location of striped data. This parameter is used only for linear corrections (SMOOTHM="LIN").

Duplicate segments are NOT allowed.

KSIZE

Specifies the kernel window size to use when the smoothing method (SMOOTHM) is not linear (LIN). If the correction process (ROWCOL) is "ROW", this is in units of scanlines. If ROWCOL is "COL", this is in units of pixels.

The specified value must be an odd integer between 1 and 99 inclusively. The kernel size must not exceed the size of the input file.

ORDER

Specifies the order of the polynomial equation used to estimate the mean gray level for each scanline.

Supported values are:

If the smoothing method (SMOOTHM) is set to "POL", STRPCOR requires the kernel size (KSIZE) to be greater or equal to ORDER + 1. If this is not the case, STRPCOR will exit with a message to either raise the value of KSIZE or lower the value of ORDER.

Back to top

Details

STRPCOR corrects for image brightness variation that appears as as "stripes" in the image data. This type of correction is commonly known as "destriping." The stripes may be either horizontal (affecting entire scanlines) or vertical (affecting the same columns in each scanline). The correction process (ROWCOL) specifies how the striping occurs. ROWCOL set to "ROW" will process striping of entire scanlines; ROWCOL set to "COL" will correct for vertical striping of columns of the scanlines.

Note: In the following documentation, the scanline case is discussed (ROWCOL="ROW"). If you are dealing with the column case (ROWCOL="COL"), substitute "column" where it says "scanline" or "row".)

STRPCOR adjusts the gray level of the output image rows so that the brightness of the "striped" scanlines is lightened or darkened to match the brightness of the scanlines where there is no striping. This is done by multiplying each pixel gray-level value in the scanline by a calculated gain factor. The input image data to correct should be non-zero in the "striped" rows. If the "striped" rows are actually "dropped" scanlines (where all pixels in the scanline are zeroed), STRPCOR will not work and another method must be used to correct the imagery.

Back to top

Examples

Linear smoothing

A linear stripe correction requires the stripe(s) to be identified. (The other methods do not require the stripe(s) to be identified.) The following example uses the bitmap 10 ("Water2") that exists on irvine.pix. All scanlines under bitmap 10 are considered to be a single stripe to correct.

from pci.strpcor import strpcor

fili	=	'irvine.pix'
filo	=	'stripecor_1.pix'
dbic	=	[1]	# input channel
dboc	=	[1]	# output channel
rowcol	=	''	# default, row
smoothm	=	'lin'	# linear correction
dbib	=	[10]	# bitmap defining the striping
ksize	=	[]	# not used when SMOOTHM="LIN"
order	=	[]	# not used when SMOOTHM="LIN"

strpcor( fili, filo, dbic, dboc, rowcol, smoothm, dbib, ksize, order )

Polynomial correction

Stripe correction using a polynomial uses a parameter that the other smoothing methods do not; this is the ORDER parameter, which specifies the order of the polynomial to produce.

from pci.strpcor import strpcor

fili	=	'irvine.pix'
filo	=	'stripecor_2.pix'
dbic	=	[1]	# input channel
dboc	=	[1]	# output channel
rowcol	=	''	# default, row
smoothm	=	'pol'	# polynomial correction
dbib	=	[]	# not used when SMOOTHM="POL"
ksize	=	[]	# default, 7 scanlines
order	=	[]	# default, 1st order polynomial

strpcor( fili, filo, dbic, dboc, rowcol, smoothm, dbib, ksize, order )

Square correction

The following example does a square smoothing correction (SMOOTHM="SQU"). The parameter settings work similarly when another of the other smoothing methods (triangular ("TRI") or exponential ("EXP") or gaussian ("GAU") is specified.

from pci.strpcor import strpcor

fili	=	'irvine.pix'
filo	=	'stripecor_3.pix'
dbic	=	[1]	# input channel
dboc	=	[1]	# output channel
rowcol	=	''	# default, row
smoothm	=	'squ'	# square smoothing correction
dbib	=	[]	# not used when SMOOTHM="SQU"
ksize	=	[]	# default, 7 scanlines
order	=	[]	# not used when SMOOTHM="SQU"

strpcor( fili, filo, dbic, dboc, rowcol, smoothm, dbib, ksize, order )
Back to top

Algorithm

STRPCOR uses three different stripe correction strategies:

Linear correction

The Linear stripe correction strategy requires the "stripes" in the imagery to be defined. This is done with one or more bitmaps (DBIB). If a bit is set, it is taken to mean that all the scanlines under that bit is part of the stripe.

Once the stripes have been identified, a gain factor is calculated to multiply against that scanline. The gain factors are calculated as follows:

Polynomial correction

The Polynomial method is similar to the Smoothing methods in that both smooth the data. The difference is that the Polynomial method performs smoothing with least-squares fit polynomials, while the Smoothing methods use different smoothing functions.

The Polynomial method is calculated as follows:
The smoothed average gray level of each scanline is calculated as follows:

Smoothing

The Smoothing methods all follow the same strategy; they differ only in the function that is used to smooth out the stripes:
The smoothed average gray level of each scanline is calculated as follows:

The Smooth functions (SMOOTH_FUNCTION) are as follows.

Note: X will be the input value to smooth. From the previous section X could be (MEAN_2 - MEAN_1). HALF_KSIZE is half the kernel size, where any fraction is discarded. From the previous section, HALF_KSIZE is 3/2 which truncates to 1.
Square (that is, SMOOTHM="SQU"),
    SMOOTH = 1.0

Triangular (that is, SMOOTHM="TRI")
    if the input value X is negative or equal to zero
        SMOOTH = (   X  / HALF_KSIZE ) + 1.0
    if the input value X is positive (that is, greater than zero)
        SMOOTH = ( (-X) / HALF_KSIZE ) + 1.0

Exponential (that is, SMOOTHM="EXP")
    SMOOTH = EXP( -3.0 * ABS( X / HALF_KSIZE ) )

where EXP() is the exponential function
and   ABS() is the absolute value of ( X / HALF_KSIZE )

Gaussian (that is, SMOOTHM="GAU")
    SMOOTH = EXP( -4.0 * SQUARE( X / HALF_KSIZE ) )
        
where EXP()    is the exponential function 
and   SQUARE() is the square of ( X / HALF_KSIZE )
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.

Back to top

References

Datt, B. McVicar, T.R. et al. "Pre-processing EO-1 Hyperion Hyperspectral data to Support the Application of Agricultural Indexes", IEEE Transactions on Geoscience and Remote Sensing, June 2003, Volume 41, Issue 6 pp. 1246-1259.

F. A. Kruse, "Use of airborne imaging spectrometer data to map minerals associated with hydrothermally altered rocks in the Northern Grapevine Mountains, Nevada and California," Remote Sens. Environ., vol. 24, no. 1, pp. 31-51, 1988.

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