You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Python libraries for learning and performing image processing.
88
-
*
89
-
"""
85
+
"""Python libraries for learning and performing image processing."""
86
+
90
87
import numpy as np
91
88
import matplotlib.pyplot as plt
92
89
import ipympl
@@ -254,9 +251,9 @@ Using array slicing, we can then address and assign a new value to that position
254
251
```python
255
252
zero = iio.imread(uri="data/eight.tif")
256
253
zero[2,1]=1.0
257
-
"""
258
-
The follwing line of code creates a new figure for imshow to use in displaying our output. Without it, plt.imshow() would overwrite our previous image in the cell above
259
-
"""
254
+
255
+
#The following line of code creates a new figure for imshow to use in displaying our output.
256
+
# Without it, plt.imshow() would overwrite our previous image in the cell above
260
257
fig, ax = plt.subplots()
261
258
plt.imshow(zero)
262
259
print(zero)
@@ -311,7 +308,6 @@ can be especially helpful in cases where you need to transpose image viewer data
311
308
provided in *x,y* format to *y,x* format. Thus, we will use *cx* and *ry* where appropriate
@@ -276,14 +264,10 @@ We will start by reading the image and displaying it.
276
264
277
265
When loading an image with `imageio`, in certain situations the image is stored in a read-only array. If you attempt to manipulate the pixels in a read-only array, you will receive an error message `ValueError: assignment destination is read-only`. In order to make the image array writeable, we can create a copy with `image = np.array(image)` before manipulating the pixel values.
@@ -390,7 +367,6 @@ pass `plugin="pillow"`. If the backend is not specified explicitly, `iio.imread(
390
367
391
368
When loading an image with `mode="L"`, the pixel values are stored as 8-bit integer numbers that can take values in the range 0-255. However, pixel values may also be stored with other types and ranges. For example, some scikit-image functions return the pixel values as floating point numbers in the range 0-1. The type and range of the pixel values are important for the colorscale when plotting, and for masking and thresholding images as we will see later in the lesson. If you are unsure about the type of the pixel values, you can inspect it with `print(image.dtype)`. For the example above, you should find that it is `dtype('uint8')` indicating 8-bit integer numbers.
0 commit comments