You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The shape of the function is described by a mean value μ, and a variance value σ². The mean determines the central point of the bell curve on the x axis, and the variance describes the spread of the curve.
128
+
The shape of the function is described by a mean value μ, and a variance value σ². The mean determines the central point of the bell curve on the X axis, and the variance describes the spread of the curve.
129
129
130
130
In fact, when using Gaussian functions in Gaussian blurring, we use a 2D Gaussian function to account for X and Y dimensions, but the same rules apply. The mean μ is always 0, and represents the middle of the 2D kernel. Increasing values of σ² in either dimension increases the amount of blurring in that dimension.
131
131
@@ -156,7 +156,7 @@ while a smaller sigma value results in a more pronounced peak.
156
156
The mathematics involved in the Gaussian blur filter are not quite that simple,
157
157
but this explanation gives you the basic idea.
158
158
159
-
To illustrate the blur process,
159
+
To illustrate the blurring process,
160
160
consider the blue channel colour values from the seven-by-seven region
161
161
of the cat image above:
162
162
@@ -256,13 +256,12 @@ scikit-image has built-in functions to perform blurring for us, so we do not hav
256
256
perform all of these mathematical operations ourselves. Let's work through
257
257
an example of blurring an image with the scikit-image Gaussian blur function.
258
258
259
-
First, import the packages needed for this episode
259
+
First, import the packages needed for this episode:
260
260
261
261
```python
262
262
import matplotlib.pyplot as plt
263
263
import ipympl
264
264
import imageio.v3 as iio
265
-
import skimage
266
265
import skimage.filters
267
266
%matplotlib widget
268
267
```
@@ -334,7 +333,7 @@ plt.imshow(blurred)
334
333
335
334
Somebody said once "an image is worth a thousand words".
336
335
What is actually happening to the image pixels when we apply blurring may be
337
-
difficult to grasp, let's now visualise the effects of blurring from a different
336
+
difficult to grasp. Let's now visualise the effects of blurring from a different
338
337
perspective.
339
338
340
339
Let's use the petri-dish image from previous episodes:
@@ -343,31 +342,31 @@ Let's use the petri-dish image from previous episodes:
343
342
Graysacle version of the Petri dish image
344
343
](fig/petri-dish.png){alt='Bacteria colony'}
345
344
346
-
What we want to see here is the pixel intensities from a lateral perspective,
347
-
we want to see the profile of intensities.
345
+
What we want to see here is the pixel intensities from a lateral perspective:
346
+
we want to see the profile of intensities.
348
347
For instance, let's look for the intensities of the pixels along the horizontal
349
-
at `Y=150`:
348
+
line at `Y=150`:
350
349
351
350
```python
352
351
import matplotlib.pyplot as plt
353
352
import imageio.v3 as iio
354
353
import skimage.color
355
354
356
-
# read colonies color image and convert to grayscale:
355
+
# read colonies color image and convert to grayscale
357
356
#
358
357
image = iio.imread('data/colonies-01.tif')
359
358
image_gray = skimage.color.rgb2gray(image)
360
359
361
-
# define the pixels we want to view the intensities (profile)
360
+
# define the pixels for which we want to view the intensity (profile)
362
361
#
363
362
xmin, xmax = (0, image_gray.shape[1])
364
363
ymin = ymax =150
365
364
366
365
# view the image indicating the profile pixels position
These unequal sigma values produce a kernel that is rectangular instead of square.
532
-
The result is an image that is much more blurred in the x direction than the
533
-
y direction.
531
+
The result is an image that is much more blurred in the X direction than in the
532
+
Y direction.
534
533
For most use cases, a uniform blurring effect is desirable and
535
534
this kind of asymmetric blurring should be avoided.
536
-
However, it can be helpful in specific circumstances e.g. when noise is present in
535
+
However, it can be helpful in specific circumstances, e.g., when noise is present in
537
536
your image in a particular pattern or orientation, such as vertical lines,
538
537
or when you want to
539
538
[remove uniform noise without blurring edges present in the image in a particular orientation](https://www.researchgate.net/publication/228567435_An_edge_detection_algorithm_based_on_rectangular_Gaussian_kernels_for_machine_vision_applications).
@@ -545,8 +544,8 @@ or when you want to
545
544
## Other methods of blurring
546
545
547
546
The Gaussian blur is a way to apply a low-pass filter in scikit-image.
548
-
It is often used to remove Gaussian (i.e., random) noise from the image.
549
-
For other kinds of noise, e.g. "salt and pepper", a
547
+
It is often used to remove Gaussian (i.e., random) noise in an image.
548
+
For other kinds of noise, e.g., "salt and pepper", a
550
549
median filter is typically used.
551
550
See [the `skimage.filters` documentation](https://scikit-image.org/docs/dev/api/skimage.filters.html#module-skimage.filters)
0 commit comments