pygmi.clust.segmentation#
Image segmentation routines, following the technique by Baatz and Schäpe (2000).
Classes#
Image Segmentation GUI. |
Functions#
Module Contents#
- class pygmi.clust.segmentation.ImageSeg(parent=None)#
Bases:
pygmi.misc.BasicModule
Image Segmentation GUI.
- Parameters:
parent (parent, optional) – Reference to the parent routine. The default is None.
- setupui()#
Set up UI.
- Return type:
None.
- settings(nodialog=False)#
Entry point into item.
- Parameters:
nodialog (bool, optional) – Run settings without a dialog. The default is False.
- Returns:
True if successful, False otherwise.
- Return type:
bool
- saveproj()#
Save project data from class.
- Return type:
None.
- 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 array) – Input data.
scale (int, optional) – Scale. The default is 500.
wcolor (float, optional) – Colour weight. The default is 0.5.
wcompact (float, optional) – Compactness weight. The default is 0.5.
doshape (bool, optional) – Perform shape segmentation. The default is True.
showlog (function, optional) – Display information. The default is print.
piter (function, optional) – 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 array) – Input data.
- Returns:
ltmp – Bounding box length.
- Return type:
int