Documentation¶
-
skgtimage.core.
from_labelled_image
(image, labelled_image, roi=None, manage_bounds=False, thickness=1, verbose=False)[source]¶ Generate both inclusion and photometric graphs from the input image and its labelling (over-segmentation)
Parameters: - image – input image
- labelled_image – input labelling (over-segmentation)
- roi – region of interest considered from computing graphs (regions lying outside are ignored)
- manage_bounds – if a thin enveloppe is added at image or roi boundaries
- thickness – internal boundary thickness to be considered for computing enveloppe label
- verbose – if True, details of the procedure are printed
Returns: built inclusion and photometric graphs
-
skgtimage.utils.
recognize
(image, label, t_desc, p_desc, mc=False, roi=None, min_size=None, bg=False, bound_thickness=0, rag=None, merge=None, verbose=False)[source]¶ Compute and return identified regions, specified in qualitative descriptions (t_desc, p_desc), from the provided over-segmentation (label) of the image (image)
Parameters: - image – input image (numpy array), can be 2D, 3D, grayscale, color
- label – input oversegmentation (numpy array)
- t_desc – description of inclusion relationships (string)
- p_desc – description of photometric relationships (string)
- mc – specifies if image is multi-component (True - color in our case) or not (False - grayscale).
- roi – region of interest (numpy array), corresponding to non zeros.
- min_size – minimum size (in pixels) of considered regions. Regions smaller than min_size are removed.
- bg – specifies whether background must be removed
- bound_thickness – thickness of the enveloppe surrounding the roi (if roi is not none)
- rag – if not None, a preliminary merging of photometrically similar neighboring regions is performed. The parameter specifies the similarity threshold (threshold the in merge_hierarchical function of scikit-image)
- merge – if not None, a preliminary merging of photometrically similar regions is performed (not necessarily neighboring regions). The parameter specifies the number of finally expected regions.
- verbose – if True, details of the procedure are printed
Returns: a mapping “id - regions” (python mapping type - dictionnary) and the object in charge of managing the entire procedure. “id” are names specified in the description (t_desc, p_desc), regions are “binary images” (numpy array). The object embedded many intermediate informations (e.g. graphs, isomorphisms,...)
-
skgtimage.utils.
meanshift
(image, bandwidth, roi=None, mc=False, sigma=None, rgb_convert=False, verbose=False)[source]¶ Apply meanshif to input image (within region of interest)
Parameters: - image – input image
- bandwidth – bandwidth parameter considered in scikit-learn MeanShift
- roi – region of interest
- mc – whether image is multi-component or not (color in our case)
- verbose –
- sigma – preliminary gaussian filtering (parameter of scikit-image filters.gaussian)
- rgb_convert – if True and mc True, RGB image is converted HSV space
Returns: labelled image (numpy array), where each label corresponds to a specific value
-
skgtimage.utils.
quickshift
(image, ratio, mc=False, roi=None, verbose=False)[source]¶ Apply quickshift segmentation to input image (within region of interest)
Parameters: - image – input image
- ratio – ratio parameter considered in scikit-image quickshift
- mc – whether image is multi-component or not (color in our case)
- verbose –
Returns: labelled image (numpy array), where each label corresponds to a specific value
-
skgtimage.io.
save_recognizer_details
(recognizer, save_dir, full=False, slices=[])[source]¶ Save details of the recognition procedure: regions, graphs and statistics (mean intensities) related to each step
Parameters: - recognizer – object embedding all details, and returned by recognize
- save_dir – directory within which all details are saved
- full – if True, all regions, and mean intensities, related to initial graphs are saved (time consuming if many nodes)
- slices – list of slice indices to be exported in .png image files, in case of 3D images
Returns: None