This is a relatively new curriculum. The estimated timings for each episode are based on limited experience and should be taken as a rough guide only. If you teach the curriculum, the Maintainers would be delighted to receive feedback with information about the time that was required for teaching and exercises in each episode of your workshop.
Please open an issue on the repository to share your experience with the lesson Maintainers.
This lesson is designed to be taught using Jupyter notebooks. We recommend that instructors guide learners to create a new Jupyter notebook for each episode.
importstatements typically appear in the first code block near the top of each episode. In some cases, the purpose of specific libraries is briefly explained as part of the exercises.
The possibility of executing the code cells in a notebook in arbitrary order can cause confusion. Using the “restart kernel and run all cells” feature is one way to accomplish linear execution of the notebook and may help locate and identify coding issues.
Many episodes in this lesson load image files from disk. To avoid name clashes in episodes that load multiple image files, we have used unique variable names (instead of generic names such as
img). When copying code snippets between exercises, the variable names may have to be changed. The maintainers are keen to receive feedback on whether this convention proves practical in workshops.
imageio.v3allows to load images in different modes by passing the
imread(). Depending on the image file and mode, the
dtypeof the resulting Numpy array can be different (e.g.,
dtype('float64'). In the lesson,
skimage.util.img_as_float()are used to convert the data type when necessary.
skimagefunctions implicitly convert the pixel values to floating-point numbers. Several callout boxes have been added throughout the lesson to raise awareness, but this may still prompt questions from learners.
In certain situations,
imread()returns a read-only array. This depends on the image file type and on the backend (e.g., Pillow). If a read-only error is encountered,
image = np.array(image)can be used to create a writable copy of the array before manipulating its pixel values.
Be aware that learners might get surprising results in the Keeping only low intensity pixels exercise, if
plt.imshowis called without the
vmaxparameter. A detailed explanation is given in the Plotting single channel images (cmap, vmin, vmax) callout box.
A: In an image viewer, hover your cursor over top-left (origin) the move down and see which number increases.
A: It is a large image.
r,c with numpy arrays, unless clearly
specified otherwise - only represented
x,y when image is
displayed by a viewer. Take home is don’t rely on it - always check!
A: When resizing or rescaling an image,
interpolation to up-size or down-size the image. Technically, this is
done by fitting a spline
function to the image data. The spline function is based on the
intensity values in the original image and can be used to approximate
the intensity at any given coordinate in the resized/rescaled image.
Note that the intensity values in the new image are an approximation of
the original values but should not be treated as the actual, observed
skimage.transform.resize has a number of optional
parameters that allow the user to control, e.g., the order of the spline
interpolation. The scikit-image
documentation provides additional information on other
Q: Why are some lines missing from the sudoku image when it is displayed inline in a Jupyter Notebook? (skimage-images/low intensity pixels exercise)
A: They are actually present in image but not shown due to interpolation.
Q: Does blurring take values of pixels already blurred, or is blurring done on original pixel values only?
A: Blurring is done on original pixel values only.
Learners reported a problem on some operating systems, that Shift+Enter is prevented from running a cell in Jupyter when the caps lock key is active.
Take care to avoid mixing up the term “edge” to describe the edges of objects within an image and the outer boundaries of the images themselves. Lack of a clear distinction here may be confusing for learners.