iris.nodes.vectorization package¶
Submodules¶
iris.nodes.vectorization.contouring module¶
- class iris.nodes.vectorization.contouring.ContouringAlgorithm(contour_filters: ~typing.List[~typing.Callable[[~typing.List[~numpy.ndarray]], ~typing.List[~numpy.ndarray]]] = [<function filter_polygon_areas>])[source]¶
Bases:
Algorithm
Implementation of a vectorization process through contouring raster image.
- class Parameters(*, contour_filters: List[Callable[[List[ndarray]], List[ndarray]]])[source]¶
Bases:
Parameters
Parameters class of the ContouringAlgorithm class.
- contour_filters: List[Callable[[List[ndarray]], List[ndarray]]]¶
- run(geometry_mask: GeometryMask) GeometryPolygons [source]¶
Contouring vectorization algorithm implementation.
- Parameters:
geometry_mask (GeometryMask) – Geometry segmentation map.
- Raises:
VectorizationError – Raised if iris region not segmented or an error occur during iris region processing.
- Returns:
Geometry polygons points.
- Return type:
- iris.nodes.vectorization.contouring.filter_polygon_areas(polygons: List[ndarray], rel_tr: NonNegativeFloat = 0.03, abs_tr: NonNegativeFloat = 0.0) List[ndarray] [source]¶
Filter out polygons whose area is below either an absolute threshold or a fraction of the largest area.
- Parameters:
polygons (List[np.ndarray]) – List of polygons to filter.
rel_tr (NonNegativeFloat, optional) – Relative threshold. Defaults to 0.03.
abs_tr (NonNegativeFloat, optional) – Absolute threshold. Defaults to 0.0.
- Returns:
Filtered polygons’ list.
- Return type:
List[np.ndarray]