bundles / skimage latest / skimage / future / trainable_segmentation / fit_segmenter
function
skimage.future.trainable_segmentation:fit_segmenter
source: /dev/scikit-image/src/skimage/future/trainable_segmentation.py:90
Signature
def fit_segmenter(labels, features, clf)Summary
Segmentation using labeled parts of the image and a classifier.
Parameters
labels: ndarray of intsImage of labels. Labels >= 1 correspond to the training set and label 0 to unlabeled pixels to be segmented.
features: ndarrayArray of features, with the first dimension corresponding to the number of features, and the other dimensions correspond to
labels.shape.clf: classifier objectclassifier object, exposing a
fitand apredictmethod as in scikit-learn's API, for example an instance ofRandomForestClassifierorLogisticRegressionclassifier.
Returns
clf: classifier objectclassifier trained on
labels
Raises
: NotFittedError if ``self.clf`` has not been fitted yet (use ``self.fit``).
Aliases
skimage.future.fit_segmenter