mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-06 05:16:40 +08:00
Merge pull request #1597 from library111/DocumentationChanges
Novice module documentation improvements
This commit is contained in:
@@ -98,7 +98,7 @@ To update::
|
||||
Building with bento
|
||||
```````````````````
|
||||
|
||||
``scikit-image`` can also be built using `bento
|
||||
Alternatively, ``scikit-image`` can also be built using `bento
|
||||
<http://cournape.github.io/Bento/>`__. Bento depends on `WAF
|
||||
<https://code.google.com/p/waf/>`__ for compilation.
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@ We can create a Picture object open opening an image file:
|
||||
>>> from skimage import data
|
||||
>>> picture = novice.open(data.data_dir + '/chelsea.png')
|
||||
|
||||
We can display pictures (after running this command, close the window to access the prompt again):
|
||||
|
||||
>>> picture.show()
|
||||
|
||||
Pictures know their format:
|
||||
|
||||
>>> picture.format
|
||||
@@ -44,16 +48,24 @@ True
|
||||
>>> picture.width
|
||||
451
|
||||
|
||||
As a reminder, we can preview the picture with our earlier command:
|
||||
|
||||
>>> picture.show()
|
||||
|
||||
Changing `size` resizes the picture.
|
||||
|
||||
>>> picture.size = (45, 30)
|
||||
|
||||
We can preview the changes we made to the picture with our earlier command:
|
||||
|
||||
>>> picture.show()
|
||||
|
||||
You can iterate over pixels, which have RGB values between 0 and 255,
|
||||
and know their location in the picture.
|
||||
|
||||
>>> for pixel in picture:
|
||||
... if (pixel.red > 128) and (pixel.x < picture.width):
|
||||
... pixel.red /= 2
|
||||
... pixel.red = pixel.red / 2
|
||||
|
||||
Pictures know if they've been modified from the original file
|
||||
|
||||
|
||||
Reference in New Issue
Block a user