Skip to content

Commit 8aede96

Browse files
authored
Update 05-creating-histograms.md
convert image to float in Using a mask for a histogram exercise
1 parent e171df5 commit 8aede96

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

episodes/05-creating-histograms.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ it to the `np.histogram` function.
201201
# read the image as grayscale from the outset
202202
plant_seedling = iio.imread(uri="data/plant-seedling.jpg", mode="L")
203203

204+
# convert the image to float dtype with a value range from 0 to 1
205+
plant_seedling = ski.util.img_as_float(plant_seedling)
206+
204207
# display the image
205208
fig, ax = plt.subplots()
206209
plt.imshow(plant_seedling, cmap="gray")

0 commit comments

Comments
 (0)