diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5ed47c067..0a0a4f542 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,7 +65,7 @@ fresh eyes are always welcome. ### What to Contribute (This Lesson) Any contributions are welcome, particularly ideas for how the existing content could be -improved or updated, and/or errors that need to be corrected. Comments on existing issues +improved or updated, and/or errors that need to be corrected. Comments on existing issues and reviews of pull requests are similarly welcome. If you plan to submit a pull request, please open an issue @@ -73,16 +73,19 @@ If you plan to submit a pull request, please open an issue or spent making a change that will not be accepted by the Maintainers. #### Content / style guidelines -- If you add an image / figure that was generated from Python code, please include this + +- If you add an image / figure that was generated from Python code, please include this code in your PR under `episodes/fig/source`. -- Use the terms in the table below, when referring to Python libraries within the lesson. - The table gives two terms for each library: `Term for descriptive text` which should be - used when discussing the library in plain English / full sentences and `Term for code` +- If you add a new image or figure, verify that it displays correctly in the lesson’s dark mode. A color-inversion filter is applied [by Varnish to all images by default in dark mode](https://github.com/carpentries/varnish/issues/181), which may cause some images to appear incorrectly or become unreadable. If your image is affected, include an additional version of the same image with a `-dark` suffix in its filename. + +- Use the terms in the table below, when referring to Python libraries within the lesson. + The table gives two terms for each library: `Term for descriptive text` which should be + used when discussing the library in plain English / full sentences and `Term for code` which should be used when referring to code (and within code). | Python library | Term for descriptive text | Term for code | - | :------------- | :------------- | :------------- | + | :------------- | :------------- | :------------- | | [scikit-image](https://scikit-image.org/) | scikit-image | `skimage` | | [NumPy](https://numpy.org/) | NumPy | `numpy` | | [Matplotlib](https://matplotlib.org/) | Matplotlib | `matplotlib` | @@ -101,7 +104,7 @@ or spent making a change that will not be accepted by the Maintainers. rr, cc = ski.draw.rectangle(start=(357, 44), end=(740, 720)) ``` -- For reading and writing images, use the [imageio](https://imageio.readthedocs.io/en/stable/index.html) +- For reading and writing images, use the [imageio](https://imageio.readthedocs.io/en/stable/index.html) library and avoid use of `skimage.io`. For example: ```python import imageio.v3 as iio @@ -109,7 +112,7 @@ or spent making a change that will not be accepted by the Maintainers. chair = iio.imread(uri="data/chair.jpg") # read an image iio.imwrite(uri="data/chair.tif", image=chair) # write an image ``` - + - Comments providing an overall description of a code snippet should use triple quotes `"""`, e.g., ```python """Python script to load a colour image in grayscale""" @@ -138,7 +141,7 @@ Although most contributions will be welcome at this stage of the curriculum's de the time available to deliver the content in a training event is strictly limited and needs to be accounted for when considering the addition of any new content. If you want to suggest the addition of new content, especially whole new sections or episodes, -please open an issue to discuss this with the Maintainers first and provide the following +please open an issue to discuss this with the Maintainers first and provide the following information alongside a summary of the content to be added: 1. A suggested location for the new content. diff --git a/episodes/03-skimage-images.md b/episodes/03-skimage-images.md index f5de94096..34842802d 100644 --- a/episodes/03-skimage-images.md +++ b/episodes/03-skimage-images.md @@ -191,7 +191,7 @@ Images may appear the same size in jupyter, but you can see the size difference by comparing the scales for each. You can also see the difference in file storage size on disk by hovering your mouse cursor over the original -and the new files in the Jupyter file browser, using `ls -l` in your shell +and the new files in the Jupyter file browser, using `ls -l` in your shell (`dir` with Windows PowerShell), or viewing file sizes in the OS file browser if it is configured so. ::::::::::::::: solution @@ -240,7 +240,7 @@ Suppose we are interested in this maize root cluster image. We want to be able to focus our program's attention on the roots themselves, while ignoring the black background. -![](data/maize-root-cluster.jpg){alt='Root cluster image'} +![](fig/maize-root-cluster.jpg){alt='Root cluster image'} Since the image is stored as an array of numbers, we can simply look through the array for pixel colour values that are @@ -379,9 +379,9 @@ the low intensity pixels while changing the high intensity ones. The file `data/sudoku.png` is an RGB image of a sudoku puzzle: -![](data/sudoku.png){alt='Su-Do-Ku puzzle'} +![](fig/sudoku.png){alt='Su-Do-Ku puzzle'} -Your task is to load the image in grayscale format and turn all of +Your task is to load the image in grayscale format and turn all of the bright pixels in the image to a light gray colour. In other words, mask the bright pixels that have a pixel value greater than, say, 192 and set their value to 192 (the @@ -392,15 +392,15 @@ range 0-255 of an 8-bit pixel). The results should look like this: *Hint: the `cmap`, `vmin`, and `vmax` parameters of `matplotlib.pyplot.imshow` will be needed to display the modified image as desired. See the [Matplotlib -documentation](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html) +documentation](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html) for more details on `cmap`, `vmin`, and `vmax`.* ::::::::::::::: solution ## Solution -First, load the image file `data/sudoku.png` as a grayscale image. -Note we may want to create a copy of the image array to avoid modifying our original variable and +First, load the image file `data/sudoku.png` as a grayscale image. +Note we may want to create a copy of the image array to avoid modifying our original variable and also because `imageio.v3.imread` sometimes returns a non-writeable image. ```python @@ -465,11 +465,11 @@ Consider this image of a whiteboard, and suppose that we want to create a sub-image with just the portion that says "odd + even = odd," along with the red box that is drawn around the words. -![](data/board.jpg){alt='Whiteboard image'} +![](fig/board.jpg){alt='Whiteboard image'} -Using `matplotlib.pyplot.imshow` +Using `matplotlib.pyplot.imshow` we can determine the coordinates of the corners of the area we wish to extract -by hovering the mouse near the points of interest and noting the coordinates +by hovering the mouse near the points of interest and noting the coordinates (remember to run `%matplotlib widget` first if you haven't already). If we do that, we might settle on a rectangular area with an upper-left coordinate of *(135, 60)* diff --git a/episodes/04-drawing.md b/episodes/04-drawing.md index a5c4eebc1..ae1c4446b 100644 --- a/episodes/04-drawing.md +++ b/episodes/04-drawing.md @@ -393,7 +393,7 @@ Copy that image to your computer, write some code to make a mask, and apply it to select the part of the image containing your object. For example, here is an image of a remote control: -![](data/remote-control.jpg){alt='Remote control image'} +![](fig/remote-control.jpg){alt='Remote control image'} And, here is the end result of a program masking out everything but the remote: @@ -446,7 +446,7 @@ fig, ax = plt.subplots() ax.imshow(wellplate) ``` -![](data/wellplate-01.jpg){alt='96-well plate'} +![](fig/wellplate-01.jpg){alt='96-well plate'} Suppose that we are interested in the colours of the solutions in each of the wells. We *do not* care about the colour of the rest of the image, diff --git a/episodes/05-creating-histograms.md b/episodes/05-creating-histograms.md index d0e1e2596..9d68c5b6e 100644 --- a/episodes/05-creating-histograms.md +++ b/episodes/05-creating-histograms.md @@ -52,7 +52,7 @@ and histograms are also quite handy as a preparatory step before performing We will start with grayscale images, and then move on to colour images. We will use this image of a plant seedling as an example: -![](data/plant-seedling.jpg){alt='Plant seedling'} +![](fig/plant-seedling.jpg){alt='Plant seedling'} Here we load the image in grayscale instead of full colour, and display it: diff --git a/episodes/06-blurring.md b/episodes/06-blurring.md index beaeef215..6aec08157 100644 --- a/episodes/06-blurring.md +++ b/episodes/06-blurring.md @@ -276,7 +276,7 @@ fig, ax = plt.subplots() ax.imshow(image) ``` -![](data/gaussian-original.png){alt='Original image'} +![](fig/gaussian-original.png){alt='Original image'} Next, we apply the gaussian blur: @@ -331,8 +331,8 @@ ax.imshow(blurred) ## Visualising Blurring -Somebody said once "an image is worth a thousand words". -What is actually happening to the image pixels when we apply blurring may be +Somebody said once "an image is worth a thousand words". +What is actually happening to the image pixels when we apply blurring may be difficult to grasp. Let's now visualise the effects of blurring from a different perspective. @@ -430,18 +430,18 @@ but can be viewed by following the links in the captions. ![ -A 3D plot of pixel intensities across the whole Petri dish image before blurring. -[Explore how this plot was created with matplotlib](https://gist.github.com/chbrandt/63ba38142630a0586ba2a13eabedf94b). +A 3D plot of pixel intensities across the whole Petri dish image before blurring. +[Explore how this plot was created with matplotlib](https://gist.github.com/chbrandt/63ba38142630a0586ba2a13eabedf94b). Image credit: [Carlos H Brandt](https://github.com/chbrandt/). ](fig/3D_petri_before_blurring.png){ alt='3D surface plot showing pixel intensities across the whole example Petri dish image before blurring' } ![ -A 3D plot of pixel intensities after Gaussian blurring of the Petri dish image. -Note the 'smoothing' effect on the pixel intensities of the colonies in the image, -and the 'flattening' of the background noise at relatively low pixel intensities throughout the image. -[Explore how this plot was created with matplotlib](https://gist.github.com/chbrandt/63ba38142630a0586ba2a13eabedf94b). +A 3D plot of pixel intensities after Gaussian blurring of the Petri dish image. +Note the 'smoothing' effect on the pixel intensities of the colonies in the image, +and the 'flattening' of the background noise at relatively low pixel intensities throughout the image. +[Explore how this plot was created with matplotlib](https://gist.github.com/chbrandt/63ba38142630a0586ba2a13eabedf94b). Image credit: [Carlos H Brandt](https://github.com/chbrandt/). ](fig/3D_petri_after_blurring.png){ alt='3D surface plot illustrating the smoothing effect on pixel intensities across the whole example Petri dish image after blurring' diff --git a/episodes/07-thresholding.md b/episodes/07-thresholding.md index 8636bee77..cd9ccafc5 100644 --- a/episodes/07-thresholding.md +++ b/episodes/07-thresholding.md @@ -68,7 +68,7 @@ fig, ax = plt.subplots() ax.imshow(shapes01) ``` -![](data/shapes-01.jpg){alt='Image with geometric shapes on white background' .image-with-shadow} +![](fig/shapes-01.jpg){alt='Image with geometric shapes on white background' .image-with-shadow} Now suppose we want to select only the shapes from the image. In other words, we want to leave the pixels belonging to the shapes "on," @@ -214,7 +214,7 @@ ax.imshow(selection) Now, it is your turn to practice. Suppose we want to use simple thresholding to select only the coloured shapes (in this particular case we consider grayish to be a colour, too) from the image `data/shapes-02.jpg`: -![](data/shapes-02.jpg){alt='Another image with geometric shapes on white background'} +![](fig/shapes-02.jpg){alt='Another image with geometric shapes on white background'} First, plot the grayscale histogram as in the [Creating Histogram](05-creating-histograms.md) episode and @@ -324,7 +324,7 @@ fig, ax = plt.subplots() ax.imshow(maize_roots) ``` -![](data/maize-root-cluster.jpg){alt='Image of a maize root'} +![](fig/maize-root-cluster.jpg){alt='Image of a maize root'} We use Gaussian blur with a sigma of 1.0 to denoise the root image. Let us look at the grayscale histogram of the denoised image. @@ -348,7 +348,7 @@ ax.set_xlim(0, 1.0) ![](fig/maize-root-cluster-histogram.png){alt='Grayscale histogram of the maize root image'} -The histogram has a significant peak around 0.2 and then a broader "hill" around 0.6 followed by a +The histogram has a significant peak around 0.2 and then a broader "hill" around 0.6 followed by a smaller peak near 1.0. Looking at the grayscale image, we can identify the peak at 0.2 with the background and the broader peak with the foreground. Thus, this image is a good candidate for thresholding with Otsu's method. @@ -356,17 +356,17 @@ The mathematical details of how this works are complicated (see [the scikit-image documentation](https://scikit-image.org/docs/dev/api/skimage.filters.html#threshold-otsu) if you are interested), but the outcome is that Otsu's method finds a threshold value between the two peaks of a grayscale -histogram which might correspond well to the foreground and background depending on the data and +histogram which might correspond well to the foreground and background depending on the data and application. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: instructor -The histogram of the maize root image may prompt questions from learners about the interpretation -of the peaks and the broader region around 0.6. The focus here is on the separation of background -and foreground pixel values. We note that Otsu's method does not work well -for the image with the shapes used earlier in this episode, as the foreground pixel values are more +The histogram of the maize root image may prompt questions from learners about the interpretation +of the peaks and the broader region around 0.6. The focus here is on the separation of background +and foreground pixel values. We note that Otsu's method does not work well +for the image with the shapes used earlier in this episode, as the foreground pixel values are more distributed. These examples could be augmented with a discussion of unimodal, bimodal, and multimodal -histograms. While these points can lead to fruitful considerations, the text in this episode attempts +histograms. While these points can lead to fruitful considerations, the text in this episode attempts to reduce cognitive load and deliberately simplifies the discussion. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: @@ -636,10 +636,10 @@ def enhanced_root_mass(filename, sigma): # perform binary thresholding to mask the white label and circle binary_mask = blurred_image < 0.95 - + # perform automatic thresholding using only the pixels with value True in the binary mask t = ski.filters.threshold_otsu(blurred_image[binary_mask]) - + # update binary mask to identify pixels which are both less than 0.95 and greater than t binary_mask = (blurred_image < 0.95) & (blurred_image > t) @@ -677,7 +677,7 @@ The `&` operator above means that we have defined a logical AND statement. This | False | True | False | | True | False | False | | True | True | True | - + Knowing how to construct this kind of logical operation can be very helpful in image processing. The University of Minnesota Library's [guide to Boolean operators](https://libguides.umn.edu/BooleanOperators) is a good place to start if you want to learn more. :::::::::::::::::::::::::::::::::::::::::::::::::: diff --git a/episodes/08-connected-components.md b/episodes/08-connected-components.md index d21ca9890..095204ae4 100644 --- a/episodes/08-connected-components.md +++ b/episodes/08-connected-components.md @@ -27,7 +27,7 @@ we have covered dividing an image into foreground and background pixels. In the shapes example image, we considered the coloured shapes as foreground *objects* on a white background. -![](data/shapes-01.jpg){alt='Original shapes image' .image-with-shadow} +![](fig/shapes-01.jpg){alt='Original shapes image' .image-with-shadow} In thresholding we went from the original image to this version: @@ -357,7 +357,7 @@ Those are really big numbers. From this available space we only use the range from `0` to `11`. When showing this image in the viewer, it may squeeze the complete range into 256 gray values. -Therefore, the range of our numbers does not produce any visible variation. One way to rectify this +Therefore, the range of our numbers does not produce any visible variation. One way to rectify this is to explicitly specify the data range we want the colormap to cover: ```python @@ -365,7 +365,7 @@ fig, ax = plt.subplots() ax.imshow(labeled_image, vmin=np.min(labeled_image), vmax=np.max(labeled_image)) ``` -Note this is the default behaviour for newer versions of `matplotlib.pyplot.imshow`. +Note this is the default behaviour for newer versions of `matplotlib.pyplot.imshow`. Alternatively we could convert the image to RGB and then display it. @@ -376,7 +376,7 @@ Alternatively we could convert the image to RGB and then display it. ## Suppressing outputs in Jupyter Notebooks We just used `ax.set_axis_off();` to hide the axis from the image for a visually cleaner figure. The -semicolon is added to supress the output(s) of the statement, in this [case](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.axis.html) +semicolon is added to supress the output(s) of the statement, in this [case](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.axis.html) the axis limits. This is specific to Jupyter Notebooks. :::::::::::::::::::::::::::::::::::::::::::::::::: diff --git a/episodes/fig/3D_petri_after_blurring-dark.png b/episodes/fig/3D_petri_after_blurring-dark.png new file mode 100644 index 000000000..5583cd82d Binary files /dev/null and b/episodes/fig/3D_petri_after_blurring-dark.png differ diff --git a/episodes/fig/3D_petri_before_blurring-dark.png b/episodes/fig/3D_petri_before_blurring-dark.png new file mode 100644 index 000000000..7811232a0 Binary files /dev/null and b/episodes/fig/3D_petri_before_blurring-dark.png differ diff --git a/episodes/fig/Gaussian_2D-dark.png b/episodes/fig/Gaussian_2D-dark.png new file mode 100644 index 000000000..da7ffecf3 Binary files /dev/null and b/episodes/fig/Gaussian_2D-dark.png differ diff --git a/episodes/fig/beads-canny-ui-dark.png b/episodes/fig/beads-canny-ui-dark.png new file mode 100644 index 000000000..ca6f6a75b Binary files /dev/null and b/episodes/fig/beads-canny-ui-dark.png differ diff --git a/episodes/fig/beads-dark.jpg b/episodes/fig/beads-dark.jpg new file mode 100644 index 000000000..4a585f9fd Binary files /dev/null and b/episodes/fig/beads-dark.jpg differ diff --git a/episodes/fig/beads-out-dark.png b/episodes/fig/beads-out-dark.png new file mode 100644 index 000000000..e6cd92425 Binary files /dev/null and b/episodes/fig/beads-out-dark.png differ diff --git a/episodes/fig/beads.jpg b/episodes/fig/beads.jpg new file mode 100644 index 000000000..4a585f9fd Binary files /dev/null and b/episodes/fig/beads.jpg differ diff --git a/episodes/fig/black-and-white-dark.jpg b/episodes/fig/black-and-white-dark.jpg new file mode 100644 index 000000000..393a772cd Binary files /dev/null and b/episodes/fig/black-and-white-dark.jpg differ diff --git a/episodes/fig/black-and-white-edge-pixels-dark.jpg b/episodes/fig/black-and-white-edge-pixels-dark.jpg new file mode 100644 index 000000000..c5f04a5c7 Binary files /dev/null and b/episodes/fig/black-and-white-edge-pixels-dark.jpg differ diff --git a/episodes/fig/black-and-white-gradient-dark.png b/episodes/fig/black-and-white-gradient-dark.png new file mode 100644 index 000000000..de1d9c43d Binary files /dev/null and b/episodes/fig/black-and-white-gradient-dark.png differ diff --git a/episodes/fig/blur-demo-dark.gif b/episodes/fig/blur-demo-dark.gif new file mode 100644 index 000000000..5e8bd4ce0 Binary files /dev/null and b/episodes/fig/blur-demo-dark.gif differ diff --git a/episodes/fig/board-coordinates-dark.jpg b/episodes/fig/board-coordinates-dark.jpg new file mode 100644 index 000000000..be691f00c Binary files /dev/null and b/episodes/fig/board-coordinates-dark.jpg differ diff --git a/episodes/fig/board-dark.jpg b/episodes/fig/board-dark.jpg new file mode 100644 index 000000000..9b61e4e9f Binary files /dev/null and b/episodes/fig/board-dark.jpg differ diff --git a/episodes/fig/board-final-dark.jpg b/episodes/fig/board-final-dark.jpg new file mode 100644 index 000000000..53545a2f2 Binary files /dev/null and b/episodes/fig/board-final-dark.jpg differ diff --git a/episodes/fig/board.jpg b/episodes/fig/board.jpg new file mode 100644 index 000000000..9b61e4e9f Binary files /dev/null and b/episodes/fig/board.jpg differ diff --git a/episodes/fig/cartesian-coordinates-dark.png b/episodes/fig/cartesian-coordinates-dark.png new file mode 100644 index 000000000..218b3e6b0 Binary files /dev/null and b/episodes/fig/cartesian-coordinates-dark.png differ diff --git a/episodes/fig/cat-corner-blue-dark.png b/episodes/fig/cat-corner-blue-dark.png new file mode 100644 index 000000000..5f89e1b9f Binary files /dev/null and b/episodes/fig/cat-corner-blue-dark.png differ diff --git a/episodes/fig/cat-dark.jpg b/episodes/fig/cat-dark.jpg new file mode 100644 index 000000000..4f3f969c0 Binary files /dev/null and b/episodes/fig/cat-dark.jpg differ diff --git a/episodes/fig/cat-eye-pixels-dark.jpg b/episodes/fig/cat-eye-pixels-dark.jpg new file mode 100644 index 000000000..1f34da183 Binary files /dev/null and b/episodes/fig/cat-eye-pixels-dark.jpg differ diff --git a/episodes/fig/checkerboard-blue-channel-dark.png b/episodes/fig/checkerboard-blue-channel-dark.png new file mode 100644 index 000000000..7a411abda Binary files /dev/null and b/episodes/fig/checkerboard-blue-channel-dark.png differ diff --git a/episodes/fig/checkerboard-dark.png b/episodes/fig/checkerboard-dark.png new file mode 100644 index 000000000..417874a8c Binary files /dev/null and b/episodes/fig/checkerboard-dark.png differ diff --git a/episodes/fig/checkerboard-green-channel-dark.png b/episodes/fig/checkerboard-green-channel-dark.png new file mode 100644 index 000000000..505b1957b Binary files /dev/null and b/episodes/fig/checkerboard-green-channel-dark.png differ diff --git a/episodes/fig/checkerboard-red-channel-dark.png b/episodes/fig/checkerboard-red-channel-dark.png new file mode 100644 index 000000000..e6a8f1ae1 Binary files /dev/null and b/episodes/fig/checkerboard-red-channel-dark.png differ diff --git a/episodes/fig/colonies-01-dark.jpg b/episodes/fig/colonies-01-dark.jpg new file mode 100644 index 000000000..31440c055 Binary files /dev/null and b/episodes/fig/colonies-01-dark.jpg differ diff --git a/episodes/fig/colonies-01-gray-dark.png b/episodes/fig/colonies-01-gray-dark.png new file mode 100644 index 000000000..50179219d Binary files /dev/null and b/episodes/fig/colonies-01-gray-dark.png differ diff --git a/episodes/fig/colonies-01-mask-dark.png b/episodes/fig/colonies-01-mask-dark.png new file mode 100644 index 000000000..f51dc69fd Binary files /dev/null and b/episodes/fig/colonies-01-mask-dark.png differ diff --git a/episodes/fig/colonies-01-summary-dark.png b/episodes/fig/colonies-01-summary-dark.png new file mode 100644 index 000000000..8cb89ea0f Binary files /dev/null and b/episodes/fig/colonies-01-summary-dark.png differ diff --git a/episodes/fig/colonies-02-dark.jpg b/episodes/fig/colonies-02-dark.jpg new file mode 100644 index 000000000..4bbd2a682 Binary files /dev/null and b/episodes/fig/colonies-02-dark.jpg differ diff --git a/episodes/fig/colonies-02-summary-dark.png b/episodes/fig/colonies-02-summary-dark.png new file mode 100644 index 000000000..a2c8834b1 Binary files /dev/null and b/episodes/fig/colonies-02-summary-dark.png differ diff --git a/episodes/fig/colonies-03-dark.jpg b/episodes/fig/colonies-03-dark.jpg new file mode 100644 index 000000000..949be7221 Binary files /dev/null and b/episodes/fig/colonies-03-dark.jpg differ diff --git a/episodes/fig/colonies-03-summary-dark.png b/episodes/fig/colonies-03-summary-dark.png new file mode 100644 index 000000000..3c3f652c4 Binary files /dev/null and b/episodes/fig/colonies-03-summary-dark.png differ diff --git a/episodes/fig/colony-mask-dark.png b/episodes/fig/colony-mask-dark.png new file mode 100644 index 000000000..d4ea8e2a1 Binary files /dev/null and b/episodes/fig/colony-mask-dark.png differ diff --git a/episodes/fig/colour-table-dark.png b/episodes/fig/colour-table-dark.png new file mode 100644 index 000000000..27372fd25 Binary files /dev/null and b/episodes/fig/colour-table-dark.png differ diff --git a/episodes/fig/combination-dark.png b/episodes/fig/combination-dark.png new file mode 100644 index 000000000..2d35980a8 Binary files /dev/null and b/episodes/fig/combination-dark.png differ diff --git a/episodes/fig/drawing-practice-dark.jpg b/episodes/fig/drawing-practice-dark.jpg new file mode 100644 index 000000000..588d56cb6 Binary files /dev/null and b/episodes/fig/drawing-practice-dark.jpg differ diff --git a/episodes/fig/eight-dark.png b/episodes/fig/eight-dark.png new file mode 100644 index 000000000..99b69f000 Binary files /dev/null and b/episodes/fig/eight-dark.png differ diff --git a/episodes/fig/five-dark.png b/episodes/fig/five-dark.png new file mode 100644 index 000000000..0832c5b8d Binary files /dev/null and b/episodes/fig/five-dark.png differ diff --git a/episodes/fig/four-maize-roots-binary-dark.jpg b/episodes/fig/four-maize-roots-binary-dark.jpg new file mode 100644 index 000000000..4d90220fb Binary files /dev/null and b/episodes/fig/four-maize-roots-binary-dark.jpg differ diff --git a/episodes/fig/four-maize-roots-binary-improved-dark.jpg b/episodes/fig/four-maize-roots-binary-improved-dark.jpg new file mode 100644 index 000000000..6bbf1b4a4 Binary files /dev/null and b/episodes/fig/four-maize-roots-binary-improved-dark.jpg differ diff --git a/episodes/fig/four-maize-roots-dark.jpg b/episodes/fig/four-maize-roots-dark.jpg new file mode 100644 index 000000000..2e5d365e0 Binary files /dev/null and b/episodes/fig/four-maize-roots-dark.jpg differ diff --git a/episodes/fig/gaussian-blurred-dark.png b/episodes/fig/gaussian-blurred-dark.png new file mode 100644 index 000000000..c8c868301 Binary files /dev/null and b/episodes/fig/gaussian-blurred-dark.png differ diff --git a/episodes/fig/gaussian-kernel-dark.png b/episodes/fig/gaussian-kernel-dark.png new file mode 100644 index 000000000..6ac11047a Binary files /dev/null and b/episodes/fig/gaussian-kernel-dark.png differ diff --git a/episodes/fig/gaussian-original-dark.png b/episodes/fig/gaussian-original-dark.png new file mode 100644 index 000000000..7eceeb1cd Binary files /dev/null and b/episodes/fig/gaussian-original-dark.png differ diff --git a/episodes/fig/gaussian-original.png b/episodes/fig/gaussian-original.png new file mode 100644 index 000000000..7eceeb1cd Binary files /dev/null and b/episodes/fig/gaussian-original.png differ diff --git a/episodes/fig/grayscale-dark.png b/episodes/fig/grayscale-dark.png new file mode 100644 index 000000000..76037a5fe Binary files /dev/null and b/episodes/fig/grayscale-dark.png differ diff --git a/episodes/fig/image-coordinates-dark.png b/episodes/fig/image-coordinates-dark.png new file mode 100644 index 000000000..db8e7bf65 Binary files /dev/null and b/episodes/fig/image-coordinates-dark.png differ diff --git a/episodes/fig/left-hand-coordinates-dark.png b/episodes/fig/left-hand-coordinates-dark.png new file mode 100644 index 000000000..a16e1837d Binary files /dev/null and b/episodes/fig/left-hand-coordinates-dark.png differ diff --git a/episodes/fig/maize-root-cluster-dark.jpg b/episodes/fig/maize-root-cluster-dark.jpg new file mode 100644 index 000000000..ac9b56eeb Binary files /dev/null and b/episodes/fig/maize-root-cluster-dark.jpg differ diff --git a/episodes/fig/maize-root-cluster-mask-dark.png b/episodes/fig/maize-root-cluster-mask-dark.png new file mode 100644 index 000000000..2ecee5c42 Binary files /dev/null and b/episodes/fig/maize-root-cluster-mask-dark.png differ diff --git a/episodes/fig/maize-root-cluster-selected-dark.png b/episodes/fig/maize-root-cluster-selected-dark.png new file mode 100644 index 000000000..c0a2f243d Binary files /dev/null and b/episodes/fig/maize-root-cluster-selected-dark.png differ diff --git a/episodes/fig/maize-root-cluster-threshold-dark.jpg b/episodes/fig/maize-root-cluster-threshold-dark.jpg new file mode 100644 index 000000000..4ddb086f8 Binary files /dev/null and b/episodes/fig/maize-root-cluster-threshold-dark.jpg differ diff --git a/episodes/fig/maize-root-cluster.jpg b/episodes/fig/maize-root-cluster.jpg new file mode 100644 index 000000000..ac9b56eeb Binary files /dev/null and b/episodes/fig/maize-root-cluster.jpg differ diff --git a/episodes/fig/maize-roots-grayscale-dark.jpg b/episodes/fig/maize-roots-grayscale-dark.jpg new file mode 100644 index 000000000..dc5a08170 Binary files /dev/null and b/episodes/fig/maize-roots-grayscale-dark.jpg differ diff --git a/episodes/fig/maize-roots-grayscale.jpg b/episodes/fig/maize-roots-grayscale.jpg new file mode 100644 index 000000000..dc5a08170 Binary files /dev/null and b/episodes/fig/maize-roots-grayscale.jpg differ diff --git a/episodes/fig/maize-roots-threshold-dark.png b/episodes/fig/maize-roots-threshold-dark.png new file mode 100644 index 000000000..ccd20ae33 Binary files /dev/null and b/episodes/fig/maize-roots-threshold-dark.png differ diff --git a/episodes/fig/maize-seedling-enlarged-dark.jpg b/episodes/fig/maize-seedling-enlarged-dark.jpg new file mode 100644 index 000000000..bef678726 Binary files /dev/null and b/episodes/fig/maize-seedling-enlarged-dark.jpg differ diff --git a/episodes/fig/maize-seedling-original-dark.jpg b/episodes/fig/maize-seedling-original-dark.jpg new file mode 100644 index 000000000..ee5d36ea0 Binary files /dev/null and b/episodes/fig/maize-seedling-original-dark.jpg differ diff --git a/episodes/fig/maize-seedlings-dark.jpg b/episodes/fig/maize-seedlings-dark.jpg new file mode 100644 index 000000000..b6599d448 Binary files /dev/null and b/episodes/fig/maize-seedlings-dark.jpg differ diff --git a/episodes/fig/maize-seedlings-mask-dark.png b/episodes/fig/maize-seedlings-mask-dark.png new file mode 100644 index 000000000..d29a28aa5 Binary files /dev/null and b/episodes/fig/maize-seedlings-mask-dark.png differ diff --git a/episodes/fig/maize-seedlings-masked-dark.jpg b/episodes/fig/maize-seedlings-masked-dark.jpg new file mode 100644 index 000000000..2bec2bd6e Binary files /dev/null and b/episodes/fig/maize-seedlings-masked-dark.jpg differ diff --git a/episodes/fig/petri-blurred-intensities-plot-dark.png b/episodes/fig/petri-blurred-intensities-plot-dark.png new file mode 100644 index 000000000..bbb4df43e Binary files /dev/null and b/episodes/fig/petri-blurred-intensities-plot-dark.png differ diff --git a/episodes/fig/petri-dish-dark.png b/episodes/fig/petri-dish-dark.png new file mode 100644 index 000000000..422a52572 Binary files /dev/null and b/episodes/fig/petri-dish-dark.png differ diff --git a/episodes/fig/petri-original-intensities-plot-dark.png b/episodes/fig/petri-original-intensities-plot-dark.png new file mode 100644 index 000000000..c78b5072b Binary files /dev/null and b/episodes/fig/petri-original-intensities-plot-dark.png differ diff --git a/episodes/fig/petri-selected-pixels-marker-dark.png b/episodes/fig/petri-selected-pixels-marker-dark.png new file mode 100644 index 000000000..097c59e28 Binary files /dev/null and b/episodes/fig/petri-selected-pixels-marker-dark.png differ diff --git a/episodes/fig/plant-seedling-colour-histogram-dark.png b/episodes/fig/plant-seedling-colour-histogram-dark.png new file mode 100644 index 000000000..a73d84a69 Binary files /dev/null and b/episodes/fig/plant-seedling-colour-histogram-dark.png differ diff --git a/episodes/fig/plant-seedling-dark.jpg b/episodes/fig/plant-seedling-dark.jpg new file mode 100644 index 000000000..6dd51ad1d Binary files /dev/null and b/episodes/fig/plant-seedling-dark.jpg differ diff --git a/episodes/fig/plant-seedling-grayscale-dark.png b/episodes/fig/plant-seedling-grayscale-dark.png new file mode 100644 index 000000000..cf8fd28b0 Binary files /dev/null and b/episodes/fig/plant-seedling-grayscale-dark.png differ diff --git a/episodes/fig/plant-seedling-grayscale-histogram-dark.png b/episodes/fig/plant-seedling-grayscale-histogram-dark.png new file mode 100644 index 000000000..5bbb1feb3 Binary files /dev/null and b/episodes/fig/plant-seedling-grayscale-histogram-dark.png differ diff --git a/episodes/fig/plant-seedling-grayscale-histogram-mask-dark.png b/episodes/fig/plant-seedling-grayscale-histogram-mask-dark.png new file mode 100644 index 000000000..bb5432780 Binary files /dev/null and b/episodes/fig/plant-seedling-grayscale-histogram-mask-dark.png differ diff --git a/episodes/fig/plant-seedling.jpg b/episodes/fig/plant-seedling.jpg new file mode 100644 index 000000000..6dd51ad1d Binary files /dev/null and b/episodes/fig/plant-seedling.jpg differ diff --git a/episodes/fig/quality-histogram-dark.jpg b/episodes/fig/quality-histogram-dark.jpg new file mode 100644 index 000000000..20e142b72 Binary files /dev/null and b/episodes/fig/quality-histogram-dark.jpg differ diff --git a/episodes/fig/quality-jpg-dark.jpg b/episodes/fig/quality-jpg-dark.jpg new file mode 100644 index 000000000..4687e3701 Binary files /dev/null and b/episodes/fig/quality-jpg-dark.jpg differ diff --git a/episodes/fig/quality-original-dark.jpg b/episodes/fig/quality-original-dark.jpg new file mode 100644 index 000000000..e169be000 Binary files /dev/null and b/episodes/fig/quality-original-dark.jpg differ diff --git a/episodes/fig/quality-tif-dark.jpg b/episodes/fig/quality-tif-dark.jpg new file mode 100644 index 000000000..fcead57c8 Binary files /dev/null and b/episodes/fig/quality-tif-dark.jpg differ diff --git a/episodes/fig/rectangle-gaussian-blurred-dark.png b/episodes/fig/rectangle-gaussian-blurred-dark.png new file mode 100644 index 000000000..61b3f8b88 Binary files /dev/null and b/episodes/fig/rectangle-gaussian-blurred-dark.png differ diff --git a/episodes/fig/remote-control-dark.jpg b/episodes/fig/remote-control-dark.jpg new file mode 100644 index 000000000..dfe33abdb Binary files /dev/null and b/episodes/fig/remote-control-dark.jpg differ diff --git a/episodes/fig/remote-control-masked-dark.jpg b/episodes/fig/remote-control-masked-dark.jpg new file mode 100644 index 000000000..61881f44f Binary files /dev/null and b/episodes/fig/remote-control-masked-dark.jpg differ diff --git a/episodes/fig/remote-control.jpg b/episodes/fig/remote-control.jpg new file mode 100644 index 000000000..dfe33abdb Binary files /dev/null and b/episodes/fig/remote-control.jpg differ diff --git a/episodes/fig/shapes-01-canny-edge-output-dark.png b/episodes/fig/shapes-01-canny-edge-output-dark.png new file mode 100644 index 000000000..36deb8771 Binary files /dev/null and b/episodes/fig/shapes-01-canny-edge-output-dark.png differ diff --git a/episodes/fig/shapes-01-canny-edges-dark.png b/episodes/fig/shapes-01-canny-edges-dark.png new file mode 100644 index 000000000..c9272d6ad Binary files /dev/null and b/episodes/fig/shapes-01-canny-edges-dark.png differ diff --git a/episodes/fig/shapes-01-canny-track-edges-dark.png b/episodes/fig/shapes-01-canny-track-edges-dark.png new file mode 100644 index 000000000..40dc580e3 Binary files /dev/null and b/episodes/fig/shapes-01-canny-track-edges-dark.png differ diff --git a/episodes/fig/shapes-01-cca-detail-dark.png b/episodes/fig/shapes-01-cca-detail-dark.png new file mode 100644 index 000000000..5fd9041d2 Binary files /dev/null and b/episodes/fig/shapes-01-cca-detail-dark.png differ diff --git a/episodes/fig/shapes-01-dark.jpg b/episodes/fig/shapes-01-dark.jpg new file mode 100644 index 000000000..6b2707adc Binary files /dev/null and b/episodes/fig/shapes-01-dark.jpg differ diff --git a/episodes/fig/shapes-01-filtered-objects-dark.png b/episodes/fig/shapes-01-filtered-objects-dark.png new file mode 100644 index 000000000..3d13ca04b Binary files /dev/null and b/episodes/fig/shapes-01-filtered-objects-dark.png differ diff --git a/episodes/fig/shapes-01-grayscale-dark.png b/episodes/fig/shapes-01-grayscale-dark.png new file mode 100644 index 000000000..25a6cfa5e Binary files /dev/null and b/episodes/fig/shapes-01-grayscale-dark.png differ diff --git a/episodes/fig/shapes-01-labeled-dark.png b/episodes/fig/shapes-01-labeled-dark.png new file mode 100644 index 000000000..5311ecdc4 Binary files /dev/null and b/episodes/fig/shapes-01-labeled-dark.png differ diff --git a/episodes/fig/shapes-01-mask-dark.png b/episodes/fig/shapes-01-mask-dark.png new file mode 100644 index 000000000..0c9f1a596 Binary files /dev/null and b/episodes/fig/shapes-01-mask-dark.png differ diff --git a/episodes/fig/shapes-01-objects-coloured-by-area-dark.png b/episodes/fig/shapes-01-objects-coloured-by-area-dark.png new file mode 100644 index 000000000..e3da4ec3e Binary files /dev/null and b/episodes/fig/shapes-01-objects-coloured-by-area-dark.png differ diff --git a/episodes/fig/shapes-01-objects-coloured-by-area.png b/episodes/fig/shapes-01-objects-coloured-by-area.png index b70ec8ff4..e3da4ec3e 100644 Binary files a/episodes/fig/shapes-01-objects-coloured-by-area.png and b/episodes/fig/shapes-01-objects-coloured-by-area.png differ diff --git a/episodes/fig/shapes-01-selected-dark.png b/episodes/fig/shapes-01-selected-dark.png new file mode 100644 index 000000000..fd50ed96b Binary files /dev/null and b/episodes/fig/shapes-01-selected-dark.png differ diff --git a/episodes/fig/shapes-01.jpg b/episodes/fig/shapes-01.jpg new file mode 100644 index 000000000..6b2707adc Binary files /dev/null and b/episodes/fig/shapes-01.jpg differ diff --git a/episodes/fig/shapes-02-dark.jpg b/episodes/fig/shapes-02-dark.jpg new file mode 100644 index 000000000..5553492e5 Binary files /dev/null and b/episodes/fig/shapes-02-dark.jpg differ diff --git a/episodes/fig/shapes-02-mask-dark.png b/episodes/fig/shapes-02-mask-dark.png new file mode 100644 index 000000000..3d49ac5c9 Binary files /dev/null and b/episodes/fig/shapes-02-mask-dark.png differ diff --git a/episodes/fig/shapes-02-selected-dark.png b/episodes/fig/shapes-02-selected-dark.png new file mode 100644 index 000000000..eb5b6e914 Binary files /dev/null and b/episodes/fig/shapes-02-selected-dark.png differ diff --git a/episodes/fig/shapes-02.jpg b/episodes/fig/shapes-02.jpg new file mode 100644 index 000000000..5553492e5 Binary files /dev/null and b/episodes/fig/shapes-02.jpg differ diff --git a/episodes/fig/sudoku-dark.png b/episodes/fig/sudoku-dark.png new file mode 100644 index 000000000..e6262cf4d Binary files /dev/null and b/episodes/fig/sudoku-dark.png differ diff --git a/episodes/fig/sudoku-gray-dark.png b/episodes/fig/sudoku-gray-dark.png new file mode 100644 index 000000000..4565e282e Binary files /dev/null and b/episodes/fig/sudoku-gray-dark.png differ diff --git a/episodes/fig/sudoku.png b/episodes/fig/sudoku.png new file mode 100644 index 000000000..e6262cf4d Binary files /dev/null and b/episodes/fig/sudoku.png differ diff --git a/episodes/fig/three-colours-dark.png b/episodes/fig/three-colours-dark.png new file mode 100644 index 000000000..466b949f4 Binary files /dev/null and b/episodes/fig/three-colours-dark.png differ diff --git a/episodes/fig/wellplate-01-dark.jpg b/episodes/fig/wellplate-01-dark.jpg new file mode 100644 index 000000000..6cf02f4df Binary files /dev/null and b/episodes/fig/wellplate-01-dark.jpg differ diff --git a/episodes/fig/wellplate-01-masked-dark.jpg b/episodes/fig/wellplate-01-masked-dark.jpg new file mode 100644 index 000000000..8b3d918d8 Binary files /dev/null and b/episodes/fig/wellplate-01-masked-dark.jpg differ diff --git a/episodes/fig/wellplate-01.jpg b/episodes/fig/wellplate-01.jpg new file mode 100644 index 000000000..6cf02f4df Binary files /dev/null and b/episodes/fig/wellplate-01.jpg differ diff --git a/episodes/fig/wellplate-02-dark.jpg b/episodes/fig/wellplate-02-dark.jpg new file mode 100644 index 000000000..fc2cbf429 Binary files /dev/null and b/episodes/fig/wellplate-02-dark.jpg differ diff --git a/episodes/fig/wellplate-02-histogram-dark.png b/episodes/fig/wellplate-02-histogram-dark.png new file mode 100644 index 000000000..ac1091224 Binary files /dev/null and b/episodes/fig/wellplate-02-histogram-dark.png differ diff --git a/episodes/fig/wellplate-02-masked-dark.jpg b/episodes/fig/wellplate-02-masked-dark.jpg new file mode 100644 index 000000000..bbd2797b8 Binary files /dev/null and b/episodes/fig/wellplate-02-masked-dark.jpg differ diff --git a/episodes/fig/zero-dark.png b/episodes/fig/zero-dark.png new file mode 100644 index 000000000..44ead0281 Binary files /dev/null and b/episodes/fig/zero-dark.png differ diff --git a/learners/edge-detection.md b/learners/edge-detection.md index 0486e50a1..53d876513 100644 --- a/learners/edge-detection.md +++ b/learners/edge-detection.md @@ -128,7 +128,7 @@ We will execute the program on the `data/shapes-01.jpg` image, which we used before in [the *Thresholding* episode](../episodes/07-thresholding.md): -![](data/shapes-01.jpg){alt='coloured shapes'} +![](fig/shapes-01.jpg){alt='coloured shapes'} We are interested in finding the edges of the shapes in the image, and so the colours are not important. @@ -225,7 +225,7 @@ based on the contents of the image(s) to be processed. Here is an image of some glass beads that we can use as input into a Canny edge detection program: -![](data/beads.jpg){alt='Beads image'} +![](fig/beads.jpg){alt='Beads image'} We could use the `code/edge-detection/CannyEdge.py` program above to find edges in this image. @@ -394,7 +394,7 @@ Consider this image of a collection of maize seedlings, and suppose we wish to use simple fixed-level thresholding to mask out everything that is not part of one of the plants. -![](data/maize-roots-grayscale.jpg){alt='Maize roots image'} +![](fig/maize-roots-grayscale.jpg){alt='Maize roots image'} To perform the thresholding, we could first create a histogram, then examine it, and select an appropriate threshold value.