ROLLCOR

Reduce roll distortion in scanner images


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

Back to top

Description


Attempts to reduce distortion in a pushbroom or whiskbroom scanner image, caused by platform roll about the along-track axis during image acquisition. The correction operation is limited to shifting lines by a specified number of pixels.
Back to top

Parameters


rollcor(fili, filo, dbiw, dbic, wlenint, valonly, corchn, nparts, fparts)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
FILO * str Output file name 1 -    
DBIW List[int] Input window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
DBIC List[int] Input raster channels 0 -    
WLENINT List[float] Wavelength interval 0 - 2  
VALONLY str Valid bands only 0 - 3 YES | NO
Default: NO
CORCHN List[int] Input correction channel 0 - 1 Default: 1
NPARTS List[int] Number of line parts 0 - 1 1 -
Default: 75
FPARTS List[float] Fraction of all line parts 0 - 1 1.0
Default: 0.20

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the file containing the hyperspectral data set to be used as input.

FILO

Specifies the name of the file to receive the roll-corrected hyperspectral data set (or sub-set thereof). The specified file must not already exist.

DBIW

Specifies a rectangular window of the input image channels on which to perform the roll correction.

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.

DBIC

Specifies the image channels that contain a subset of the input data set bands to process. If this parameter is not specified, all data set band channels are processed.

WLENINT

Specifies that the selected bands are to be restricted to those whose center wavelength is either inside or outside a closed interval, specified in nanometers. By default, no restriction is applied.

The wavelength interval may be specified as follows:

This parameter has no effect if the input file contains no band center wavelength metadata.

VALONLY

Specifies whether the selected bands are to be restricted to those with "plot" or "bmask" (begin mask) quality values. The default is NO.

This parameter has no effect if the input file contains no band-validity metadata.

CORCHN

Specifies the channel that contains the image band with which the correction is to be computed. The default is channel 1.

NPARTS

Specifies the number of equal-sized parts into which each image scanline is divided for the purpose of computing a roll correction shift for the scanline as a whole.

A roll correction shift is computed independently for each of these scanline parts. The roll correction shift for the scanline as a whole is computed as the average of the shifts for a subset of the scanline parts. This subset is composed of parts for which shifting has resulted in the greatest improvement in between-scanline matching. The size of the subset is the fraction of the total number of scanline parts specified in the FPARTS (Fraction of All Line Parts) parameter.

The default value is 75.

FPARTS

Specifies the fraction of the total number of scanline parts (NPARTS) that will be used to compute the roll correction shift for the line as a whole. The selected FPARTS*NPARTS parts are those that have the greatest 'improvement' value.

The default value is 0.20.

Back to top

Details

ROLLCOR attempts to reduce distortion in a pushbroom or whiskbroom scanner image that was caused by platform roll about the along-track axis during image acquisition.

Starting with the second image scanline, ROLLCOR shifts each scanline relative to the previous one by a specified number of pixel positions to the left or the right.

The evaluation of the relative scanline shifts is performed using the input band stored in the channel specified by CORCHN (Input Correction Channel). A channel holding a relatively noiseless band with good contrast should be specified.

The relative shift for a scanline is a function of relative shifts computed separately for each of the equal-size scanline parts (NPARTS/Number of Parts). The pixel-by-pixel absolute difference sum between each part and the previous scanline is computed at relative shifts in one-pixel increments to both the left and the right (see the Algorithm section). Each scanline part is shifted a maximum amount in either direction equal to the part's dimension. For a scanline dimension of XSize, the dimension of each part is XSize/(NPARTS+2). This reserves space on the scanline before the first part and after the last, into which those parts can be shifted without going beyond the ends of the previous scanline.

The smaller the value of NPARTS, the larger the scanline parts and the larger the possible relative scanline shift; however, a smaller scanline part size (due to a large value of NPARTS) combined with a smaller value of FPARTS (Fraction of All Parts) allows the whole-scanline shift to be based only on the parts of a scanline that contain image features that reveal the roll distortion most clearly. For more details, refer to the Algorithm section.

The correction is applied only to the selected image bands (specified by DBIC, WLENINT, and VALONLY), and to the input window (DBIW). Only the corrected image bands and corrected input window are output.

If ROLLCOR makes any corrections, the along-flightline edges of the output image strip will not be straight (they will usually be quite noticeably wavy). The region of the image channels between the image edges and the first and last column of the channels will be evaluated to zero.

If the image data was acquired under platform yaw, the image output by ROLLCOR may appear to be a strip with wavy edges, as described above, and with an overall trend that is not parallel to the channel columns. This is the result of ROLLCOR attempting to correct image distortion caused by yaw as though it had been caused by roll.

Back to top

Example

from pci.rollcor import rollcor

fili	=	"cuprad.pix"
filo	=	"cuprad_rc.pix"
dbiw	=	[]	# process entire image
dbic	=	[]	# no restriction
wlenint	=	[]	# no restriction
valonly	=	' '	# no restriction
corchn	=	[31]	# compute shifts from channel 31
nparts	=	[120]
fparts	=	[0.2]

rollcor( fili, filo, dbiw, dbic, wlenint, valonly, corchn, nparts, fparts )
Back to top

Algorithm

Consider two adjacent image lines I and I+1, of size N, and part of scanline I+1 that extends from pixel P0 to pixel P0+M:

line I   :  0   1   2  ...  P0 ... P0+M ... N
line I+1 :  0   1   2  ...  P0 ... P0+M ... N

The absolute difference sum for the scanline part at a relative shift of 0 (D0) is:

Sum i=P0,(P0+M) abs (I(i) - I+1(i))

Consider a shift of the scanline I+1 part relative to scanline I by S pixels:

line I   :  0   1   2  ...  P0 ... P0+S ... P1+M ... P1+M+S ... N
line I+1 :                         P0       ...      P1+M

The absolute difference sum for the scanline part at a relative shift of S (DS) is:

Sum i=P0,(P0+M) abs (I(i+S) - I+1(i))

A scanline part of dimension M is shifted from -(M+1) to (M+1). The relative shift in this interval with the minimum absolute difference sum is Smin. The minimum absolute difference sum is Dmin. The 'improvement' for this scanline part is IMP = D0-Dmin.

The relative shift value for a scanline as a whole is computed as the average of the Smin values for FPARTS * NPARTS scanline parts. These parts are selected such that they have the greatest IMP values over all the parts for the scanline.

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.