Getting started

Getting started scikit-image is an image processing Python package that works with numpy arrays. The package is imported as skimage: >>> import skimage Most functions of skimage are found within submodules: >>> from skimage import data >>> camera = data.camera() A list of submodules and functions is found on the API reference webpage. Within scikit-image, images are represented as NumPy arrays, for example 2-D arrays for grayscale 2-D images >>> type(camera

convex-hull-object

convex_hull_object skimage.morphology.convex_hull_object(image, neighbors=8) [source] Compute the convex hull image of individual objects in a binary image. The convex hull is the set of pixels included in the smallest convex polygon that surround all white pixels in the input image. Parameters: image : (M, N) array Binary input image. neighbors : {4, 8}, int Whether to use 4- or 8-connectivity. Returns: hull : ndarray of bool Binary image with pixels in convex hull set to True. No

windowed-histogram

windowed_histogram skimage.filters.rank.windowed_histogram(image, selem, out=None, mask=None, shift_x=False, shift_y=False, n_bins=None) [source] Normalized sliding window histogram Parameters: image : ndarray Image array (uint8 array). selem : 2-D array The neighborhood expressed as a 2-D array of 1’s and 0’s. out : ndarray If None, a new array will be allocated. mask : ndarray Mask array that defines (>0) area of the image included in the local neighborhood. If None, the complet

lab2xyz

lab2xyz skimage.color.lab2xyz(lab, illuminant='D65', observer='2') [source] CIE-LAB to XYZcolor space conversion. Parameters: lab : array_like The image in lab format, in a 3-D array of shape (.., .., 3). illuminant : {“A”, “D50”, “D55”, “D65”, “D75”, “E”}, optional The name of the illuminant (the function is NOT case sensitive). observer : {“2”, “10”}, optional The aperture angle of the observer. Returns: out : ndarray The image in XYZ format, in a 3-D array of shape (.., .., 3).

binary-erosion

binary_erosion skimage.morphology.binary_erosion(image, selem=None, *args, **kwargs) [source] Return fast binary morphological erosion of an image. This function returns the same result as greyscale erosion but performs faster for binary images. Morphological erosion sets a pixel at (i,j) to the minimum over all pixels in the neighborhood centered at (i,j). Erosion shrinks bright regions and enlarges dark regions. Parameters: image : ndarray Binary input image. selem : ndarray, optional

savebuttons

SaveButtons class skimage.viewer.widgets.SaveButtons(name='Save to:', default_format='png') [source] Bases: skimage.viewer.widgets.core.BaseWidget Buttons to save image to io.stack or to a file. __init__(name='Save to:', default_format='png') [source] save_to_file(filename=None) [source] save_to_stack() [source]

hscharr

hscharr skimage.filters.hscharr(*args, **kwargs) [source] Deprecated function. Use skimage.filters.scharr_h instead. Find the horizontal edges of an image using the Scharr transform. Parameters: image : 2-D array Image to process. mask : 2-D array, optional An optional mask to limit the application to a certain area. Note that pixels surrounding masked regions are also masked to prevent masked regions from affecting the result. Returns: output : 2-D array The absolute Scharr edge map

roberts-positive-diagonal

roberts_positive_diagonal skimage.filters.roberts_positive_diagonal(*args, **kwargs) [source] Deprecated function. Use skimage.filters.roberts_pos_diag instead. Find the cross edges of an image using Roberts’ cross operator. The kernel is applied to the input image to produce separate measurements of the gradient component one orientation. Parameters: image : 2-D array Image to process. mask : 2-D array, optional An optional mask to limit the application to a certain area. Note that pixe

approximate-polygon

approximate_polygon skimage.measure.approximate_polygon(coords, tolerance) [source] Approximate a polygonal chain with the specified tolerance. It is based on the Douglas-Peucker algorithm. Note that the approximated polygon is always within the convex hull of the original polygon. Parameters: coords : (N, 2) array Coordinate array. tolerance : float Maximum distance from original points of polygon to approximated polygonal chain. If tolerance is 0, the original coordinate array is retur

label

label skimage.measure.label(input, neighbors=None, background=None, return_num=False, connectivity=None) [source] Label connected regions of an integer array. Two pixels are connected when they are neighbors and have the same value. In 2D, they can be neighbors either in a 1- or 2-connected sense. The value refers to the maximum number of orthogonal hops to consider a pixel/voxel a neighbor: 1-connectivity 2-connectivity diagonal connection close-up [ ] [ ] [ ] [ ]