Skip to content

Commit 86e3dd5

Browse files
committed
add cmap and change 8 bit to 0-1 for sudoku.png
1 parent a084ab7 commit 86e3dd5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

episodes/03-skimage-images.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ plt.imshow(image)
336336
# convert to grayscale and display
337337
gray_image = skimage.color.rgb2gray(image)
338338
fig, ax = plt.subplots()
339-
plt.imshow(gray_image)
339+
plt.imshow(gray_image, cmap='gray')
340340
~~~
341341
{: .language-python}
342342
@@ -355,7 +355,7 @@ image = skimage.io.imread('data/chair.jpg', as_gray=True)
355355

356356
# display grayscale image
357357
fig, ax = plt.subplots()
358-
plt.imshow(image)
358+
plt.imshow(image, cmap='gray')
359359
~~~
360360
{: .language-python}
361361
@@ -390,18 +390,18 @@ plt.imshow(image)
390390
> > ~~~
391391
> > {: .language-python }
392392
> >
393-
> > Then, change all high intensity pixel values to 64:
393+
> > Then, change all high intensity pixel values to > 0.78 to 0.25:
394394
> >
395395
> > ~~~
396-
> > image[image > 200] = 64
396+
> > image[image > 0.78] = 0.25
397397
> > ~~~
398398
> > {: .language-python }
399399
> >
400400
> > Finally, display modified image:
401401
> >
402402
> > ~~~
403403
> > fig, ax = plt.subplots()
404-
> > plt.imshow(image)
404+
> > plt.imshow(image, cmap='gray')
405405
> > ~~~
406406
> > {: .language-python}
407407
> {: .solution}

0 commit comments

Comments
 (0)