grains.cad.overlay_regions

grains.cad.overlay_regions(label_image, polygons, axes=None)[source]

Plots a label image, and overlays polygonal regions over it.

Parameters
  • label_image (ndarray) – Labeled input image, represented as a 2D numpy array of positive integers.

  • polygons (dict) – The keys in the dictionary correspond to the labels of the input image, while the values are ndarray objects with two columns, the x and y coordinates of the polygons. This format is respected by the output of the polygonize function.

  • axes (matplotlib.axes.Axes, optional) – An Axes object on which to draw. If None, a new one is created.

Returns

axes (matplotlib.axes.Axes) – The Axes object on which the plot is drawn.