Skip to content

Commit

Permalink
differences for PR #312
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 8, 2023
1 parent 973c42d commit f6beea4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions 05-creating-histograms.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ plt.imshow(plant_seedling, cmap="gray")
Again, we use the `iio.imread()` function to load our image.
Then, we convert the grayscale image of integer dtype, with 0-255 range, into
a floating-point one with 0-1 range, by calling the function
`ski.util.img_as_float`.
We will keep working with images in the value range 0 to 1 in this lesson.
`ski.util.img_as_float`. We can also calculate histograms for 8 bit images as we will see in the
subsequent exercises.

We now use the function `np.histogram` to compute the histogram of our image
which, after all, is a NumPy array:
Expand All @@ -90,7 +90,7 @@ the 256 possible values in the grayscale image.

The parameter `range` is the range of values each of the pixels in the image can have.
Here, we pass 0 and 1,
which is the value range of our input image after transforming it to grayscale.
which is the value range of our input image after conversion to floating-point.

The first output of the `np.histogram` function is a one-dimensional NumPy array,
with 256 rows and one column,
Expand Down Expand Up @@ -351,10 +351,10 @@ with the
function call,
and then add a histogram line of the correct colour to the plot with the

`plt.plot(bin_edges[0:-1], histogram, color=c)`
`plt.plot(bin_edges[0:-1], histogram, color=color)`

function call.
Note the use of our loop variables, `channel_id` and `c`.
Note the use of our loop variables, `channel_id` and `color`.

Finally we label our axes and display the histogram, shown here:

Expand Down Expand Up @@ -411,9 +411,9 @@ mask[circle] = 1

# just for display:
# make a copy of the image, call it masked_image, and
# use np.logical_not() and indexing to apply the mask to it
masked_img = wellplate[:]
masked_img[np.logical_not(mask)] = 0
# zero values where mask is False
masked_img = np.array(wellplate)
masked_img[~mask] = 0

# create a new figure and display masked_img, to verify the
# validity of your mask
Expand Down
2 changes: 1 addition & 1 deletion md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"episodes/02-image-basics.md" "30630cc141643700495c2038f2cc9f68" "site/built/02-image-basics.md" "2023-12-08"
"episodes/03-skimage-images.md" "063fa4bb5032702c0196b0d953d94474" "site/built/03-skimage-images.md" "2023-12-08"
"episodes/04-drawing.md" "9d78a765f5e9747ffc2aa43a4a5a414d" "site/built/04-drawing.md" "2023-09-05"
"episodes/05-creating-histograms.md" "bdcf983127c242eb995605038598d09f" "site/built/05-creating-histograms.md" "2023-09-18"
"episodes/05-creating-histograms.md" "59c07192c0a6217e8a42d3e7365025f9" "site/built/05-creating-histograms.md" "2023-12-08"
"episodes/06-blurring.md" "8d109bb4c49f27f54857f6d35b4c6b9a" "site/built/06-blurring.md" "2023-12-08"
"episodes/07-thresholding.md" "7ae5260f90e1df8e20a6226cce8ec6b6" "site/built/07-thresholding.md" "2023-09-05"
"episodes/08-connected-components.md" "59d42797208c5bf569da2fa2e4dd05df" "site/built/08-connected-components.md" "2023-09-09"
Expand Down

0 comments on commit f6beea4

Please sign in to comment.