mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-15 11:25:53 +08:00
Replace use of elephant pic with Chelsea the cat
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 125 KiB |
@@ -25,21 +25,21 @@ Example
|
||||
We can create a Picture object open opening an image file
|
||||
>>> from skimage import novice
|
||||
>>> from skimage import data
|
||||
>>> picture = novice.open(data.data_dir + '/elephant.png')
|
||||
>>> picture = novice.open(data.data_dir + '/chelsea.png')
|
||||
|
||||
Pictures know their format
|
||||
>>> print picture.format
|
||||
png
|
||||
|
||||
... and where they came from
|
||||
>>> print picture.path.endswith('elephant.png')
|
||||
>>> print picture.path.endswith('chelsea.png')
|
||||
True
|
||||
|
||||
... and their size
|
||||
>>> print picture.size
|
||||
(665, 500)
|
||||
(451, 300)
|
||||
>>> print picture.width
|
||||
665
|
||||
451
|
||||
|
||||
Changing `size` resizes the picture.
|
||||
>>> picture.size = (200, 250)
|
||||
|
||||
@@ -185,7 +185,7 @@ class Picture(object):
|
||||
Load an image from a file
|
||||
>>> from skimage import novice
|
||||
>>> from skimage import data
|
||||
>>> picture = novice.open(data.data_dir + '/elephant.png')
|
||||
>>> picture = novice.open(data.data_dir + '/chelsea.png')
|
||||
|
||||
Create a blank 100 pixel wide, 200 pixel tall white image
|
||||
>>> pic = Picture.from_size((100, 200), color=(255, 255, 255))
|
||||
|
||||
@@ -8,7 +8,7 @@ from skimage.novice._novice import array_to_xy_origin, xy_to_array_origin
|
||||
from skimage import data_dir
|
||||
|
||||
|
||||
IMAGE_PATH = os.path.join(data_dir, "elephant.png")
|
||||
IMAGE_PATH = os.path.join(data_dir, "chelsea.png")
|
||||
SMALL_IMAGE_PATH = os.path.join(data_dir, "block.png")
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ def test_pic_info():
|
||||
pic = novice.open(IMAGE_PATH)
|
||||
assert_equal(pic.format, "png")
|
||||
assert_equal(pic.path, os.path.abspath(IMAGE_PATH))
|
||||
assert_equal(pic.size, (665, 500))
|
||||
assert_equal(pic.width, 665)
|
||||
assert_equal(pic.height, 500)
|
||||
assert_equal(pic.size, (451, 300))
|
||||
assert_equal(pic.width, 451)
|
||||
assert_equal(pic.height, 300)
|
||||
assert not pic.modified
|
||||
assert_equal(pic.scale, 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user