Image data types and what they mean

Image data types and what they mean In skimage, images are simply numpy arrays, which support a variety of data types [1], i.e. “dtypes”. To avoid distorting image intensities (see Rescaling intensity values), we assume that images use the following dtype ranges: Data type Range uint8 0 to 255 uint16 0 to 65535 uint32 0 to 232 float -1 to 1 or 0 to 1 int8 -128 to 127 int16 -32768 to 32767 int32 -231 to 231 - 1 Note that float images should be restricted to the range -1 to 1 even though the da

collectionviewer

CollectionViewer class skimage.viewer.CollectionViewer(image_collection, update_on='move', **kwargs) [source] Bases: skimage.viewer.viewers.core.ImageViewer Viewer for displaying image collections. Select the displayed frame of the image collection using the slider or with the following keyboard shortcuts: left/right arrows Previous/next image in collection. number keys, 0–9 0% to 90% of collection. For example, “5” goes to the image in the middle (i.e. 50%) of the collection. home/end keys

affinetransform

AffineTransform class skimage.transform.AffineTransform(matrix=None, scale=None, rotation=None, shear=None, translation=None) [source] Bases: skimage.transform._geometric.ProjectiveTransform 2D affine transformation of the form: ..:math: X = a0*x + a1*y + a2 = = sx*x*cos(rotation) - sy*y*sin(rotation + shear) + a2 Y = b0*x + b1*y + b2 = = sx*x*sin(rotation) + sy*y*cos(rotation + shear) + b2 where sx and sy are zoom factors in the x and y directions, and the homogeneous transformation matrix

median

median skimage.filters.rank.median(image, selem, out=None, mask=None, shift_x=False, shift_y=False) [source] Return local median of an image. Parameters: image : 2-D array (uint8, uint16) Input image. selem : 2-D array The neighborhood expressed as a 2-D array of 1’s and 0’s. out : 2-D array (same dtype as input) If None, a new array is allocated. mask : ndarray Mask array that defines (>0) area of the image included in the local neighborhood. If None, the complete image is used (

relabel-sequential

relabel_sequential skimage.segmentation.relabel_sequential(label_field, offset=1) [source] Relabel arbitrary labels to {offset, ... offset + number_of_labels}. This function also returns the forward map (mapping the original labels to the reduced labels) and the inverse map (mapping the reduced labels back to the original ones). Parameters: label_field : numpy array of int, arbitrary shape An array of labels. offset : int, optional The return labels will start at offset, which should be

circle-perimeter-aa

circle_perimeter_aa skimage.draw.circle_perimeter_aa() Generate anti-aliased circle perimeter coordinates. Parameters: cy, cx : int Centre coordinate of circle. radius: int Radius of circle. shape : tuple, optional Image shape which is used to determine the maximum extent of output pixel coordinates. This is useful for circles which exceed the image size. By default the full extent of the circle are used. Returns: rr, cc, val : (N,) ndarray (int, int, float) Indices of pixels (rr,

roberts-pos-diag

roberts_pos_diag skimage.filters.roberts_pos_diag(image, mask=None) [source] 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 pixels surrounding masked regions are also masked to prevent masked regions from affecti

draw-rag

draw_rag skimage.future.graph.draw_rag(labels, rag, img, border_color=None, node_color='#ffff00', edge_color='#00ff00', colormap=None, thresh=inf, desaturate=False, in_place=True) [source] Draw a Region Adjacency Graph on an image. Given a labelled image and its corresponding RAG, draw the nodes and edges of the RAG on the image with the specified colors. Nodes are marked by the centroids of the corresponding regions. Parameters: labels : ndarray, shape (M, N) The labelled image. rag : RA

prewitt-v

prewitt_v skimage.filters.prewitt_v(image, mask=None) [source] Find the vertical edges of an image using the Prewitt 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 Prewitt edge map. Notes We use the following kernel: 1 0 -1 1 0 -1 1

hog

hog skimage.feature.hog(image, orientations=9, pixels_per_cell=(8, 8), cells_per_block=(3, 3), visualise=False, transform_sqrt=False, feature_vector=True, normalise=None) [source] Extract Histogram of Oriented Gradients (HOG) for a given image. Compute a Histogram of Oriented Gradients (HOG) by (optional) global image normalisation computing the gradient image in x and y computing gradient histograms normalising across blocks flattening into a feature vector Parameters: image : (M, N) ndar