swectral.roi_median#
- swectral.roi_median(image_path, roi_coordinates)[source]#
Computes spectral mean of the provided region of interests (ROI) in the provided image.
- Parameters:
- image_path
str Spectral raster image path.
- roi_coordinates
listoflistoftupleof2 (intorfloat) Coordinates of the ROI polygons. Structure:
[ [ (x1, y1), (x2, y2), ..., (xn, yn), (x1, y1) ], # Polygon 1 [ (x1, y1), (x2, y2), ..., (xm, ym), (x1, y1) ], # Polygon 2 ... ]
Each inner list represents a polygon (for multipart geometries), and each tuple is a vertex coordinate.
- image_path
- Returns:
numpy.ndarrayAn array of ROI spectral median values.
- Return type:
Examples
>>> roi_std("/image1.tif", [[(0, 0), (0, 10), (10, 0), (0, 0)]])