Main Content


Reduce spectral smile effect in hyperspectral data cube

Since R2020b



    correctedData = reduceSmile(hcube) reduces the spectral smile effect in the hyperspectral data hcube by averaging the pixel values of each band along the spectral dimension with a window of size 3. The function averages the pixel values of each band with the corresponding pixel values of the previous band and the next band. The spectral smile effect occurs only in the data captured using push-broom hyperspectral sensors, such as the Hyperion EO-1 and the SEBASS.

    correctedData = reduceSmile(hcube,'BlockSize',blocksize) specifies the block size for block processing of the hyperspectral data cube by using the name-value pair argument 'BlockSize'. You can specify the 'BlockSize' name-value pair argument in addition to the input arguments in the previous syntaxes.

    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. Hyperspectral 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 reduceSmile function. If you encounter such an issue, perform block processing by using this syntax.

    For example, reduceSmile(hcube,'BlockSize',[50 50]) divides the input image into non-overlapping blocks of size 50-by-50 and then performs smile correction on each block.


    To perform block processing by specifying the 'BlockSize' name-value pair argument, you must have MATLAB® R2021a or a later release.

    correctedData = reduceSmile(___,Name,Value) specifies options using one or more name-value arguments in addition to the input arguments in the previous syntaxes. For example, 'Method','MNF' specifies to perform smile correction using the maximum noise fraction (MNF) transform-based method.


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

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


    collapse all

    Read hyperspectral data from the Hyperion EO-1 sensor into the workspace.

    hCube =  hypercube('EO1H0440342002212110PY_cropped.dat');

    Typically, Oxygen molecules have strong absorption features at 762 nm wavelength and causes spectral smile. In the Hyperion EO-1 sensor, 762 nm wavelength corresponds to band 41. The spectral smile effect in band 41 also affects the bands 40 and 42. Hence, calculate the absolute difference between the pixel values of bands 40 and 42.

    originalData = hCube.DataCube;
    band40 = originalData(:,:,40);
    band42 = originalData(:,:,42);
    bandDiffBeforeCorr = imabsdiff(band40,band42);

    Display the difference image of bands 40 and 42. The spectral smile effect appears as a brightness gradient from left to right in the difference image.

    axis image off
    title('Difference of Bands 40 and 42 Before Correction')

    Specify the size of the averaging window to use along the spectral dimension.

    window = 5;

    Perform spectral smile reduction.

    correctedHcube = reduceSmile(hCube,'SpectralWindow',window);

    Calculate and display the absolute difference of the corrected bands 40 and 42. There is no gradient in the difference image after smile correction.

    correctedData = correctedHcube.DataCube;
    corrBand40 = correctedData(:,:,40);
    corrBand42 = correctedData(:,:,42);
    bandDiffAfterCorr = imabsdiff(corrBand40,corrBand42);
    axis image off
    title('Difference of Bands 40 and 42 After Smile Correction')

    Input Arguments

    collapse all

    Input hyperspectral data, specified as a hypercube object. The DataCube property of the hypercube object stores the hyperspectral data cube.

    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 hyperspectral 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.

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

    Example: reduceSmile(hcube,'Method','MNF')

    Spectral smile correction method, specified as 'SpectralSmoothing' or 'MNF'.

    • 'SpectralSmoothing' — Perform smile reduction using the spectral smoothing method.

    • 'MNF' — Perform smile reduction using the maximum noise fraction (MNF) transform-based method.

    Size of the averaging window along the spectral dimension, specified as a positive integer that is less than or equal to the number of hyperspectral bands in the hyperspectral data inputData. Increasing the window size can further reduce the smile effect, but using an averaging window greater than 9 can result in the loss of fine atmospheric absorption spectral features. To specify this argument, you must specify the 'Method' argument as 'SpectralSmoothing'.

    Output Arguments

    collapse all

    Corrected hyperspectral data, returned as a hypercube object of the size same as the input data hcube. If the input data is of type double, then the corrected hyperspectral data is of type double. Otherwise, the data type of the corrected hyperspectral data is single.


    [1] Perkins, Timothy, Steven M. Adler-Golden, Michael W. Matthew, Alexander Berk, Lawrence S. Bernstein, Jasmine Lee, and Marsha E. Fox. "Speed and Accuracy Improvements in FLAASH Atmospheric Correction of Hyperspectral Imagery." Optical Engineering 51, no. 11 (June 13, 2012): 111707,

    [2] Yokoya, Naoto, Norihide Miyamura, and Akira Iwasaki. “Detection and Correction of Spectral and Spatial Misregistrations for Hyperspectral Data Using Phase Correlation Method.” Applied Optics 49, no. 24 (August 20, 2010): 4568.

    Version History

    Introduced in R2020b