File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ plt.imshow(image)
336
336
# convert to grayscale and display
337
337
gray_image = skimage.color.rgb2gray(image)
338
338
fig, ax = plt.subplots()
339
- plt.imshow(gray_image)
339
+ plt.imshow(gray_image, cmap='gray' )
340
340
~~~
341
341
{: .language-python}
342
342
@@ -355,7 +355,7 @@ image = skimage.io.imread('data/chair.jpg', as_gray=True)
355
355
356
356
# display grayscale image
357
357
fig, ax = plt.subplots()
358
- plt.imshow(image)
358
+ plt.imshow(image, cmap='gray' )
359
359
~~~
360
360
{: .language-python}
361
361
@@ -390,18 +390,18 @@ plt.imshow(image)
390
390
> > ~~~
391
391
> > {: .language-python }
392
392
> >
393
- > > Then, change all high intensity pixel values to 64 :
393
+ > > Then, change all high intensity pixel values to > 0.78 to 0.25 :
394
394
> >
395
395
> > ~~~
396
- > > image[image > 200 ] = 64
396
+ > > image[image > 0.78 ] = 0.25
397
397
> > ~~~
398
398
> > {: .language-python }
399
399
> >
400
400
> > Finally, display modified image:
401
401
> >
402
402
> > ~~~
403
403
> > fig, ax = plt.subplots()
404
- > > plt.imshow(image)
404
+ > > plt.imshow(image, cmap='gray' )
405
405
> > ~~~
406
406
> > {: .language-python}
407
407
> {: .solution}
You can’t perform that action at this time.
0 commit comments