mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-01 03:43:06 +08:00
Add examples to doc strings of resize, rotate and rescale functions
This commit is contained in:
@@ -34,6 +34,14 @@ def resize(image, output_shape, order=1, mode='constant', cval=0.):
|
||||
Used in conjunction with mode 'constant', the value outside
|
||||
the image boundaries.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> from skimage import data
|
||||
>>> from skimage.transform import resize
|
||||
>>> image = data.camera()
|
||||
>>> resize(image, (100, 100)).shape
|
||||
(100, 100)
|
||||
|
||||
"""
|
||||
|
||||
rows, cols = output_shape[0], output_shape[1]
|
||||
@@ -105,6 +113,16 @@ def rescale(image, scale, order=1, mode='constant', cval=0.):
|
||||
Used in conjunction with mode 'constant', the value outside
|
||||
the image boundaries.
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> from skimage import data
|
||||
>>> from skimage.transform import resize
|
||||
>>> image = data.camera()
|
||||
>>> rescale(image, 0.1).shape
|
||||
(51, 51)
|
||||
>>> rescale(image, 0.5).shape
|
||||
(256, 256)
|
||||
|
||||
"""
|
||||
|
||||
try:
|
||||
@@ -151,6 +169,18 @@ def rotate(image, angle, resize=False, order=1, mode='constant', cval=0.):
|
||||
Used in conjunction with mode 'constant', the value outside
|
||||
the image boundaries.
|
||||
|
||||
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)
|
||||
|
||||
"""
|
||||
|
||||
rows, cols = image.shape[0], image.shape[1]
|
||||
|
||||
Reference in New Issue
Block a user