Crop an HSZ or FLA data structure

Contents

Syntax:

    HSZ = crop_image(HS, rect);
    I = crop_image(Im, rect);

Description:

    Crops a hyperspectral image in a HSZ or FLA data structure.

Input:

    I: Image data structure
    HS: Scyllarus hyperspectral data structure
    rect: Four-element position vector [xmin ymin width height]
        that specifies the size and position of the crop rectangle.

Output:

    I: Cropped image data structure.
    HSZ: Cropped Scyllarus data structure.

Example:

    Crop an image based on a rect of width and height of 150 and 200 pixels, respectively.
    I = FLAread('.\shared\samples\apples_small.fla');
    Q = crop_image(I.I, [80 70 150 200]);

See also:

    crop_I, resize_image, resize_I