@@ -221,8 +221,8 @@ plt.show()
221
221
> > The histogram for the ` data/shapes-02.jpg ` image can be shown with
222
222
> >
223
223
> > ~~~
224
- > > image = skimage.io.imread("data/shapes-02.jpg", as_gray=True)
225
- > > histogram, bin_edges = np.histogram(image , bins=256, range=(0.0, 1.0))
224
+ > > gray_image = skimage.io.imread("data/shapes-02.jpg", as_gray=True)
225
+ > > histogram, bin_edges = np.histogram(gray_image , bins=256, range=(0.0, 1.0))
226
226
> >
227
227
> > fig, ax = plt.subplots()
228
228
> > plt.plot(bin_edges[0:-1], histogram)
@@ -255,7 +255,7 @@ plt.show()
255
255
> > Here are the commands to create and view the binary mask
256
256
> > ~~~
257
257
> > t = 0.5
258
- > > binary_mask = image < t
258
+ > > binary_mask = gray_image > t
259
259
> >
260
260
> > fig, ax = plt.subplots()
261
261
> > plt.imshow(binary_mask, cmap='gray')
@@ -267,6 +267,7 @@ plt.show()
267
267
> >
268
268
> > And here are the commands to apply the mask and view the thresholded image
269
269
> > ~~~
270
+ > > image = skimage.io.imread("data/shapes-02.jpg")
270
271
> > selection = np.zeros_like(image)
271
272
> > selection[binary_mask] = image[binary_mask]
272
273
> >
0 commit comments