Main Content

sharpencnmf

Sharpen hyperspectral data using coupled nonnegative matrix factorization (CNMF) method

    Description

    example

    outputData = sharpencnmf(lrData,hrData) sharpens the low resolution hyperspectral data, lrData of a scene by using coupled nonnegative matrix factorization (CNMF) method. The CNMF method is an iterative approach that uses the high resolution multispectral or panchromatic data, hrData of the same scene for sharpening the hyperspectral data.

    Hyperspectral image sharpening increases the spatial resolution of a hyperspectral data by fusing information from a high resolution multispectral data or a panchromatic data. The sharpening process is also known as image fusion (fusing multispectral and hyperspectral data) or pan-sharpening (fusing panchromatic and hyperspectral data).

    Note

    • The spatial dimension of the hyperspectral data must be less than the spatial dimension of the multispectral or panchromatic data.

    • The number of spectral bands in the hyperspectral data must be greater than the number of bands in the multispectral data. For panchromatic data, the number of spectral bands is always 1.

    example

    outputData = sharpencnmf(lrData,hrData,Name,Value) also specifies options using one or more name-value pair arguments. Use this syntax to set the parameter values for CNMF method.

    Note

    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.

    Examples

    collapse all

    Read a low spatial resolution hyperspectral image of a scene into the workspace.

    hcube = hypercube('EO1H0440342002212110PY_hsi.hdr');

    Read the high spatial resolution multispectral image of the same scene into the workspace.

    pcube = hypercube('EO1H0440342002212110PY_msi.hdr');

    Sharpen the low spatial resolution hyperspectral data by fusing information from the high spatial resolution multispectral data by using the CNMF method. The output is a high resolution hyperspectral data and the data cube has a spatial resolution same as that of the input multispectral data.

    newhcube = sharpencnmf(hcube,pcube);

    Estimate an RGB image of the input hyperspectral, input multispectral, and the sharpened hyperspectral output.

    lrData = colorize(hcube,'method','rgb','ContrastStretching',true);
    hrData = colorize(pcube,'method','rgb','ContrastStretching',true);
    outputData = colorize(newhcube,'method','rgb','ContrastStretching',true);

    Display the low spatial resolution hyperspectral (HS) image, high spatial resolution multispectral (MS) image, and high resolution HS output image.

    figure
    montage({lrData;hrData;outputData})
    title('Low Resolution HS Input | High Resolution MS Input | High Resolution HS Output')

    Read low spatial resolution hyperspectral image of a scene into the workspace.

    hcube = hypercube('EO1H0440342002212110PY_hsi.hdr');

    Read the high spatial resolution multispectral image of the same scene into the workspace.

    pcube = hypercube('EO1H0440342002212110PY_msi.hdr');

    Sharpen the low spatial resolution hyperspectral data by using the CNMF method. Set the convergence threshold value to 0.1.

    newhcube = sharpencnmf(hcube,pcube,'ConvergenceThreshold',0.1);

    Estimate an RGB image of the input hyperspectral, input multispectral, and the sharpened hyperspectral output.

    lrData = colorize(hcube,'method','rgb','ContrastStretching',true);
    hrData = colorize(pcube,'method','rgb','ContrastStretching',true);
    outputData = colorize(newhcube,'method','rgb','ContrastStretching',true);

    Display the low spatial resolution hyperspectral (HS) image, high spatial resolution multispectral (MS) image, and high resolution HS output image.

    figure
    montage({lrData;hrData;outputData})
    title('Low Resolution HS Input | High Resolution MS Input | High Resolution HS Output')

    Input Arguments

    collapse all

    Low resolution hyperspectral data, specified as a hypercube object or a 3-D numeric array containing the data cube. If the input is a hypercube object, the data is read from the DataCube property of the object.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    High resolution input, specified as a hypercube object, 3-D numeric array containing the data cube, or matrix. If the input is a hypercube object, the data is read from the DataCube property of the object.

    The high resolution input is either a multispectral or panchromatic data.

    • For multispectral data, the input value must be hypercube object or 3-D numeric array containing the data cube.

    • For panchromatic data, the input value can be any of these:

      • A hypercube object or 3-D numeric array containing the data cube. The number of spectral bands in the data cube must be 1.

      • A matrix.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Name-Value Pair Arguments

    Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

    Example: cnmf(lrData,hrData,'MaxConvergenceIterations',40)

    Maximum number of iterations required for convergence, specified as the comma-separated pair consisting of 'MaxConvergenceIterations' and a positive integer scalar.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Maximum number of iterations required to optimize spectral unmixing of hyperspectral and multispectral data, specified as the comma-separated pair consisting of 'MaxOptimizationIterations' and a positive integer scalar. If the high resolution input hrData is a panchromatic image, the spectral unmixing is performed only on the hyperspectral data.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Threshold for convergence, specified as the comma-separated pair consisting of 'ConvergenceThreshold' and a positive scalar. If you increase the convergence threshold, the accuracy of spectral unmixing decreases.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Number of endmembers for spectral unmixing, specified as the comma-separated pair consisting of 'NumEndmembers' and a positive integer scalar.

    For the default value, the sharpencnmf first counts the total number of endmembers (TotalEM) in the hyperspectral data by using the countEndmembersHFC function. Then, computes the number of endmembers for unmixing pixel values as, min(40,TotalEM).

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Output Arguments

    collapse all

    Sharpened hyperspectral data, returned as a hypercube object or 3-D numeric array.

    If the low resolution hyperspectral data cube specified by lrData is of size P-by-Q-by-C and the high resolution data hrData is of size M-by-N-by-K then the sharpened output

    is of size M-by-N-by-C.

    References

    [1] Yokoya, Naoto, Takehisa Yairi, and Akira Iwasaki. “Coupled Nonnegative Matrix Factorization Unmixing for Hyperspectral and Multispectral Data Fusion.” IEEE Transactions on Geoscience and Remote Sensing 50, no. 2 (February 2012): 528–37. https://doi.org/10.1109/TGRS.2011.2161320.

    Introduced in R2020b