pygmi.clust.segmentation#
Image segmentation routines, following Baatz and Schäpe (2000).
Classes#
Image Segmentation GUI. |
Functions#
Module Contents#
- class pygmi.clust.segmentation.ImageSeg(parent=None)#
Bases:
pygmi.misc.BasicModuleImage Segmentation GUI.
- Parameters:
parent – Reference to the parent routine. The default is None.
- setupui()#
Set up UI.
- settings(nodialog=False)#
Entry point into item.
- Parameters:
nodialog (bool) – Run settings without a dialog. The default is False.
- Returns:
True if successful, False otherwise.
- Return type:
bool
- saveproj()#
Save project data from class.
- pygmi.clust.segmentation.segment1(data, *, scale=500, wcolor=0.5, wcompact=0.5, doshape=True, showlog=print, piter=iter)#
Perform image segmentation.
- Parameters:
data (numpy.typing.NDArray) – Input data.
scale (int) – Scale. The default is 500.
wcolor (float) – Colour weight. The default is 0.5.
wcompact (float) – Compactness weight. The default is 0.5.
doshape (float) – Perform shape segmentation. The default is True.
showlog (collections.abc.Callable[..., None]) – Display information. The default is print.
piter (collections.abc.Iterable) – Progress bar iterator. The default is iter.
- Returns:
omap – Output data.
- Return type:
numpy array
- pygmi.clust.segmentation.get_l(data)#
Get bounding box length.
- Parameters:
data (numpy.typing.NDArray) – Input data.
- Returns:
Bounding box length.
- Return type:
float