Main Content

correctOOB

Correct out-of-band effect using sensor spectral response

Since R2020b

    Description

    newspcube = correctOOB(spcube,spectralResponse) corrects the out-of-band (OOB) effect in the input satellite data by using the sensor's spectral response characteristics. This method is suitable for OOB correction in multispectral satellite data.

    Use this function to correct OOB effects over different regions such as clear waters, turbid waters, green vegetation, sand, and soil. This method gives best results if the input data is compensated for Rayleigh and aerosol scattering. To measure the OOB effect on scenes with large water bodies, you must first compute the water leaving radiance spectra from the input satellite data.

    [newspcube,oobEffect] = correctOOB(spcube,spectralResponse) also returns the relative OOB effect for each spectral band.

    [___] = correctOOB(spcube,spectralResponse,RegionMask=mask) specifies the region mask which indicates the homogeneous regions in the input satellite data.

    example

    newspcube = correctOOB(___,BlockSize=blocksize) specifies the block size for block processing of the spectral data. (since R2021a)

    The function divides the input image into distinct blocks, processes each block, and then concatenates the processed output of each block to form the output matrix. Spectral images are multi-dimensional data sets that can be too large to fit in system memory in their entirety. This can cause the system to run out of memory while running the correctOOB function. If you encounter such an issue, perform block processing by using this syntax.

    For example, correctOOB(spcube,spectralResponse,BlockSize=[50 50]) divides the input image into non-overlapping blocks of size 50-by-50 and then performs out-of-band correction on each block.

    Note

    This function requires the Hyperspectral Imaging Library for Image Processing Toolbox™. You can install the Hyperspectral Imaging Library for Image Processing Toolbox from Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.

    The Hyperspectral Imaging Library for Image Processing Toolbox requires desktop MATLAB®, as MATLAB Online™ and MATLAB Mobile™ do not support the library.

    Examples

    collapse all

    Read multispectral data into the workspace.

    hcube = imhypercube("LC08_L1TP_097070_20201101_20201101_01_cropped.dat");

    Convert the pixel values from digital numbers to top of atmosphere (TOA) radiance values.

    hcube = dn2radiance(hcube);

    Estimate remotely sensed water reflectance.

    [rrshcube,mask] = rrs(hcube);

    Read the sensor spectral response.

    spectralResponse = readtable("spectralResponse.txt");
    spectralResponse = table2array(spectralResponse);

    Perform OOB correction using the clear-water pixels specified by the region mask.

    [newhcube,oobEffect] = correctOOB(rrshcube,spectralResponse,RegionMask=mask);

    Estimate RGB images of the input and the OOB corrected output data. Increase the image contrast by applying contrast stretching.

    imgIn = colorize(hcube,Method="rgb",ContrastStretching=true);
    imgOut = colorize(newhcube,Method="rgb",ContrastStretching=true);

    Display the input and the OOB corrected output images.

    figure
    montage({imgIn,imgOut})
    title("Input Image | OOB Corrected Image")

    Figure contains an axes object. The hidden axes object with title Input Image | OOB Corrected Image contains an object of type image.

    Input Arguments

    collapse all

    Input satellite data, specified as a hypercube or multicube object. The data cube is of size M-by-N-by-C. C is the number of spectral bands in the input satellite data.

    If spcube is a multicube object, all its spectral bands must have the same data resolution. If all spectral bands of the multicube object do not have the same resolution, resample the bands using the resampleBands function, or select bands with uniform resolution using the selectBands function.

    Sensor spectral response, specified as a matrix or a table. The size of the matrix or the table must be K-by-C+1. The first column of the matrix or table contains the wavelength values and the spectral resolution is 1 nm.

    Region mask indicating homogeneous regions, specified as a matrix of size M-by-N. The region mask is a binary image with intensity values 0 and 1. The regions with intensity value 1 corresponds to the homogeneous regions in the input satellite data.

    Example: correctOOB(spcube,spectralResponse,RegionMask=mask)

    Data Types: logical

    Size of the data blocks, specified as a 2-element vector of positive integers. The elements of the vector correspond to the number of rows and columns in each block, respectively. The size of the data blocks must be less than the size of the input image. Dividing the spectral images into smaller blocks enables you process large data sets without running out of memory.

    • If the blocksize value is too small, the memory usage of the function reduces at the cost of increased execution time.

    • If the blocksize value is large or equal to the input image size, the execution time reduces at the cost of increased memory usage.

    Example: BlockSize=[20 20] specifies the size of each data block as 20-by-20.

    Output Arguments

    collapse all

    Out-of-band corrected data, returned as a hypercube or multicube object.

    Out-of-band effect for each band, returned as a C-element vector. The out-of-band effect for each spectral band is measured as the relative difference between the values of homogeneous region pixels in the input data spcube and the corrected data newspcube.

    Version History

    Introduced in R2020b

    expand all