neulab/docprompting-conala huggingface dataset:
skimage.transform.pyramid_gaussian(image, max_layer=-1, downscale=2, sigma=None, order=1, mode='reflect', cval=0, multichannel=False, preserve_range=False) [source]
 
Yield images of the Gaussian pyramid formed by the input image. Recursively applies the pyramid_reduce function to the image, and yields the downscaled images. Note that the first image of the pyramid will be the original, unscaled image. The total number of images is max_layer + 1. In case all layers are computed, the last image is either a one-pixel image or the image where the reduction does not change its shape.  Parameters 
 
imagendarray 

Input image.  
max_layerint, optional 

Number of layers for the pyramid. 0th layer is the original image. Default is -1 which builds all possible layers.  
downscalefloat, optional 

Downscale factor.  
sigmafloat, optional 

Sigma for Gaussian filter. Default is 2 * downscale / 6.0 which corresponds to a filter mask twice the size of the scale factor that covers more than 99% of the Gaussian distribution.  
orderint, optional 

Order of splines used in interpolation of downsampling. See skimage.transform.warp for detail.  
mode{‘reflect’, ‘constant’, ‘edge’, ‘symmetric’, ‘wrap’}, optional 

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to ‘constant’.  
cvalfloat, optional 

Value to fill past edges of input if mode is ‘constant’.  
multichannelbool, optional 

Whether the last axis of the image is to be interpreted as multiple channels or another spatial dimension.  
preserve_rangebool, optional 

Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float. Also see https://scikit-image.org/docs/dev/user_guide/data_types.html    Returns 
 
pyramidgenerator 

Generator yielding pyramid layers as float images.     References  
1  
http://persci.mit.edu/pub_pdfs/pyramid83.pdf
skimage.transform.pyramid_laplacian(image, max_layer=-1, downscale=2, sigma=None, order=1, mode='reflect', cval=0, multichannel=False, preserve_range=False) [source]
 
Yield images of the laplacian pyramid formed by the input image. Each layer contains the difference between the downsampled and the downsampled, smoothed image: layer = resize(prev_layer) - smooth(resize(prev_layer))
 Note that the first image of the pyramid will be the difference between the original, unscaled image and its smoothed version. The total number of images is max_layer + 1. In case all layers are computed, the last image is either a one-pixel image or the image where the reduction does not change its shape.  Parameters 
 
imagendarray 

Input image.  
max_layerint, optional 

Number of layers for the pyramid. 0th layer is the original image. Default is -1 which builds all possible layers.  
downscalefloat, optional 

Downscale factor.  
sigmafloat, optional 

Sigma for Gaussian filter. Default is 2 * downscale / 6.0 which corresponds to a filter mask twice the size of the scale factor that covers more than 99% of the Gaussian distribution.  
orderint, optional 

Order of splines used in interpolation of downsampling. See skimage.transform.warp for detail.  
mode{‘reflect’, ‘constant’, ‘edge’, ‘symmetric’, ‘wrap’}, optional 

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to ‘constant’.  
cvalfloat, optional 

Value to fill past edges of input if mode is ‘constant’.  
multichannelbool, optional 

Whether the last axis of the image is to be interpreted as multiple channels or another spatial dimension.  
preserve_rangebool, optional 

Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float. Also see https://scikit-image.org/docs/dev/user_guide/data_types.html    Returns 
 
pyramidgenerator 

Generator yielding pyramid layers as float images.     References  
1  
http://persci.mit.edu/pub_pdfs/pyramid83.pdf  
2  
http://sepwww.stanford.edu/data/media/public/sep/morgan/texturematch/paper_html/node3.html
skimage.transform.pyramid_reduce(image, downscale=2, sigma=None, order=1, mode='reflect', cval=0, multichannel=False, preserve_range=False) [source]
 
Smooth and then downsample image.  Parameters 
 
imagendarray 

Input image.  
downscalefloat, optional 

Downscale factor.  
sigmafloat, optional 

Sigma for Gaussian filter. Default is 2 * downscale / 6.0 which corresponds to a filter mask twice the size of the scale factor that covers more than 99% of the Gaussian distribution.  
orderint, optional 

Order of splines used in interpolation of downsampling. See skimage.transform.warp for detail.  
mode{‘reflect’, ‘constant’, ‘edge’, ‘symmetric’, ‘wrap’}, optional 

The mode parameter determines how the array borders are handled, where cval is the value when mode is equal to ‘constant’.  
cvalfloat, optional 

Value to fill past edges of input if mode is ‘constant’.  
multichannelbool, optional 

Whether the last axis of the image is to be interpreted as multiple channels or another spatial dimension.  
preserve_rangebool, optional 

Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float. Also see https://scikit-image.org/docs/dev/user_guide/data_types.html    Returns 
 
outarray 

Smoothed and downsampled float image.     References  
1  
http://persci.mit.edu/pub_pdfs/pyramid83.pdf
skimage.transform.radon(image, theta=None, circle=True, *, preserve_range=False) [source]
 
Calculates the radon transform of an image given specified projection angles.  Parameters 
 
imagearray_like 

Input image. The rotation axis will be located in the pixel with indices (image.shape[0] // 2, image.shape[1] // 2).  
thetaarray_like, optional 

Projection angles (in degrees). If None, the value is set to np.arange(180).  
circleboolean, optional 

Assume image is zero outside the inscribed circle, making the width of each projection (the first dimension of the sinogram) equal to min(image.shape).  
preserve_rangebool, optional 

Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float. Also see https://scikit-image.org/docs/dev/user_guide/data_types.html    Returns 
 
radon_imagendarray 

Radon transform (sinogram). The tomography rotation axis will lie at the pixel index radon_image.shape[0] // 2 along the 0th dimension of radon_image.     Notes Based on code of Justin K. Romberg (https://www.clear.rice.edu/elec431/projects96/DSP/bpanalysis.html) References  
1  
AC Kak, M Slaney, “Principles of Computerized Tomographic Imaging”, IEEE Press 1988.  
2  
B.R. Ramesh, N. Srinivasa, K. Rajgopal, “An Algorithm for Computing the Discrete Radon Transform With Some Applications”, Proceedings of the Fourth IEEE Region 10 International Conference, TENCON ‘89, 1989
skimage.transform.rescale(image, scale, order=None, mode='reflect', cval=0, clip=True, preserve_range=False, multichannel=False, anti_aliasing=None, anti_aliasing_sigma=None) [source]
 
Scale image by a certain factor. Performs interpolation to up-scale or down-scale N-dimensional images. Note that anti-aliasing should be enabled when down-sizing images to avoid aliasing artifacts. For down-sampling with an integer factor also see skimage.transform.downscale_local_mean.  Parameters 
 
imagendarray 

Input image.  
scale{float, tuple of floats} 

Scale factors. Separate scale factors can be defined as (rows, cols[, …][, dim]).    Returns 
 
scaledndarray 

Scaled version of the input.    Other Parameters 
 
orderint, optional 

The order of the spline interpolation, default is 0 if image.dtype is bool and 1 otherwise. The order has to be in the range 0-5. See skimage.transform.warp for detail.  
mode{‘constant’, ‘edge’, ‘symmetric’, ‘reflect’, ‘wrap’}, optional 

Points outside the boundaries of the input are filled according to the given mode. Modes match the behaviour of numpy.pad.  
cvalfloat, optional 

Used in conjunction with mode ‘constant’, the value outside the image boundaries.  
clipbool, optional 

Whether to clip the output to the range of values of the input image. This is enabled by default, since higher order interpolation may produce values outside the given input range.  
preserve_rangebool, optional 

Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float. Also see https://scikit-image.org/docs/dev/user_guide/data_types.html  
multichannelbool, optional 

Whether the last axis of the image is to be interpreted as multiple channels or another spatial dimension.  
anti_aliasingbool, optional 

Whether to apply a Gaussian filter to smooth the image prior to down-scaling. It is crucial to filter when down-sampling the image to avoid aliasing artifacts. If input image data type is bool, no anti-aliasing is applied.  
anti_aliasing_sigma{float, tuple of floats}, optional 

Standard deviation for Gaussian filtering to avoid aliasing artifacts. By default, this value is chosen as (s - 1) / 2 where s is the down-scaling factor.     Notes Modes ‘reflect’ and ‘symmetric’ are similar, but differ in whether the edge pixels are duplicated during the reflection. As an example, if an array has values [0, 1, 2] and was padded to the right by four values using symmetric, the result would be [0, 1, 2, 2, 1, 0, 0], while for reflect it would be [0, 1, 2, 1, 0, 1, 2]. Examples >>> from skimage import data
>>> from skimage.transform import rescale
>>> image = data.camera()
>>> rescale(image, 0.1).shape
(51, 51)
>>> rescale(image, 0.5).shape
(256, 256)
skimage.transform.resize(image, output_shape, order=None, mode='reflect', cval=0, clip=True, preserve_range=False, anti_aliasing=None, anti_aliasing_sigma=None) [source]
 
Resize image to match a certain size. Performs interpolation to up-size or down-size N-dimensional images. Note that anti-aliasing should be enabled when down-sizing images to avoid aliasing artifacts. For down-sampling with an integer factor also see skimage.transform.downscale_local_mean.  Parameters 
 
imagendarray 

Input image.  
output_shapetuple or ndarray 

Size of the generated output image (rows, cols[, …][, dim]). If dim is not provided, the number of channels is preserved. In case the number of input channels does not equal the number of output channels a n-dimensional interpolation is applied.    Returns 
 
resizedndarray 

Resized version of the input.    Other Parameters 
 
orderint, optional 

The order of the spline interpolation, default is 0 if image.dtype is bool and 1 otherwise. The order has to be in the range 0-5. See skimage.transform.warp for detail.  
mode{‘constant’, ‘edge’, ‘symmetric’, ‘reflect’, ‘wrap’}, optional 

Points outside the boundaries of the input are filled according to the given mode. Modes match the behaviour of numpy.pad.  
cvalfloat, optional 

Used in conjunction with mode ‘constant’, the value outside the image boundaries.  
clipbool, optional 

Whether to clip the output to the range of values of the input image. This is enabled by default, since higher order interpolation may produce values outside the given input range.  
preserve_rangebool, optional 

Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float. Also see https://scikit-image.org/docs/dev/user_guide/data_types.html  
anti_aliasingbool, optional 

Whether to apply a Gaussian filter to smooth the image prior to down-scaling. It is crucial to filter when down-sampling the image to avoid aliasing artifacts. If input image data type is bool, no anti-aliasing is applied.  
anti_aliasing_sigma{float, tuple of floats}, optional 

Standard deviation for Gaussian filtering to avoid aliasing artifacts. By default, this value is chosen as (s - 1) / 2 where s is the down-scaling factor, where s > 1. For the up-size case, s < 1, no anti-aliasing is performed prior to rescaling.     Notes Modes ‘reflect’ and ‘symmetric’ are similar, but differ in whether the edge pixels are duplicated during the reflection. As an example, if an array has values [0, 1, 2] and was padded to the right by four values using symmetric, the result would be [0, 1, 2, 2, 1, 0, 0], while for reflect it would be [0, 1, 2, 1, 0, 1, 2]. Examples >>> from skimage import data
>>> from skimage.transform import resize
>>> image = data.camera()
>>> resize(image, (100, 100)).shape
(100, 100)
skimage.transform.rotate(image, angle, resize=False, center=None, order=None, mode='constant', cval=0, clip=True, preserve_range=False) [source]
 
Rotate image by a certain angle around its center.  Parameters 
 
imagendarray 

Input image.  
anglefloat 

Rotation angle in degrees in counter-clockwise direction.  
resizebool, optional 

Determine whether the shape of the output image will be automatically calculated, so the complete rotated image exactly fits. Default is False.  
centeriterable of length 2 

The rotation center. If center=None, the image is rotated around its center, i.e. center=(cols / 2 - 0.5, rows / 2 - 0.5). Please note that this parameter is (cols, rows), contrary to normal skimage ordering.    Returns 
 
rotatedndarray 

Rotated version of the input.    Other Parameters 
 
orderint, optional 

The order of the spline interpolation, default is 0 if image.dtype is bool and 1 otherwise. The order has to be in the range 0-5. See skimage.transform.warp for detail.  
mode{‘constant’, ‘edge’, ‘symmetric’, ‘reflect’, ‘wrap’}, optional 

Points outside the boundaries of the input are filled according to the given mode. Modes match the behaviour of numpy.pad.  
cvalfloat, optional 

Used in conjunction with mode ‘constant’, the value outside the image boundaries.  
clipbool, optional 

Whether to clip the output to the range of values of the input image. This is enabled by default, since higher order interpolation may produce values outside the given input range.  
preserve_rangebool, optional 

Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float. Also see https://scikit-image.org/docs/dev/user_guide/data_types.html     Notes Modes ‘reflect’ and ‘symmetric’ are similar, but differ in whether the edge pixels are duplicated during the reflection. As an example, if an array has values [0, 1, 2] and was padded to the right by four values using symmetric, the result would be [0, 1, 2, 2, 1, 0, 0], while for reflect it would be [0, 1, 2, 1, 0, 1, 2]. Examples >>> from skimage import data
>>> from skimage.transform import rotate
>>> image = data.camera()
>>> rotate(image, 2).shape
(512, 512)
>>> rotate(image, 2, resize=True).shape
(530, 530)
>>> rotate(image, 90, resize=True).shape
(512, 512)
class skimage.transform.SimilarityTransform(matrix=None, scale=None, rotation=None, translation=None) [source]
 
Bases: skimage.transform._geometric.EuclideanTransform 2D similarity transformation. Has the following form: X = a0 * x - b0 * y + a1 =
  = s * x * cos(rotation) - s * y * sin(rotation) + a1

Y = b0 * x + a0 * y + b1 =
  = s * x * sin(rotation) + s * y * cos(rotation) + b1
 where s is a scale factor and the homogeneous transformation matrix is: [[a0  b0  a1]
 [b0  a0  b1]
 [0   0    1]]
 The similarity transformation extends the Euclidean transformation with a single scaling factor in addition to the rotation and translation parameters.  Parameters 
 
matrix(3, 3) array, optional 

Homogeneous transformation matrix.  
scalefloat, optional 

Scale factor.  
rotationfloat, optional 

Rotation angle in counter-clockwise direction as radians.  
translation(tx, ty) as array, list or tuple, optional 

x, y translation parameters.    Attributes 
 
params(3, 3) array 

Homogeneous transformation matrix.      
__init__(matrix=None, scale=None, rotation=None, translation=None) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
estimate(src, dst) [source]
 
Estimate the transformation from a set of corresponding points. You can determine the over-, well- and under-determined parameters with the total least-squares method. Number of source and destination coordinates must match.  Parameters 
 
src(N, 2) array 

Source coordinates.  
dst(N, 2) array 

Destination coordinates.    Returns 
 
successbool 

True, if model estimation succeeds.     
  
property scale
__init__(matrix=None, scale=None, rotation=None, translation=None) [source]
 
Initialize self. See help(type(self)) for accurate signature.
skimage.transform.swirl(image, center=None, strength=1, radius=100, rotation=0, output_shape=None, order=None, mode='reflect', cval=0, clip=True, preserve_range=False) [source]
 
Perform a swirl transformation.  Parameters 
 
imagendarray 

Input image.  
center(column, row) tuple or (2,) ndarray, optional 

Center coordinate of transformation.  
strengthfloat, optional 

The amount of swirling applied.  
radiusfloat, optional 

The extent of the swirl in pixels. The effect dies out rapidly beyond radius.  
rotationfloat, optional 

Additional rotation applied to the image.    Returns 
 
swirledndarray 

Swirled version of the input.    Other Parameters 
 
output_shapetuple (rows, cols), optional 

Shape of the output image generated. By default the shape of the input image is preserved.  
orderint, optional 

The order of the spline interpolation, default is 0 if image.dtype is bool and 1 otherwise. The order has to be in the range 0-5. See skimage.transform.warp for detail.  
mode{‘constant’, ‘edge’, ‘symmetric’, ‘reflect’, ‘wrap’}, optional 

Points outside the boundaries of the input are filled according to the given mode, with ‘constant’ used as the default. Modes match the behaviour of numpy.pad.  
cvalfloat, optional 

Used in conjunction with mode ‘constant’, the value outside the image boundaries.  
clipbool, optional 

Whether to clip the output to the range of values of the input image. This is enabled by default, since higher order interpolation may produce values outside the given input range.  
preserve_rangebool, optional 

Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float. Also see https://scikit-image.org/docs/dev/user_guide/data_types.html
skimage.transform.warp_coords(coord_map, shape, dtype=<class 'numpy.float64'>) [source]
 
Build the source coordinates for the output of a 2-D image warp.  Parameters 
 
coord_mapcallable like GeometricTransform.inverse 

Return input coordinates for given output coordinates. Coordinates are in the shape (P, 2), where P is the number of coordinates and each element is a (row, col) pair.  
shapetuple 

Shape of output image (rows, cols[, bands]).  
dtypenp.dtype or string 

dtype for return value (sane choices: float32 or float64).    Returns 
 
coords(ndim, rows, cols[, bands]) array of dtype dtype 

Coordinates for scipy.ndimage.map_coordinates, that will yield an image of shape (orows, ocols, bands) by drawing from source points according to the coord_transform_fn.     Notes This is a lower-level routine that produces the source coordinates for 2-D images used by warp(). It is provided separately from warp to give additional flexibility to users who would like, for example, to re-use a particular coordinate mapping, to use specific dtypes at various points along the the image-warping process, or to implement different post-processing logic than warp performs after the call to ndi.map_coordinates. Examples Produce a coordinate map that shifts an image up and to the right: >>> from skimage import data
>>> from scipy.ndimage import map_coordinates
>>>
>>> def shift_up10_left20(xy):
...     return xy - np.array([-20, 10])[None, :]
>>>
>>> image = data.astronaut().astype(np.float32)
>>> coords = warp_coords(shift_up10_left20, image.shape)
>>> warped_image = map_coordinates(image, coords)
skimage.transform.warp_polar(image, center=None, *, radius=None, output_shape=None, scaling='linear', multichannel=False, **kwargs) [source]
 
Remap image to polar or log-polar coordinates space.  Parameters 
 
imagendarray 

Input image. Only 2-D arrays are accepted by default. If multichannel=True, 3-D arrays are accepted and the last axis is interpreted as multiple channels.  
centertuple (row, col), optional 

Point in image that represents the center of the transformation (i.e., the origin in cartesian space). Values can be of type float. If no value is given, the center is assumed to be the center point of the image.  
radiusfloat, optional 

Radius of the circle that bounds the area to be transformed.  
output_shapetuple (row, col), optional 

scaling{‘linear’, ‘log’}, optional 

Specify whether the image warp is polar or log-polar. Defaults to ‘linear’.  
multichannelbool, optional 

Whether the image is a 3-D array in which the third axis is to be interpreted as multiple channels. If set to False (default), only 2-D arrays are accepted.  
**kwargskeyword arguments 

Passed to transform.warp.    Returns 
 
warpedndarray 

The polar or log-polar warped image.     Examples Perform a basic polar warp on a grayscale image: >>> from skimage import data
>>> from skimage.transform import warp_polar
>>> image = data.checkerboard()
>>> warped = warp_polar(image)
 Perform a log-polar warp on a grayscale image: >>> warped = warp_polar(image, scaling='log')
 Perform a log-polar warp on a grayscale image while specifying center, radius, and output shape: >>> warped = warp_polar(image, (100,100), radius=100,
...                     output_shape=image.shape, scaling='log')
 Perform a log-polar warp on a color image: >>> image = data.astronaut()
>>> warped = warp_polar(image, scaling='log', multichannel=True)