Skip to content

Commit e7830c2

Browse files
committed
markdown source builds
Auto-generated via {sandpaper} Source : 333009e Branch : main Author : Toby Hodges <tobyhodges@carpentries.org> Time : 2023-12-08 15:08:20 +0000 Message : Merge pull request #313 from bear-rsg/blurring-suggestions Blurring correction
1 parent 5102ffc commit e7830c2

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

06-blurring.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -349,22 +349,15 @@ For instance, let's look for the intensities of the pixels along the horizontal
349349
line at `Y=150`:
350350

351351
```python
352-
import imageio.v3 as iio
353-
import matplotlib.pyplot as plt
354-
import skimage as ski
355-
356352
# read colonies color image and convert to grayscale
357-
#
358353
image = iio.imread('data/colonies-01.tif')
359354
image_gray = ski.color.rgb2gray(image)
360355

361356
# define the pixels for which we want to view the intensity (profile)
362-
#
363357
xmin, xmax = (0, image_gray.shape[1])
364-
ymin = ymax = 150
358+
Y = ymin = ymax = 150
365359

366360
# view the image indicating the profile pixels position
367-
#
368361
fig, ax = plt.subplots()
369362
ax.imshow(image_gray, cmap='gray')
370363
ax.plot([xmin, xmax], [ymin, ymax], color='red')
@@ -379,17 +372,11 @@ alt='Bacteria colony image with selected pixels marker'
379372
The intensity of those pixels we can see with a simple line plot:
380373

381374
```python
382-
# rename our "Y" variables for better reading
383-
#
384-
Y = ymin = ymax
385-
386375
# select the vector of pixels along "Y"
387-
#
388376
image_gray_pixels_slice = image_gray[Y, :]
389377

390378
# guarantee the intensity values are in the [0:255] range (unsigned integers)
391-
#
392-
image_gray_pixels_slice = img_as_ubyte(image_gray_pixels_slice)
379+
image_gray_pixels_slice = ski.img_as_ubyte(image_gray_pixels_slice)
393380

394381
fig = plt.figure()
395382
ax = fig.add_subplot()
@@ -410,15 +397,11 @@ And now, how does the same set of pixels look in the corresponding *blurred* ima
410397

411398
```python
412399
# first, create a blurred version of (grayscale) image
413-
#
414-
import skimage as ski
415-
416400
image_blur = ski.filters.gaussian(image_gray, sigma=3)
417401

418402
# like before, plot the pixels profile along "Y"
419-
#
420403
image_blur_pixels_slice = image_blur[Y, :]
421-
image_blur_pixels_slice = img_as_ubyte(image_blur_pixels_slice)
404+
image_blur_pixels_slice = ski.img_as_ubyte(image_blur_pixels_slice)
422405

423406
fig = plt.figure()
424407
ax = fig.add_subplot()

md5sum.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"episodes/03-skimage-images.md" "063fa4bb5032702c0196b0d953d94474" "site/built/03-skimage-images.md" "2023-12-08"
99
"episodes/04-drawing.md" "9d78a765f5e9747ffc2aa43a4a5a414d" "site/built/04-drawing.md" "2023-09-05"
1010
"episodes/05-creating-histograms.md" "bdcf983127c242eb995605038598d09f" "site/built/05-creating-histograms.md" "2023-09-18"
11-
"episodes/06-blurring.md" "008ba23277efaed038691178e99c135b" "site/built/06-blurring.md" "2023-09-05"
11+
"episodes/06-blurring.md" "8d109bb4c49f27f54857f6d35b4c6b9a" "site/built/06-blurring.md" "2023-12-08"
1212
"episodes/07-thresholding.md" "7ae5260f90e1df8e20a6226cce8ec6b6" "site/built/07-thresholding.md" "2023-09-05"
1313
"episodes/08-connected-components.md" "59d42797208c5bf569da2fa2e4dd05df" "site/built/08-connected-components.md" "2023-09-09"
1414
"episodes/09-challenges.md" "a3ace24af8f5cb0bda1e9379a688ad4c" "site/built/09-challenges.md" "2023-09-05"

0 commit comments

Comments
 (0)