Main Content

resampleBands

Resample multispectral data

Since R2025a

    Description

    newmcube = resampleBands(mcube,targetResolution) resamples the images in each spectral band of the multispectral data mcube, using nearest neighbor interpolation, to a uniform resolution, targetResolution.

    example

    newmcube = resampleBands(mcube,targetResolution,method) specifies the interpolation method used in resampling.

    Examples

    collapse all

    Download Landsat 8 multispectral data.

    zipfile = "LC08_L1TP_113082_20211206_20211215_02_T1.zip";
    landsat8Data_url = "https://ssd.mathworks.com/supportfiles/image/data/" + zipfile;
    hyper.internal.downloadLandsatDataset(landsat8Data_url,zipfile)
    filepath = fullfile("LC08_L1TP_113082_20211206_20211215_02_T1","LC08_L1TP_113082_20211206_20211215_02_T1_MTL.txt");

    Read a multispectral image into the workspace, and inspect the resolution of all spectral bands.

    mcube = immulticube(filepath);
    mcube.BandResolution
    ans = 11×1
    
        30
        30
        30
        30
        30
        30
        30
        15
        30
        30
        30
          ⋮
    
    

    Resample the multispectral data to a uniform resolution. Inspect the resolution of the spectral bands of the resampled data.

    newmcube = resampleBands(mcube,30);
    newmcube.BandResolution
    ans = 11×1
    
        30
        30
        30
        30
        30
        30
        30
        30
        30
        30
        30
          ⋮
    
    

    Input Arguments

    collapse all

    Input multispectral data, specified as a multicube object.

    Target resolution, specified as a positive integer. The function resamples all spectral bands of the input multispectral data to this resolution.

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

    Interpolation method, specified as one of these values.

    • "nearest" — Nearest neighbor interpolation

    • "bilinear" — Bilinear interpolation

    • "cubic" — Cubic interpolation

    Data Types: char | string

    Output Arguments

    collapse all

    Resampled multispectral data, returned as a multicube object with uniform data resolution across all spectral bands.

    Version History

    Introduced in R2025a