|
| 1 | +--- |
| 2 | +title: Introduction |
| 3 | +teaching: 5 |
| 4 | +exercises: 0 |
| 5 | +--- |
| 6 | + |
| 7 | +::::::::::::::::::::::::::::::::::::::: objectives |
| 8 | + |
| 9 | +- Recognise scientific questions that could be solved with image processing / computer vision. |
| 10 | +- Recognise morphometric problems (those dealing with the number, size, or shape of the objects in an image). |
| 11 | + |
| 12 | +:::::::::::::::::::::::::::::::::::::::::::::::::: |
| 13 | + |
| 14 | +:::::::::::::::::::::::::::::::::::::::: questions |
| 15 | + |
| 16 | +- What sort of scientific questions can we answer with image processing / computer vision? |
| 17 | +- What are morphometric problems? |
| 18 | + |
| 19 | +:::::::::::::::::::::::::::::::::::::::::::::::::: |
| 20 | + |
| 21 | +As computer systems have become faster and more powerful, |
| 22 | +and cameras and other imaging systems have become commonplace |
| 23 | +in many other areas of life, |
| 24 | +the need has grown for researchers to be able to |
| 25 | +process and analyse image data. |
| 26 | +Considering the large volumes of data that can be involved - |
| 27 | +high-resolution images that take up a lot of disk space/virtual memory, |
| 28 | +and/or collections of many images that must be processed together - |
| 29 | +and the time-consuming and error-prone nature of manual processing, |
| 30 | +it can be advantageous or even necessary for this processing and analysis |
| 31 | +to be automated as a computer program. |
| 32 | + |
| 33 | +This lesson introduces an open source toolkit for processing image data: |
| 34 | +the Python programming language |
| 35 | +and [the *scikit-image* (`skimage`) library](https://scikit-image.org/). |
| 36 | +With careful experimental design, |
| 37 | +Python code can be a powerful instrument in answering many different kinds of questions. |
| 38 | + |
| 39 | +## Uses of Image Processing in Research |
| 40 | + |
| 41 | +Automated processing can be used to analyse many different properties of an image, |
| 42 | +including the distribution and change in colours in the image, |
| 43 | +the number, size, position, orientation, and shape of objects in the image, |
| 44 | +and even - when combined with machine learning techniques for object recognition - |
| 45 | +the type of objects in the image. |
| 46 | + |
| 47 | +Some examples of image processing methods applied in research include: |
| 48 | + |
| 49 | +- [Imaging a black hole](https://iopscience.iop.org/article/10.3847/2041-8213/ab0e85) |
| 50 | +- [Segmentation of liver and vessels from CT images](https://doi.org/10.1016/j.cmpb.2017.12.008) |
| 51 | +- [Monitoring wading birds in the Everglades using drones](https://dx.doi.org/10.1002/rse2.421) ([Blog article summarizing the paper](https://jabberwocky.weecology.org/2024/07/29/monitoring-wading-birds-in-near-real-time-using-drones-and-computer-vision/)) |
| 52 | +- [Estimating the population of emperor penguins](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3325796/) |
| 53 | +- [Global-scale analysis of marine plankton diversity](https://www.cell.com/cell/fulltext/S0092-8674\(19\)31124-9) |
| 54 | + |
| 55 | +With this lesson, |
| 56 | +we aim to provide a thorough grounding in the fundamental concepts and skills |
| 57 | +of working with image data in Python. |
| 58 | +Most of the examples used in this lesson focus on |
| 59 | +one particular class of image processing technique, *morphometrics*, |
| 60 | +but what you will learn can be used to solve a much wider range of problems. |
| 61 | + |
| 62 | +## Morphometrics |
| 63 | + |
| 64 | +Morphometrics involves counting the number of objects in an image, |
| 65 | +analyzing the size of the objects, |
| 66 | +or analyzing the shape of the objects. |
| 67 | +For example, we might be interested in automatically counting |
| 68 | +the number of bacterial colonies growing in a Petri dish, |
| 69 | +as shown in this image: |
| 70 | + |
| 71 | +{alt='Bacteria colony'} |
| 72 | + |
| 73 | +We could use image processing to find the colonies, count them, |
| 74 | +and then highlight their locations on the original image, |
| 75 | +resulting in an image like this: |
| 76 | + |
| 77 | +{alt='Colonies counted'} |
| 78 | + |
| 79 | +::::::::::::::::::::::::::::::::::::::::: callout |
| 80 | + |
| 81 | +## Why write a program to do that? |
| 82 | + |
| 83 | +Note that you can easily manually count the number of bacteria colonies |
| 84 | +shown in the morphometric example above. |
| 85 | +Why should we learn how to write a Python program to do a task |
| 86 | +we could easily perform with our own eyes? |
| 87 | +There are at least two reasons to learn how to perform tasks like these |
| 88 | +with Python and scikit-image: |
| 89 | + |
| 90 | +1. What if there are many more bacteria colonies in the Petri dish? |
| 91 | + For example, suppose the image looked like this: |
| 92 | + |
| 93 | +{alt='Bacteria colony'} |
| 94 | + |
| 95 | +Manually counting the colonies in that image would present more of a challenge. |
| 96 | +A Python program using scikit-image could count the number of colonies more accurately, |
| 97 | +and much more quickly, than a human could. |
| 98 | + |
| 99 | +2. What if you have hundreds, or thousands, of images to consider? |
| 100 | + Imagine having to manually count colonies on several thousand images |
| 101 | + like those above. |
| 102 | + A Python program using scikit-image could move through all of the images in seconds; |
| 103 | + how long would a graduate student require to do the task? |
| 104 | + Which process would be more accurate and repeatable? |
| 105 | + |
| 106 | +As you can see, the simple image processing / computer vision techniques you |
| 107 | +will learn during this workshop can be very valuable tools for scientific |
| 108 | +research. |
| 109 | + |
| 110 | + |
| 111 | +:::::::::::::::::::::::::::::::::::::::::::::::::: |
| 112 | + |
| 113 | +As we move through this workshop, |
| 114 | +we will learn image analysis methods useful for many different scientific problems. |
| 115 | +These will be linked together |
| 116 | +and applied to a real problem in the final end-of-workshop |
| 117 | +[capstone challenge](09-challenges.md). |
| 118 | + |
| 119 | +Let's get started, |
| 120 | +by learning some basics about how images are represented and stored digitally. |
| 121 | + |
| 122 | +:::::::::::::::::::::::::::::::::::::::: keypoints |
| 123 | + |
| 124 | +- Simple Python and scikit-image techniques can be used to solve genuine image analysis problems. |
| 125 | +- Morphometric problems involve the number, shape, and / or size of the objects in an image. |
| 126 | + |
| 127 | +:::::::::::::::::::::::::::::::::::::::::::::::::: |
0 commit comments