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 b184a8c commit 2ab67e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions 05-creating-histograms.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ 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.

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 +89,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 +350,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 +410,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 == False] = 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" "37de5915c4fc80cc12af44d98c31321b" "site/built/02-image-basics.md" "2023-11-24"
"episodes/03-skimage-images.md" "eb0da8ebdea3bf84510b22581b790e67" "site/built/03-skimage-images.md" "2023-10-13"
"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" "fad5417d7ba16c6e216fd058f4ae0bd8" "site/built/05-creating-histograms.md" "2023-12-08"
"episodes/06-blurring.md" "008ba23277efaed038691178e99c135b" "site/built/06-blurring.md" "2023-09-05"
"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 2ab67e4

Please sign in to comment.